There are not going to be 21 million BTC

Keir Finlow-Bates
3 min readJan 8, 2025

There are not going to be 21 million BTC.

I confess, that was a social media “hook” to get you to read on. But it is true.

Background

Every ten minutes or so, a Bitcoin block is mined by a Bitcoin miner (this is a classic Poisson process, by the way, if you like probability and statistics). And the miner gets something called a block subsidy for finding the block, as a prize. This serves two functions:

  • To incentivize people to mine bitcoin.
  • To “print money” in a predictable, fair, and decentralized manner. Well, fair in the way that a lottery is fair. Rich people can buy more lottery tickets if they want to.

The algorithm in the Bitcoin code calculates the block subsidy using a base unit that we now call the satoshi, and there are 100,000,000 satoshis in a bitcoin. A bitcoin is a made-up unit that isn’t found anywhere in Bitcoin node code. The original Bitcoin wallet in the software showed your assets in (satoshis / 100,000,000) and called them bitcoin.

We’ve stuck with that, for now.

The block subsidy (which is the part that mints bitcoin, or rather, satoshis) plus the transaction fees form something called the block reward.

It’s quite a clever money printing system, with the idea being that there is a finite time in the future when all the bitcoin will be minted, the supply stays fixed from that point on, and hopefully by then the transaction fees will be more than enough to encourage miners to continue securing the system. But that’s another story.

Back to why the supply will not reach 21 million bitcoin…

Bitwise right shift

The subsidy calculation in the code uses a “bitwise right shift” operator, which is the equivalent of “divide by two and round down”.

Every 210,000 blocks, which takes about four years, the subsidy is not halved. It is divided by two and rounded down — that’s what bitwise right shift does. Furthermore, it is much easier to implement than some kind of floating point arithmetic and standard division. In base level computer code, a bitwise shift is a single computational operation. Keeping track of floating point arithmetic and division takes a large(ish) software library.

For the first nine halvings this “divide and round down” has no effect, because the block rewards are even.

But the tenth halving is applied to a block subsidy of 9765625 satoshis. This means that the tenth halving will lose half a satoshi per block, by giving 4882812 satoshis per block instead of 4882812.5, which it would if it was a halving algorithm in floating point.

That’s a loss of 210,000 * 0.5 = 105,000 satoshis.

What’s going to happen?

Whenever a block subsidy is an odd number, a similar rounding down happens. The odd satoshi block subsidies being divided occur at halvings 10, 13, 14, 15, 16, 17, 19, 28, and 33. Each of those results in 105,000 satoshis less being minted than would be if a division by two was used instead of a bitwise right shift.

At the 33 halving, the block subsidy drops from 1 satoshi to 0, and that means the end of bitcoin minting, which should happen in about (2009 + (4*32) — 1) = the year 2136.

But is this discrepancy really significant?

No. It’s the kind of thing mathematicians and obsessive compulsive programmers get excited or wound up about.

2099999997690000 satoshis instead of 2100000000000000 is not a big difference.

It’s 2,310,000 satoshis less than the quoted 21 million, which is 0.0231 bitcoin. At today’s prices the value is about 2,200 USD. And let’s face it, thousands more bitcoin have been lost through accident and error than that small amount.

But it’s still fun to know, isn’t it?

--

--

Keir Finlow-Bates
Keir Finlow-Bates

Written by Keir Finlow-Bates

I walk through the woods talking about blockchain

Responses (10)