Why Bitcoin's Block Subsidy Hits Zero: Halvings and Right Shifts
This article was translated from Japanese with AI. Read the original (日本語) · Report a translation issue
Bitcoin's supply cap is roughly 21 million BTC, and it is well known that, thanks to halvings roughly every four years, the amount of newly issued bitcoin (the coinbase reward) eventually drops to zero.
But if the coinbase reward is halved, that is, divided by 2, roughly every four years, you might wonder why it ever reaches zero. With the numbers we use every day, you can keep dividing by 2 forever and never reach exactly zero; you just keep getting smaller and smaller decimals.
You could simply say "Bitcoin rounds down anything below the decimal point," but that raises more questions about how halvings work: How exactly is it rounded down? How is the reward halved in the first place? And why is it cut to one half rather than, say, two thirds?
Halvings are a key part of what makes Bitcoin a store of value, so understanding how they work should help you approach the next halving with confidence.
This article explains why Bitcoin's final reward is zero, how halvings work, and, related to both, why the total supply of bitcoin will not actually come out to exactly 21 million.
Why Bitcoin's Final Reward Is Zero

As the chart above shows, Bitcoin's coinbase reward is cut in half with each halving. It starts at 50 BTC (5,000,000,000 sats) and reaches 0 sats at the 33rd halving.
It may be a little hard to spot, but you can see that rounding down happens at the halving that follows any period in which the reward is an odd number.
Bitcoin is designed with no unit smaller than a sat, which means it cannot represent fractions. So at the 33rd halving, the reward becomes 0 rather than 0.5, half of 1.
Next, let's look at how Bitcoin's halving actually works, based on Bitcoin's code.
How Bitcoin Issuance and Halvings Work
A notable feature of Bitcoin's halving is that it uses a right shift (>>=).
Below is the actual halving code. Many readers probably know about Bitcoin's halvings but have never actually seen the code.
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;
}
Here is essentially what it does:
- halvings holds the number of halvings so far, one for every 210,000 blocks
- 5,000,000,000 sats (Subsidy = the coinbase reward) is right-shifted as many times as the value of halvings
That is all it takes to process the halving, in a very simple form.
You might be wondering where the reward actually gets cut in half. It's the right shift (>>=) that halves the value.
return 0;
Once halvings reaches 64 or more, the reward is 0. The reward is stored as a 64-bit integer, and shifting it further to the right would be undefined behavior, so for safety the code simply returns 0.
The 64th halving is expected around the year 2264, so this is very far in the future.
What a Right Shift Does: Halving and Rounding Down
A right shift moves the bits one position to the right, which is easiest to understand in binary (numbers written with 0s and 1s).
For example, let's right-shift 21 (10101 in binary) repeatedly.
| Number of right shifts | Binary | Decimal |
|---|---|---|
| 0 | 10101 | 21 |
| 1 | 01010 | 10 |
| 2 | 00101 | 5 |
| 3 | 00010 | 2 |
| 4 | 00001 | 1 |
| 5 | 00000 | 0 |
Looking at the binary column, you can see that with each additional right shift, the digits move one place to the right and a 0 is added at the far left. If the rightmost digit is a 1, the right shift drops it, which rounds the value down.
In the decimal system we use every day, dividing by 10 moves the digits one place; in binary, dividing by 2 moves them one place.
Bitcoin's Simplicity, as Seen in the Halving Code
I'm not much of a programmer, but even so, when I first saw Bitcoin's halving code, I was struck by how simple it looks.
On top of that, nSubsidy, which represents the reward amount, appears to be a 64-bit integer, so no floating-point numbers are involved.
If the code used decimals, computers could introduce tiny numerical discrepancies known as rounding errors, which can cause bugs.
The reason the reward is cut to one half rather than, say, two thirds is probably that halving is simple and easy to verify as an economic design. It may also be partly because dividing by 2 is easy in the world of programming (binary).
Beyond the reward itself, another important question is how halvings affect Bitcoin's security. The relationship between halvings, hashrate and security is covered in the following article.
Why There Won't Be Exactly 21 Million Bitcoin
Here's a related bit of trivia about halvings and right shifts: the total supply of bitcoin is not actually exactly 21 million BTC. The final amount comes to 20,999,999.9769 BTC (2,099,999,997,690,000 sats).
It looks like an odd number, but it comes from the rounding down caused by right shifts.
If you calculate the difference from 21 million BTC in sats, you get 2,310,000 sats.
2,100,000,000,000,000 - 2,099,999,997,690,000 = 2,310,000(sats)
Next, let's write Bitcoin's 50 BTC coinbase reward in sats, in binary.
100101010000001011111001000000000
It's hard to read as a string of 0s and 1s, but if you count the 1s, you'll find there are 11 of them.
Now let's divide the difference from 21 million BTC that we found earlier (2,310,000) by 11.
2,310,000(sats) ÷ 11 = 210,000
Sharp readers will recognize the number 210,000 right away. It's the length of a halving cycle: 210,000 blocks.
The binary representation of 50 BTC contains eleven 1s. A right shift loses 1 sat whenever the lowest bit is 1, so rounding down happens 11 times in total.
In other words, there are 11 periods (of 210,000 blocks each) in which 1 sat is rounded down (lost), which creates the 2,310,000-sat difference from 21 million BTC.
If you're ever asked for Bitcoin's exact total supply, you can derive it fairly easily from the 210,000-block halving cycle and the number of 1s in the binary representation of 50 BTC.
Conclusion: Questioning the Obvious Leads to Discoveries
This article explained why Bitcoin's final reward is zero, how halvings work in practice, and, related to both, why the supply doesn't come out to exactly 21 million BTC.
It's widely known that Bitcoin has halvings and that the reward eventually reaches zero. But there are few chances to learn what actually happens under the hood, so I hope this article helps you understand it.
I also showed how remarkably simple Bitcoin's halving code is, and shared the trivia about the difference between 21 million BTC and the actual final supply.
If there's one thing I personally still wonder about, it's why the initial coinbase reward was set at 50 BTC, a number that is awkward in binary.
Satoshi Nakamoto never said anything about it, so the reason is unclear, but I suspect it may have been chosen because it's easy for humans to grasp.
Even things that are taken for granted in Bitcoin can lead to interesting discoveries when you take a fresh look at them. I encourage you to explore Bitcoin for yourself.
