cryptonist
A printed circuit board photographed flat, its traces and mounted components in rows

Explainers

What the bitcoin halving changes, and what it leaves alone

The halving is one line of arithmetic in Bitcoin’s consensus code. Every 210,000 blocks, the number of new coins a miner may pay itself for producing a block is cut in half. It is counted in blocks rather than dates, it touches the newly issued part of a miner’s pay and not the fees, and the 21 million figure usually quoted with it is what the halvings add up to, not a separate rule.

What halves: the subsidy, not the reward

Every block opens with a coinbase transaction, in which the miner pays itself. The developer guide’s description of the chain splits what it may claim into two parts, a block subsidy and the transaction fees paid by the transactions in the block. The whitepaper describes both in its section on incentives: the first transaction in a block “starts a new coin owned by the creator of the block”, and when a transaction’s outputs add up to less than its inputs, the paper treats the difference as a fee that goes to the creator of the block containing it. Only the subsidy halves.

In Bitcoin Core the subsidy is computed by GetBlockSubsidy. It divides the block’s height by the halving interval, 210,000 on the main network, to get the number of halvings so far, then shifts 50 coins (held as 5,000,000,000 satoshis) right by that many bits, which halves it once per halving and drops any fraction of a satoshi. When a node checks a block, it adds that subsidy to the fees in the block and rejects the block as “bad-cb-amount” if the coinbase pays out more than the total.

The rule is older than any halving. The first commit in the project’s public repository, dated 30 August 2009, already shifts the subsidy by the height divided by 210,000, under the comment “Subsidy is cut in half every 4 years”. Nothing needs to be switched on when a halving arrives. Every node runs the same calculation for every block, and a halving block is simply the first at which the answer is smaller.

Counted in blocks, not on a calendar

The table lists the four halvings so far, with the subsidy that applied from each one and the timestamp each block carries in its header, from mempool.space. The timestamp is set by the miner, and Bitcoin Core accepts one up to two hours ahead of its own clock, so treat the minutes as approximate.

BlockTimestamp (UTC)Subsidy from this block
210,00028 Nov 2012, 15:2425 BTC
420,0009 Jul 2016, 16:4612.5 BTC
630,00011 May 2020, 19:236.25 BTC
840,00020 Apr 2024, 00:093.125 BTC

The “four years” in the code comment follows from the block target. The mainnet parameters set a spacing of ten minutes, and 210,000 blocks at ten minutes each is 1,458⅓ days. The real gaps have all been shorter: 1,319 days between the first and second halvings, 1,402 between the second and third, 1,439 between the third and fourth, by the timestamps above.

The reason is the way difficulty is set. Every 2,016 blocks the network rescales how hard a block is to find so that, at the hashing rate it has just measured, the next 2,016 would take two weeks. When more hashing power joins between adjustments, blocks come faster than the target until the next rescale, and the time gained is never taken back. What cloud mining claims rest on sets out the adjustment rule in full. The next halving falls at block 1,050,000, when the subsidy drops to 1.5625 BTC. The chain tip when read on 22 November 2026 was block 977,106, per mempool.space, which leaves 72,894 blocks, or about 506 days at exactly the target pace.

Where 21 million comes from

The cap is arithmetic. The first 210,000 blocks pay 50 coins each, 10.5 million in all, and each later run of 210,000 pays half as much as the one before, so the total approaches twice the first run without reaching it. The schedule had issued half its eventual total by block 210,000, three-quarters by 420,000, 87.5% by 630,000 and 93.75% by 840,000, and by block 1,050,000 the figure will be 96.875%. These shares are computed here from the code’s rule.

Satoshis are whole numbers, and that shaves the total. A shift drops whatever does not divide, and 5,000,000,000 halves cleanly only nine times, so from the tenth halving onwards the subsidy sits slightly below 50 coins divided exactly by the matching power of two, and the shortfall accumulates. Summing the schedule in whole satoshis gives 20,999,999.9769 bitcoin, the figure the tokenomics piece also reaches. The subsidy is one satoshi from block 6,720,000 and zero from block 6,930,000, the 33rd halving, which at the ten-minute target is about 132 years of blocks after the first.

One guard in the function looks redundant and is not. GetBlockSubsidy returns zero outright once the count reaches 64 halvings, with the comment “Force block reward to zero when right shift is undefined”. It came from BIP-42, a tongue-in-cheek document assigned on 1 April 2014 that fixed a real problem. The original line relied on behaviour the C++ specification leaves undefined, and on the platforms then supported, BIP-42 says, the cycle “repeats itself every 64 halvings”. The change that implemented it, merged on 3 April 2014, is titled “Fix for GetBlockValue() after block 13,440,000”, the height at which the subsidy would otherwise have returned to 50 coins.

