Skip to content
Basis Desk
Bitcoin · 6 min read Last reviewed September 30, 2026

Why Bitcoin's Supply Is Capped at 21 Million: The Code Behind Scarcity

Bitcoin's 21 million supply cap is a hard-coded limit enforced by decentralized consensus. Discover the mathematics behind the halving, the reality of lost coins, and how the network plans to transition to a fee-only security model.

Editorial oversight: Julian Mercer, Chief Editor
Neutral

Key points

  • Bitcoin's supply is capped at a maximum of 21 million units, a limit enforced by decentralized consensus and mathematical code.
  • The supply limit is the sum of a geometric series where the block subsidy halves every 210,000 blocks, or roughly every four years.
  • Due to bitwise rounding in the code, the exact maximum supply that can ever exist is 20,999,999.97690000 BTC.
  • Millions of coins are estimated to be permanently lost due to misplaced private keys, unspendable genesis blocks, and unclaimed rewards.
  • By approximately the year 2140, the block subsidy will reach zero, and miners will be compensated entirely through transaction fees.

Bitcoin's supply is capped at 21 million units by a hard-coded mathematical formula in its open-source protocol 1. This absolute limit is enforced by a decentralized network of independent computers, meaning no central bank, government, or developer can inflate the supply 1. By tying issuance to mathematical consensus rather than human discretion, the network establishes a predictable, programmatic monetary policy 1.

Understanding this cap requires looking at how the network issues new currency, how the code handles division, and what happens when the last fraction of a coin is mined. This design choice introduces unique economic dynamics, ranging from the permanent loss of coins to an eventual transition where miners must rely entirely on transaction fees for security.

Monetary Policy Written in Code

To understand why the supply is capped, one must look at how new units of Bitcoin ($BTC) enter circulation. Unlike fiat currencies, which central banks print at will, new BTC is created through a process called mining 1. Miners run specialized hardware to solve complex cryptographic puzzles, which secures the network by grouping transactions into blocks 1.

As an incentive for providing this security, the protocol awards the miner who successfully validates a block with a set amount of newly minted BTC, known as the block subsidy 1. This subsidy is the sole mechanism for creating new supply.

However, this issuance rate is not constant. The Bitcoin source code dictates that the block subsidy is cut in half every 210,000 blocks, an event known as the halving 1. Because blocks are added to the blockchain approximately every 10 minutes, a halving occurs roughly every four years 1.

When the network launched in 2009, the initial block subsidy was 50 BTC 1. In 2012, it fell to 25 BTC; in 2016, to 12.5 BTC; and in 2020, to 6.25 BTC. This programmatic decay continues until the block subsidy can no longer be divided.

The Mathematics of the 21 Million Limit

The 21 million limit is not explicitly written as a single variable in the Bitcoin source code. Instead, it is the mathematical sum of a geometric series dictated by the halving mechanism 1.

In the C++ source code of the Bitcoin Core client, the block subsidy is calculated using a bitwise right-shift operator 1. Every 210,000 blocks, the code shifts the subsidy bits to the right, which divides the reward by two and rounds down to the nearest integer 1.

Bitcoin is divisible down to eight decimal places 1. The smallest unit of Bitcoin is called a satoshi, where one satoshi equals 0.00000001 BTC 1. Therefore, the block subsidy cannot be halved indefinitely. Eventually, the reward will be reduced to a single satoshi, and the next halving will shift that single bit to the right, reducing the subsidy to zero.

To see how this math works, we can calculate the total supply by summing the rewards across all halving eras:

  • Era 1 (Blocks 0 to 209,999): 50 BTC per block × 210,000 blocks = 10,500,000 BTC
  • Era 2 (Blocks 210,000 to 419,999): 25 BTC per block × 210,000 blocks = 5,250,000 BTC
  • Era 3 (Blocks 420,000 to 629,999): 12.5 BTC per block × 210,000 blocks = 2,625,000 BTC
  • Era 4 (Blocks 630,000 to 839,999): 6.25 BTC per block × 210,000 blocks = 1,312,500 BTC

If you carry this geometric progression through 33 halving cycles, the subsidy eventually drops from one satoshi (0.00000001 BTC) to zero. Due to this rounding mechanism inherent to computer arithmetic, the precise theoretical maximum supply of BTC is exactly 20,999,999.97690000 BTC, or 2,099,999,997,690,000 satoshis 1.

The Reality of Lost Coins

While the theoretical maximum supply is just under 21 million, the actual circulating supply that can ever be spent is significantly lower. This is because Bitcoin can be permanently lost 1.

To spend Bitcoin, a user must possess the corresponding private key, a cryptographic password that authorizes transactions 1. If a user loses their private key, forgets their seed phrase, or dies without passing on access instructions, the coins associated with those addresses become permanently inaccessible 1. They remain visible on the public ledger, but they can never be moved or spent.

