So I stumbled upon a response from hugeblack yesterday where he included a pic of the Bitcoin halving formula as part of a discussion. The formula caught my eye, and I got curious about how the calculations work for Bitcoin halving that happens roughly every four years. Interestingly, this formula also helps to determine the total supply of Bitcoin.
The image I’m sharing below is pretty similar to what hugeblack posted. Let me break down the essential parts of the formula before I dive deeper.
The number 2 is the factor by which the rewards decrease with each halving. The 10^8 represents the smallest Bitcoin unit, which is called a Satoshi, like 0.0000012. The 210K refers to the blocks that need to be mined before the halving kicks in, and 50 is the initial reward amount. The variable i under the sigma symbol stands for each halving instance, starting from 0 and going up to 32, for a total of 33 halvings.
My goal is to find the total Bitcoin supply, but to do that, I’ll need to calculate it 33 times. For instance, for my first calculation, I’ll set i to 1, which means about 10,500,000 Bitcoins will be mined in the first halving year. For my next trial, with i as 2, I’ll get around 5,249,999.998 Bitcoins mined in the second halving year. I’ll keep going like this until my final calculation, where i is 32, which will give me 2.444721758×10^-3.
Time to work through all 33 calculations!
Playing around with Bitcoin halving math
12 replies 132 views
Yes, it is slightly different from the one hugeblack shared:
In the end you arrive at the same result cause the 108 variable which appears twice cancels itself out. But using the first formula you can easily solve for the total supply. You also do not have to replace i with 1,2,3 and on, solving for each halving period, that invalidates the formula. Using it exactly as it is will give results for the entire 32 halvings we would have.
- Jay -
You did the calculations wrongly. For example, 5,250,000 BTC were generated in the second period. I don't know how you got the 5249999.998 BTC.
The total number of bitcoins will be finally 20999999.9769
With doing do, the result would be 21,000,000 and that's not accurate. That's because we can't have more than 8 decimal places for each bitcoin.
21,000,000 is an integer and does not contain any decimal place. Like I said earlier, 21K is an estimated value.
I was referring to your paper where x=2 and I thought you meant the second period by x=2.
I don't understand what's the use of calculating the sum from x=2 to x=32.
Yes, 21,000,000 doesn't have any decimal point and I know that.
I was referring to the block rewards. For example, after the 10th halving, 0.048828125 BTC should be generated in each block and that will be rounded down to 0.04882812 BTC.
Visit this for accurate numbers:
https://en.bitcoin.it/wiki/Controlled_supply
I was a little bit crazy about it . I actually stated it that "it's unhealthy to take such a long step", but i actually enjoyed it .
That wikipage claims
But this is what global gold production actually looks like:
Over bitcoin's lifetime, Gold's emission much more resembles a fixed rate than an exponentially decreasing one.
You missed one important factor: altcoins. Each serious altcoin in the crypto world is just another abuse of 21 million coins limit. If you take the whole crypto market, and you find a point in time, where Bitcoin have for example 50% domination, then you can assume, that in practice, we have 42 million coins, but just half of them are handled off-chain.
And no, it is not like comparing gold with silver or cuprum, because you can copy-paste a lot of coins from one chain into another, and really "turn gold into lead" and vice versa. And it is more than just Escrow transactions, described by Satoshi. If you have opcodes like OP_CHECKSIGFROMSTACK, then you can handle signatures from other chains in a trustless way, and only one chain needs that feature, to successfully handle it on both sides.
ledger_chadMember
Posts: 20 · Reputation: 216
#9Nov 29, 2021, 06:53 PM
The sum to infinity is correct (though the Bitcoin Core code actually limits it to 64 epochs for practical reasons). However, the amount of each subsidy is truncated because it is an integer, and the amount goes to 0 after the 33rd epoch. That is why the actual maximum supply is slightly less than 21 million BTC.
50 * 108 is important because of the truncation. The final division by 108 converts from satoshis to BTC.
BTW, in practical terms there are 33 halvings. The last sets the subsidy to 0.
Really glad I got the sum to infinity right. I think my calculator performed the truncation directly when I solved for the entire 33 halving directly, but the decimals were revealed when I took my time to calculate for each value for every halving year.
ledger_chadMember
Posts: 20 · Reputation: 216
#11Nov 29, 2021, 08:48 PM
It is likely that the values were not exact because your calculator does not have sufficient precision to represent the values exactly.
It could simply be a rounding error introduced by imprecise floating point arithmetic on the hardware.
OP calculated the sum of series 210,000*50/(2^x) from x=2 to x=32 and got 5249999.998 for that. That's correct with three decimal places precision. I just calculated that with python and got 5249999.997555278.
First I thought that by x=2 OP meant the second halving period.
Related topics
- Daily Bitcoin Buying and Selling Numbers How to Track Them? 7
- Bitcoin vs Gold: Which Will Double First? 19
- Banks considering Bitcoin as reserve assets 19
- Is Bitcoin the Ultimate Choice? 19
- Texas is the first state in the US to purchase Bitcoin 19
- US wants resources like oil and is making strategic moves 19