The 21 million in the code is something else again. The constant MAX_MONEY is set to 21 million coins, and its own comment says it is “not the total money supply”, which “currently happens to be less than 21,000,000 BTC for various reasons”. It is a sanity check: no single amount larger than it is valid.

Less than the schedule

Some of the coins the schedule allows can never be spent, or were never issued at all, and Bitcoin Core counts them. Its gettxoutsetinfo command, run with the coin statistics index, reports a total “permanently excluded from the UTXO set” in four categories.

The first is the genesis block. Its 50-coin output was never added to the set of spendable outputs, and the validation code skips the block’s transactions with the note “its coinbase is unspendable”.

The second is a pair of duplicated transactions. Before BIP-30 ruled it out, two coinbase transactions were repeated exactly, in November 2010. The copy at block 91,842 overwrote the original at block 91,812, and the copy at 91,880 the one at 91,722, before either original had been spent. Each original paid 50 coins, per mempool.space, so with the genesis output that makes 150 coins no key can move.

Third come scripts that can never be spent, for which the command’s help text gives data-carrying OP_RETURN outputs as the example. Last, unclaimed rewards. The consensus check only stops a miner taking too much, so a coinbase that claims less than it could leaves the rest unissued for good. The help text calls these fee rewards “that miners did not claim”, and the index behind the command counts any shortfall against the full block reward.

Coins whose keys have been lost are not in any of the four. On chain they look exactly like coins whose owners are waiting, and no software can tell the two apart, so the amount that will ever move again is no higher than the figure the code reports and nobody knows how much lower.

What changes for miners

A halving cuts the subsidy part of a miner’s pay per block in half. The fees part is untouched by the rule; it depends on the fee rates attached to the transactions in the block, which are charged by weight as described in how bitcoin transactions work. The whitepaper anticipated the shift: “Once a predetermined number of coins have entered circulation, the incentive can transition entirely to transaction fees and be completely inflation free.”

The halving blocks themselves show how unsteady the fee part is. Per mempool.space, block 210,000 carried about 13.56 BTC in fees, block 420,000 about 0.58, block 630,000 about 0.91 and block 840,000 about 37.63, twelve times its own 3.125 subsidy. Single blocks say little about any period, and the reasons behind those totals are not recorded in the blocks. What they show is how far the fee part can swing. The developer guide ties fee rates to current demand for space in mined blocks, rising as demand rises, which is also why some transactions wait, as stuck crypto transactions explains.

If some miners switch off after a halving, nothing in the halving responds. Blocks arrive more slowly until the next difficulty adjustment, which can lower difficulty by at most a factor of four at a time, and the pace then returns towards ten minutes. Why the system pays for hashing at all, and what that payment secures, is the subject of proof of work and proof of stake.

Ethereum handles fees differently. Its base fee is burned rather than paid to the block producer, as the gas explainer sets out, whereas a bitcoin miner may claim every satoshi of fee in the block, and the whitepaper’s end state is one in which fees are the miners’ only pay.

What it leaves alone

A halving changes one number. The target of one block every ten minutes, the difficulty rule, the block weight limit, the rules for what makes a transaction valid, the 100-block wait before a coinbase output can be spent, and every coin already issued are exactly as they were the block before. No vote takes place and no software is upgraded for it.

Changing the schedule itself would mean persuading the people who run nodes to run different rules, and a node that kept the old ones would reject any block paying out more than they allow. The rules are only as good as the code that checks them, though, and that code has been wrong before. The US National Vulnerability Database records CVE-2010-5139, an integer overflow in versions before 0.3.11 that allowed a crafted transaction to “create many bitcoins”. The MAX_MONEY comment names “a(nother) overflow bug” as the kind of unusual circumstance in which changing that constant “could lead to a fork”.

How to check it yourself

Open a halving block on an explorer and find its coinbase transaction: the total it pays can be no more than the subsidy for that height plus the fees in the block, and normally equals it. How to read a block explorer covers the fields. With a node of your own, Bitcoin Core’s getblockstats returns a block’s subsidy and totalfee, and gettxoutsetinfo returns the total amount sitting in unspent outputs, which falls short of the schedule’s running total by the categories above.