Blockchain
Mining: from CPU to ASIC
In January 2009 Satoshi Nakamoto launched Bitcoin on an ordinary laptop and earned 50 BTC for every block. Today mining a single block requires computing power that exceeds all the supercomputers in the world combined, and the reward has fallen to 3.125 BTC. How does a network with no central management automatically regulate difficulty, distribute rewards, and guarantee that the last Bitcoin won't be mined for another 116 years?
- **Foundry USA Pool** controls ~30% of Bitcoin's hashrate - one pool determines the contents of almost every third block. It's as if one publisher controlled a third of all newspapers
- **The 2024 halving** cut miner revenue in half overnight - while electricity prices stayed the same. Unprofitable miners switched off, hashrate temporarily dropped, difficulty adjusted, and the system found a new equilibrium
- **The genesis block coinbase transaction** contains the Times headline about a bank bailout - Satoshi wasn't just testing the system but left a political statement in the very first block
Satoshi and CPU mining
On January 3, 2009, Satoshi Nakamoto launched Bitcoin on a regular PC. For the first few months he mined almost alone - difficulty was 1 and an ordinary CPU could find a block in minutes. Satoshi mined roughly **1,100,000 BTC** (the Patoshi pattern), which have never been spent. The hardware evolution was rapid: CPU (2009) → GPU (2010, ~100x faster) → FPGA (2011) → ASIC (2013, chips dedicated exclusively to SHA-256). Each transition made the previous hardware unprofitable within months.
The evolution from CPU to ASIC is a vivid demonstration of how difficulty adjustment maintains network stability during exponential growth in computing power.
Предварительные знания
Mining Pools: strength in numbers
In the Proof of Work lesson we established that mining is iterating over nonces in search of a hash below the target. But here's the problem: a **solo miner** with one ASIC at the current network hashrate will find a block **once every few decades**. It's like a lottery where the odds of winning are 1 in 40,000,000,000,000,000,000 - you could wait a lifetime.
A **Mining Pool** is a collective of miners who combine their computing power and split the reward proportionally to contribution. Instead of one huge jackpot once in 50 years - a steady stream of small payouts every day.
The key idea is **variance reduction**. The expected income of a solo miner and a pool participant are mathematically the same, but the **variability** is radically different. It's like insurance: you 'pay' the pool a share of the fees in exchange for income predictability.
How does the pool coordinate work? Through the **Stratum V2** protocol (successor to Stratum V1). The pool assigns each miner their own nonce range to iterate over. The miner sends the pool a **share** - a result that satisfies a lower difficulty (not enough for a block, but proves the miner is working).
**Reward distribution schemes:** - **PPS (Pay Per Share)** - fixed payment per share. The pool bears all risk. Pool fee is higher (~2-4%) - **PPLNS (Pay Per Last N Shares)** - reward is split among the last N shares when a block is found. More fair, but less predictable. Fee ~1-2% - **FPPS (Full Pay Per Share)** - like PPS, but includes transaction fees. The most popular scheme in 2024
**Largest pools (2024):** Foundry USA (~30%), AntPool (~15%), F2Pool (~12%), ViaBTC (~11%). Together the top 4 pools control ~68% of network hashrate. This creates a **centralization risk** - if 2-3 large pools collude, they could theoretically conduct a 51% attack.
**Pool centralization is a real threat.** In 2014 pool GHash.IO temporarily controlled >50% of Bitcoin's hashrate. The panic was so severe that miners voluntarily left the pool. Stratum V2 partly addresses the problem: miners themselves choose the transactions for a block, not the pool operator.
Why do miners join pools if the expected income for a solo miner is the same?
Difficulty Adjustment: Bitcoin's autopilot
Bitcoin promises a block every ~10 minutes. But the network hashrate constantly changes: new ASICs come online, old ones go offline, electricity prices fluctuate. How is the stable 10-minute interval maintained when computing power jumps around?
The answer is **difficulty adjustment**. Every **2016 blocks** (~2 weeks at 10 min/block) the protocol automatically recalculates the target. The formula is plain:
The logic is simple: - Blocks came **faster** than 10 min → actual_time < expected → target **decreases** → difficulty **increases** - Blocks came **slower** than 10 min → actual_time > expected → target **increases** → difficulty **decreases**
The **historical growth in difficulty** is impressive: - 2009: difficulty = **1** (Satoshi mined on a CPU) - 2013: difficulty = **1,000,000,000** (GPU/ASIC era) - 2024: difficulty = **~80,000,000,000,000** (80 trillion) Difficulty has grown **80 trillion times** in 15 years. It's as if the Olympic 100-meter sprint sped up 10x every year - by 2024 sprinters would cover 100 meters in the time light takes to cross an atom.
**The x4 clamp** is protection against manipulation. Without it an attacker could mine 2016 blocks with fake timestamps, crashing the difficulty to zero. The clamp guarantees that even the most aggressive attack requires several adjustment periods.
Bitcoin's network hashrate suddenly doubled. What happens?
Block Reward: where new Bitcoin comes from
Every time a miner (or pool) finds a valid block, they receive a **block reward** consisting of two components: 1. **Block subsidy** - new BTC created 'out of thin air' (issuance) 2. **Transaction fees** - fees for all transactions in the block
Mechanically the reward is implemented through the **coinbase transaction** - a special transaction that is always first in a block. It has no inputs: it creates BTC from nothing. This is the only way new Bitcoin enters the system.
**Who receives the reward?** The miner who found the block specifies their address (or the pool address) in the coinbase transaction output. Full nodes verify that the sum of coinbase outputs does not exceed subsidy + total block fees. If a miner tries to claim more - the block will be rejected by the network.
Coinbase as a bulletin board
The coinbase field allows recording up to 100 bytes of arbitrary data
Famous coinbase messages: - Block #0 (genesis, 2009): "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks" - Satoshi inscribed a Times headline as proof-of-date and a political statement - Block #629999 (last before 2020 halving): "NYTimes 09/Apr/2020 With $2.3T Injection, Fed's Plan Far Exceeds 2008 Rescue" - the miner drew a parallel to the genesis block - Pools sign their blocks: "/Foundry USA Pool/", "/AntPool/" - this lets you track which pool found a block
**Lost rewards.** If a miner accidentally claims a reward less than the maximum allowed, the difference is **burned forever**. In block #124724 (2011) a miner included no coinbase output at all - 50 BTC are lost permanently. The protocol does not correct miner mistakes.
What is a coinbase transaction?
Halving: programmed scarcity
The most well-known Bitcoin mechanism - **halving**. Every **210,000 blocks** (~4 years) the block subsidy is cut exactly in half. This is hard-coded in Bitcoin and cannot be changed without consensus from the entire network.
Why exactly 210,000 blocks and 21 million? It follows from a geometric series:
By 2024 more than **94%** of all Bitcoin has already been mined. But the last satoshi will be mined only around **2140** - 116 years from now. Each subsequent halving slows issuance exponentially.
The **security budget debate** is the main discussion surrounding halving. When the block subsidy becomes negligible, network security will depend **entirely** on transaction fees. The question is: will fees be sufficient to motivate miners?
**Halving as an economic event.** Each halving sharply reduces the inflow of new BTC to the market. Before the 2024 halving miners were selling ~900 BTC/day to cover costs. After - ~450 BTC/day. With the same demand this creates upward price pressure. Historically Bitcoin's price has risen significantly in the 12-18 months after each halving - though correlation doesn't imply causation.
**Common confusion:** halving does not change the difficulty. Difficulty adjustment and halving are two **independent** mechanisms. Difficulty depends on hashrate (every 2016 blocks), halving depends on block height (every 210,000 blocks). They can coincide but are not related.
Halving reduces the amount of existing Bitcoin - after a halving people end up with half as many BTC
Halving only reduces the **rate of creation** of new Bitcoin (block subsidy). All existing BTC remain untouched. Halving affects the inflow, not the stock.
This confusion arises from the word 'halving' - it sounds like something is being split in half. In reality only the reward for the new block is halved. Analogy: if a factory makes 100 cars per day and cuts production to 50 - that doesn't mean car owners have half their vehicles taken away.
By 2140 the block subsidy will reach zero. What will motivate miners to keep supporting the network?
Summary
- **Mining Pools** combine the hashrate of thousands of miners to reduce income variance. PPS/PPLNS/FPPS schemes determine reward distribution, but create a centralization risk - the top 4 pools control ~68% of the network
- **Difficulty Adjustment** every 2016 blocks automatically calibrates difficulty via `new = old × (actual_time / expected_time)`, maintaining the 10-minute interval. This mechanism allowed the network to survive China's mining ban and a 80-trillion-fold growth in hashrate
- **Block Reward** = coinbase transaction (block subsidy + transaction fees). This is the only mechanism for new BTC issuance - coins are literally born from code
- **Halving** every 210,000 blocks cuts the subsidy in half: 50 → 25 → 12.5 → 6.25 → 3.125 BTC. In January 2009 Satoshi mined on a laptop and earned 50 BTC per block - today a farm of thousands of ASICs earns 3.125 BTC. The last satoshi will be mined ~2140, and the security budget will then depend entirely on transaction fees
Related topics
Bitcoin mining links cryptography, game theory, and economics:
- Proof of Work — Mining is the practical application of PoW: nonce iteration, target, hashrate. This lesson reveals the economics on top of the cryptography
- Bitcoin Economics — Halving and the security budget directly determine Bitcoin's economic model - inflation, deflation, and long-term sustainability
- UTXO Model — The coinbase transaction creates the first UTXO in the chain - this is how new BTC enters circulation and begins to be spent
Вопросы для размышления
- If Satoshi had not included halving and the block subsidy remained 50 BTC forever, how would that affect Bitcoin's economics? Would the system be viable?
- The top 3 mining pools control more than 50% of hashrate. Why haven't they carried out a 51% attack yet? What stops them, given that it's technically possible?
- Imagine that in 2060 transaction fees total just $10 per block while mining costs are $1,000. How would this affect network security, and what solutions would you propose?