When will the last Bitcoin be mined?

12 replies 511 views
SwiftForkFull Member
Posts: 57 · Reputation: 471
#1Mar 26, 2019, 06:34 AM
Hey everyone, I'm new here and just wanted to kick off my first post. I was told to look into Bitcoin to make better contributions, so here I am, but now I'm a bit lost. 1. I get that there's a max supply of BTC capped at 21 million. 2. As of 2021, around 18 million BTC are already out there. 3. They say the last Bitcoin will probably be mined in about 120 years. Now I'm scratching my head over this. What kind of math supports the idea that since BTC started in 2009 with that 21 million limit, and given that it’s been 12 years since then with 18 million mined, it’s gonna take another 120 years to dig up the remaining 2 million+? I could really use some clarity on this.
6 Reply Quote Share
Posts: 18 · Reputation: 229
#2Mar 26, 2019, 08:43 AM
the math is the block reward in combination with block reward halving. at the start from first block the reward was 50 bitcoins. then after exactly 210,000 blocks that was automatically cut by half to 25 then after another 210,000 blocks to 12.5 and again to 6.25. this "halving" will continue 210,000 blocks without exception until it reaches 0 and that is how the supply cap is enforced to be no more than 21 million.
2 Reply Quote Share
paul2017Senior Member
Posts: 218 · Reputation: 1426
#3Mar 27, 2019, 05:59 AM
This explains it: https://en.bitcoin.it/wiki/Controlled_supply TL;DR: Every 210000 blocks, the amount of bitcoins created in a block (the "subsidy") is halved untill it eventually reaches 0. At that point, there will be slightly less than 21 million bitcoins and no more will be created.
6 Reply Quote Share
paul.stakeHero Member
Posts: 651 · Reputation: 3798
#4Mar 27, 2019, 10:22 AM
It's called a zeno's paradox. Every 210,000 blocks (approximately 4 years), the block reward will give half of what was giving in the previous 210,000 blocks. The first 210,000 blocks “extracted” 10,500,000 bitcoins, the next 210,000 gave 5,250,000 bitcoins and it goes and on. The 34th halving will cut the reward from 0.00000001 to 0.00000000 and thus, no other bitcoins. Precisely, there will be 20,999,999.97690000 BTC.
2 Reply Quote Share
Posts: 1 · Reputation: 109
#5Mar 27, 2019, 12:25 PM
Exactly right. SO because the halving occurs every 4 years with the mining becoming harder and harder the system was created such that the total supply of BTC only increases at a certain rate for 4 years and then drops thus controlling the supply. Because the supply is set and it is harder and harder to get more BTC the value should grow in the same linear pattern. This is why it is advised to take advantage of bear markets to stock up until the next bull run where we know BTC would set another record.
4 Reply Quote Share
pixel2014Hero Member
Posts: 857 · Reputation: 4132
#6Mar 27, 2019, 06:03 PM
If you need a well detailed explanation about this, you can read a topic created by fillippone: Equivalent Network Time As the mining reward is reducing after halving, it will take more time to mine certain amount of Bitcoin. https://bitcointalk.org/index.php?topic=5331087.msg56800049#msg56800049
5 Reply Quote Share
SwiftForkFull Member
Posts: 57 · Reputation: 471
#7Mar 27, 2019, 11:42 PM
Thanks @Darkdays @BrewMaster @BlackHatCoiner @odolvlobo and @Charles-Tim. I am grateful. I am beginning to understand the concept. @Charles-Tim the table you share is cool and easy to understand.  But from serial number 26 at the year 2108 downward, there is zero BTC left to mine, yet there is still BTC supply till 2136, what really happened?
2 Reply Quote Share
paul2017Senior Member
Posts: 218 · Reputation: 1426
#8Mar 28, 2019, 05:07 AM
The "Left To Mine" and the second "Mined BTC" columns are omitting fractions of a bitcoin. The "Reward" column is in satoshis.
3 Reply Quote Share
RogueDegenFull Member
Posts: 74 · Reputation: 309
#9Mar 28, 2019, 09:56 AM
While that will be the total that will have been created, that will not be the total that will exist. This is because some have been permanently removed from the blockchain. Furthermore, there are some that can be proven to be permanently unspendable, so while they may still "exist" it is certain that they are no longer useful. Charles-Tim forgot to expand the width on those columns, so the value you see is rounded to the nearest full bitcoin.  Those actual amounts will be fractions of a bitcoin. See here (each "Reward Era" is approximately 4 years)
0 Reply Quote Share
SwiftForkFull Member
Posts: 57 · Reputation: 471
#10Mar 28, 2019, 12:04 PM
Thanks once again @DannyHamilton and @odolvlobo it's clearer now.
2 Reply Quote Share
its_ninjaSenior Member
Posts: 269 · Reputation: 1259
#11Mar 28, 2019, 06:06 PM
The actual code is (which is what matters): So at the 64th halving or approx 64x4 years (256 years) the base reward is set to zero. Alas with currently only 8 places (50 BTC = 5000000000 satoshi) it will, however, reach zero earlier, since hits less than 1 satoshi when halvings is 33 which represents row 34 in the table further above, since that the second row is the first halving. However, if core decides to extend the places to 16 at some time before that, then the 58th halving (59th row) will be zero.
4 Reply Quote Share
RogueDegenFull Member
Posts: 74 · Reputation: 309
#12Mar 28, 2019, 06:42 PM
The "actual code" is only useful to those that can actually read code (in which case they could have looked it up themselves).  If they are asking "What mathematical analysis proves that BTC created by 2009 with a fixed supply of 21million", there's a pretty good chance that they want a description of what's happening and not a copy of the code. While you recognized that CAmount is a 64 bit integer, you overlooked the fact that: Therefore, nSubsidy = 50 * COIN = 5,000,000,000 5,000,000,000 in binary is 00000000 00000000 00000000 00000001 00101010 00000101 11110010 00000000 You may notice that the first 31 digits are zero? Therefore, at the 64 - 31 = 33rd halving or approximately 33 x 4 years = 132 years the base reward is set to zero. We are already 12.5 years in, so about 119.5 more years. You do address this later, but at that time you appear to forget that nSubsidy is an integer and seem to imply that it is a decimal value of some sort. It doesn't hit "less than 1 satoshi".  It hits 0.  Exactly 0.  No more, no less. Places?  Satoshis are integers. There are no places.  Rather significant changes would need to be made to the consensus code to use values smaller than a satoshi for on-chain transactions.  I'm not certain that it could be accomplished without a hard fork.
2 Reply Quote Share
its_ninjaSenior Member
Posts: 269 · Reputation: 1259
#13Mar 28, 2019, 07:44 PM
Of course, it's a bit shift I tried to post a simple php loop to display it, but cloudflare blocked me when I tried to add it onto my post ... That's how it's described in the Bitcoin FAQ, so that it's easy for anyone to understand. It's not a "how to implement that in code" comment by me. https://en.bitcoin.it/wiki/Help:FAQ#How_long_will_it_take_to_generate_all_the_coins.3F If you want an example code implementation, read the FAQ https://en.bitcoin.it/wiki/Help:FAQ#But_if_no_more_coins_are_generated.2C_what_happens_when_Bitcoins_are_lost.3F_Won.27t_that_be_a_problem.3F
4 Reply Quote Share

Related topics