There is no line in Bitcoin’s code that says “stop at 21 million.” The cap is the sum of a schedule: every block pays a fixed reward, that reward is cut in half every 210,000 blocks, and 210,000 blocks times 50 bitcoin times one, plus one half, plus one quarter, and so on, adds up to just under 21 million. The exact total the code can ever issue is 20,999,999.9769 bitcoin.
I read the cap out of Bitcoin Core’s source, line by line, and computed the full schedule from it. Here is what the code actually says, why the total falls short of a round number, and what it would take to change it.
The function that sets the supply
The whole issuance schedule lives in one short function in src/validation.cpp. This is the current version from the Bitcoin Core repository:
CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
{
int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
// Force block reward to zero when right shift is undefined.
if (halvings >= 64)
return 0;
CAmount nSubsidy = 50 * COIN;
// Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
nSubsidy >>= halvings;
return nSubsidy;
}
Taken line by line:
- halvings is the block height divided by 210,000, rounded down. Block 839,999 is in era 4. Block 840,000 starts era 5.
- 50 * COIN is the starting reward. COIN is 100,000,000, the number of satoshis in one bitcoin, so the reward is counted in whole satoshis, never fractions.
- >>= halvings shifts the number right in binary, once per halving. Each shift divides by two and throws away any remainder.
- halvings >= 64 is a guard against a C++ quirk. It is not what ends issuance; the reward reaches zero long before then.
There is a 21 million figure in the code, but it does something else. src/consensus/amount.h defines MAX_MONEY as 21,000,000 times COIN, and the comment above it calls it a sanity check: no single amount in a transaction may be larger. The supply cap itself is never written down. It falls out of the arithmetic.
Bitcoin issuance schedule, computed
Running that function for every era gives the whole schedule. The first eight eras cover more than 99.6% of all the bitcoin there will ever be.
| Era | Starting block | Reward per block | New bitcoin in the era | Total issued at era end |
|---|---|---|---|---|
| 1 | 0 | 50 | 10,500,000 | 10,500,000 |
| 2 | 210,000 | 25 | 5,250,000 | 15,750,000 |
| 3 | 420,000 | 12.5 | 2,625,000 | 18,375,000 |
| 4 | 630,000 | 6.25 | 1,312,500 | 19,687,500 |
| 5 (current) | 840,000 | 3.125 | 656,250 | 20,343,750 |
| 6 | 1,050,000 | 1.5625 | 328,125 | 20,671,875 |
| 7 | 1,260,000 | 0.78125 | 164,062.5 | 20,835,937.5 |
| 8 | 1,470,000 | 0.390625 | 82,031.25 | 20,917,968.75 |
| 11 | 2,100,000 | 0.04882812 | 10,253.9052 | 20,989,746.0927 |
| 33 (last) | 6,720,000 | 0.00000001 | 0.0021 | 20,999,999.9769 |