Additionally, some coins are lost due to protocol quirks or deliberate actions:

  • The Genesis Block: The first 50 BTC created in Block 0 was coded in a way that prevents it from being spent 1.
  • Unclaimed Rewards: Miners are not legally forced to claim the full block subsidy. On several occasions in the network's early history, miners accidentally or intentionally claimed fewer satoshis than they were entitled to, permanently reducing the circulating supply.
  • Burn Addresses: Users sometimes intentionally send coins to provably unspendable addresses (a process called burning) to remove them from circulation.

Because of these factors, millions of BTC are estimated to be lost forever, making the active circulating supply much scarcer than the 21 million limit suggests.

Mining the Last Bitcoin

Based on the 10-minute block target, the 33rd halving event is projected to occur in approximately the year 2140 1. At this point, the block subsidy will drop from one satoshi to zero, and no new BTC will ever be minted 1.

This transition raises a critical question: why would miners continue to spend electricity to secure the network if they no longer receive new coins?

The protocol addresses this through transaction fees 1. When users send transactions, they attach a small fee to incentivize miners to include their transaction in the next block 1. Currently, a miner's revenue consists of both the block subsidy and these transaction fees 1.

After the year 2140, miners will rely entirely on transaction fees to fund their operations 1. For the network to remain secure, the total volume of transaction fees must be high enough to incentivize miners to dedicate sufficient computational power (hash rate) to protect the blockchain from attacks 1. If fee revenue is too low, the hash rate could drop, potentially making the network more vulnerable to a 51% attack, where a malicious actor gains control of the majority of the mining power.

Common Misconceptions

Misconception 1: The 21 million limit can be easily changed

Because Bitcoin is software, some believe developers can simply change a line of code to increase the supply limit. While the code can be edited, actually deploying that change requires the consensus of the entire network 1. If developers or a group of miners tried to increase the limit, they would have to run a modified version of the software. This would result in a hard fork, splitting the network into two separate blockchains. The vast majority of users, node operators, and economic actors would likely remain on the original chain that preserves the 21 million limit, leaving the inflationary fork worthless.

Misconception 2: There is not enough Bitcoin for global adoption

A common concern is that 21 million coins are insufficient to serve as a global currency for billions of people. This overlooks Bitcoin's divisibility 1. Because each BTC can be divided into 100 million satoshis, the total supply actually consists of 2.1 quadrillion individual spendable units 1. If needed, future software upgrades could introduce even further divisibility without changing the underlying 21 million cap.

Misconception 3: Mining stops completely after 2140

Mining does not stop when the last BTC is minted. Miners will still be required to group transactions, validate blocks, and secure the history of the ledger 1. The only change is the composition of their compensation, which will transition from a mix of subsidy and fees to 100% transaction fees 1.

How This Connects to the Market

Bitcoin's absolute scarcity is the primary driver of its narrative as "digital gold" or a hedge against inflation. In traditional finance, central banks can expand the money supply through quantitative easing, which dilutes the purchasing power of existing currency. Bitcoin's programmatic supply curve offers an alternative where the issuance schedule is completely transparent and unalterable.

This predictable scarcity influences institutional treasury strategies. Firms accumulate holdings based on the premise that their share of the total network cannot be diluted by future issuance, a strategy observed in corporate treasury expansions 2. For more details on how the protocol enforces this scarcity through periodic reductions, see The Bitcoin Halving: How the Protocol Enforces Digital Scarcity.

As the block subsidy continues to decrease with each halving, the market will increasingly monitor the development of Bitcoin's fee market. The long-term security of the network depends on whether transaction demand can generate enough fee revenue to replace the block subsidy, a structural shift that will play out over the coming decades.

Questions this story raises

Why did Satoshi Nakamoto choose 21 million?
The creator of Bitcoin never explicitly detailed the choice of 21 million in the whitepaper. However, it aligns with the math of a 50 BTC block reward halving every 210,000 blocks. It also allowed the currency to scale cleanly across decimal places while remaining highly divisible.
What happens if miners reject the 21 million cap?
If miners attempt to change the cap, they must run modified software. This would create a hard fork. Unless the broader community of node operators, exchanges, and users also adopt this change, the miners' new chain would be isolated and likely lose all economic value.
Can Bitcoin be divided into smaller units than a satoshi?
Currently, the smallest unit on the base layer is one satoshi (0.00000001 BTC). However, off-chain scaling solutions like the Lightning Network already utilize millisatoshis (one-thousandth of a satoshi). If necessary, the base protocol could be updated via consensus to allow further divisibility.

References

  1. [1] Developer Documentation - Mining — Bitcoin Project
  2. [2] Bitcoin Core Source Code - Validation — Bitcoin Core Integration Authority
  3. [3] Bitcoin: A Peer-to-Peer Electronic Cash System — Bitcoin.org

Evergreen explainer written by Basis Desk's system and checked by an independent model pass for factual errors and advice language. Figures, fees and rules change — the references above are where to verify current specifics. Market figures marked "at the time of writing" come from live exchange data. Report an error: corrections@basisdesk.news · corrections policy.

Not financial advice. Basis Desk publishes information, not recommendations. Crypto assets are volatile and you can lose what you invest.