Did you know, nowhere in the actual bitcoin codebase is the number 21 million. It’s a number that is arrived at, rather than one that is specifically declared. Understanding how that 21,000,000 number supply cap is reached is actually imperative to increasing your own confidence that the number won’t and cannot change. In a recent clip of Jamie Dimon, (CEO of JP Morgan Chase), he is quoted asking “How do you know it [supply] will stop at 21 million?” [ source ] . A typical bitcoiner response would be to scoff and not waste breath on the answer. But in this letter, I’ll explain exactly how that 21 million number is reached and how we have any confidence at all around that number being trusted.
The Subsidy Equation
The notation you see below is a Reimann Sum. It is a mathematical equation that describes the bitcoin supply. When resolved, the below equation equals 21,000,000.
Total Number of Halvings: Starting from the top left hand corner, the first thing that you will notice is that there will only ever be 32 halvings. The first one occurred in 2012, the second in 2016, and the third in 2020. Halvings can be thought of like eras or epochs. After each halving, the inflation rate of bitcoin is half of what it was during the previous halving.
Number of Blocks in Each Halving: There are 210,000 blocks in each epoch. With each block taking approximately 10 minutes to be mined, each epoch is about 4 years long.
Number of New Bitcoin Mined Each Block: Starting at 50 bitcoin per block in 2009, the number of bitcoin rewarded to the miner of each block decreases by half with every passing halving.
so on and so forth …
32 halvings later, and approximately, 128 years into the future from 2009 (approx. 2140), the last satoshis will be mined and added to the circulating supply, bringing the grand total of bitcoin to 21,000,000.
This is what the above equation looks like when worked out in a spreadsheet.
Starting in 2009, there were 0 bitcoin in circulation. Then block by block, bitcoin were added to the circulating supply. In the first 4 years, 50% of all bitcoin were mined. Zooming to the bottom of this chart, we actually approach, but never really reach 21,000,000 coins. The fact of the matter is, we will have near 21 million, but never really get there. It’s just much simpler for us to say that there will be 21,000,000 coins, rather than 20,999,999.99 ₿.
Bitcoin has an exponentially reducing inflation rate.
On this graph, we are approximately at the point where the red dot is plotted on the graph. More than 90% of all bitcoin have been mined thusfar.
The Subsidy in Code
The following is a screenshot of the codified subsidy equation. The following function is used every single time a block is published.
This is the piece of code that controls the amount of bitcoin that is released into circulation after every block. Curiously enough, if you look on line 1505, it says there are 64 halvings, rather than the 32 that I thought there was. I decided to ask the question on Twitter.
Interpreting the Math
So how should all of this math within bitcoin be interpreted? Here are a few questions that usually arise after learning about this 21,000,000 hard cap.
Can’t anyone change the code?
Will miners collude and change the number when their block rewards get too low?
Will bitcoin even be in use after 120 years?
Will quantum computing mined the rest of the blocks once it’s invented?
These are actually all good questions. The answers have less to do with computational mathematics, and more to do with game theory. We know how some of these scenarios will play out, but not others. Let’s work through them one by one.
Can Anyone Change the Code?
The answer is yes. Anyone can change Bitcoin’s code, but no one can convince all the node runners to change the code running on their node. So just because the codebase gets an update, doesn’t mean that update will make it onto the actual machines running bitcoin. We saw exactly this scenario play out on August 1st, 2017 during the block wars [ book recommendation ]. Some folks wanted to change the size of the bitcoin blocks, but at the end of the day, the users and the market decided that the version of bitcoin with bigger blocks (bitcoin cash), was not the real bitcoin.
The first public instance of someone changing the bitcoin code is actually Litecoin. In 2011, Charlie Lee changed the bitcoin codebase, making blocks happen every 2.5 minutes instead of 10, and making the total supply of bitcoin 84,000,000 instead of 21,000,000. This change to the bitcoin codebase didn’t change bitcoin. It created a whole different coin. This reveals to us that bitcoin is not what one or even a group of people say it is, but what the entire network and market agree on it to be.
Will Miners Collude?
We don’t know whether or not miners will get together and collude in the future. But we can speculate as to why they may or may not collude. The first thing to point out is that while miners provide security, node runners (with little to no financial incentive) run bitcoin as well. So if miners collude, we still have a massive number of bitcoin node runners that enforce the version of bitcoin with 21,000,000 coins.
Miners do not actually have much of an incentive to collude. Miners seeking to expand the supply of bitcoin in order to increase their block rewards is tantamount to destroying the very value proposition that bitcoin is built on. The value of their block rewards would go down for the same reason that the value of fiat money goes down overtime. Bitcoin would become inflation. Bitcoin is supposed to be a form of money with a static supply that cannot be changed. An official and agreed-upon change in that supply (would never happen in a widespread way, but) would destroy bitcoin entirely, wrecking whatever financial incentive miners might have to expand the supply in the first place.
Will bitcoin even be in use after 120 years?
Again, this question is difficult to answer as it involves future predictions. I like to think it will be, as I am planning my retirement and inheritance strategy around bitcoin being the global reserve currency. I know that bitcoin is built to last hundreds of years, but at the rate that technology is advancing, it is difficult to tell whether or not bitcoin will be still be around, in a similar form, for decades, let alone centuries. Therefore, it is difficult to comment on how mining and block rewards might play out a hundred years from now.
Will quantum computing mined the rest of the blocks once it’s invented?
I love this question because there is basically no one on the planet that is qualified to answer it. I don’t think we really know the types of things that quantum computers will be able to do. Then, when we do have a quantum computer, will it be strong enough to mine blocks quickly? There is a particular function in bitcoin called the “difficulty adjustment” which makes blocks more difficult to mine based on how quickly the previous blocks were mined. So even if a quantum computer were to mine a batch of blocks quickly, it would be limited to just one batch of blocks. Then the difficulty of the network would increase dramatically, and the quantum computer wouldn’t be able to solve them as quickly as it once could. There were a lot of assumptions made in this answer ;P
Thanks for reading, leave me your questions and comments and I’ll be happy to reply!