Why the supply cap is not exactly 21 million
Look at era 11. A reward of 50 bitcoin halved ten times would be 0.048828125, but the code counts in satoshis, and 0.048828125 bitcoin is 4,882,812.5 satoshis. The right shift drops the half. From there on, every era loses a sliver to rounding.
By era 33 the reward is one satoshi. At block 6,930,000 one satoshi shifts to zero, and new issuance ends. Add every era up and the maximum is 2,099,999,997,690,000 satoshis: 20,999,999.9769 bitcoin, about 0.0231 short of 21 million.
The real number will be lower still. Bitcoin Core skips the genesis block’s transactions when it connects that block, so its 50 bitcoin reward was never spendable. BIP 30 records two early blocks, at heights 91,842 and 91,880, whose reward transactions duplicated earlier ones and overwrote them, taking another 100 bitcoin of the schedule out of reach. That is at least 150 bitcoin issued on paper that no one can ever move, before counting a single lost key.
Why 21 million and not some other number?
Satoshi never published a derivation. In an April 2009 email to Mike Hearn, he said as much:
My choice for the number of coins and distribution schedule was an educated guess.
Satoshi Nakamoto, email to Mike Hearn, April 12, 2009
I think that is the right way to read the number. 21 million is not magic. The total could have been 2.1 million or 2.1 billion, and because the unit divides into 100 million satoshis, the price per coin would simply have settled at a different level. The size of the total matters far less than the fact that it, and the path to it, was fixed before anyone could know who would benefit from changing it.
Can Bitcoin’s max supply be changed?
In the narrow sense, yes. It is software. Anyone can edit GetBlockSubsidy and compile a version that pays more.
The catch is who has to agree. Every full node checks every block against its own copy of the rules. In ConnectBlock, Bitcoin Core compares what a block’s reward transaction pays against the subsidy plus the fees in that block, and if the block pays out more, it is rejected with the error bad-cb-amount. A miner running the edited version would produce blocks that the rest of the network treats as invalid. To change the schedule, you would need the people running nodes to install the new rules on purpose.
That has been tested once, by accident. On August 15, 2010, block 74,638 contained a transaction that created 184,467,440,737.09551616 bitcoin by exploiting an overflow bug in how outputs were added up. That was a bug, not a policy change. A patched client was released within about five hours, nodes upgraded, and the chain without the bad transaction overtook the bad chain at block 74,691 the next day. The patch also added the check that no output may exceed 21 million bitcoin. Nobody kept the 184 billion.
That episode is the closest thing to an answer the record offers. When issuance broke, the network treated it as damage and repaired it, rather than as a new supply to work with.
The strongest case against a hard cap
The serious objection comes from the security budget. Miners are paid by the block reward plus fees, and the reward is heading to zero. In 2016, Miles Carlsten, Harry Kalodner, S. Matthew Weinberg, and Arvind Narayanan published “On the Instability of Bitcoin Without the Block Reward,” which modeled a fee-only world and found that mining could become unstable, with miners gaining from tactics such as re-mining a recent block that held rich fees in order to take those fees for themselves.
I take that seriously. The fee market is the open question in Bitcoin’s design, and the 21 million cap is what forces it. The cap’s credibility is the product, and the security budget is the bill for it. Whether fees alone can pay that bill is something the next several eras will test in public, a little more each halving.
Where the schedule stands now
On November 2, 2026, the chain reached block 974,282. By the subsidy schedule, blocks 0 through 974,282 can have issued at most 20,107,134.375 bitcoin, about 95.7% of the 20,999,999.9769 maximum. The next halving, to 1.5625 bitcoin per block, comes at block 1,050,000, which is 75,718 blocks away; at the ten-minute target that lands in 2028. The last satoshi of new issuance comes at block 6,929,999, almost six million blocks from now, which at the same pace is around the year 2140.
Those dates are estimates from the block target, not promises. Blocks arrive on average every ten minutes, not exactly, so the halving date drifts by days. The block numbers do not drift. That is the point of writing the schedule in blocks.
Where this fits
- Two rungs down: What 21 Million Looks Like explains the cap for a younger reader.
- One rung down: How Does Bitcoin Work? A Plain-English Guide shows where the block reward comes from, traced through block 170.
- Same rung: Bitcoin Halving Cycle Returns: Why Each Cycle Pays Less follows the halving schedule into market history.
- The other side: How Does Money Lose Value? covers what happens to money whose supply has no fixed schedule.
For further reading, the Advanced Bitcoin shelf of the Card Catalog includes Parker Lewis’s Gradually, Then Suddenly, a collection of essays on how Bitcoin’s monetary design works. That book link is an Amazon affiliate link; Modern Wealth Model may earn a commission at no cost to you.
Sources
- Bitcoin Core, src/validation.cpp (GetBlockSubsidy; the bad-cb-amount check in ConnectBlock; genesis block special case). Read November 2, 2026.
- Bitcoin Core, src/consensus/amount.h (COIN and MAX_MONEY).
- BIP 30: Duplicate transactions (blocks 91,842 and 91,880).
- Bitcoin Wiki, CVE-2010-5139, the value overflow incident (block 74,638, August 15, 2010).
- Satoshi Nakamoto to Mike Hearn, email of April 12, 2009, published by Hearn; text via this archive.
- Miles Carlsten, Harry Kalodner, S. Matthew Weinberg, and Arvind Narayanan, On the Instability of Bitcoin Without the Block Reward, ACM CCS 2016.
- Block 840,000 (April 20, 2024, UTC) and block height 974,282 on November 2, 2026, read from mempool.space. Issuance totals computed by Modern Wealth Model.