Author

Topic: When to Mine the last Bitcoin. (Read 223 times)

legendary
Activity: 4634
Merit: 1851
Linux since 1997 RedHat 4
June 09, 2021, 07:07:14 PM
#13
...
While you recognized that CAmount is a 64 bit integer, you overlooked the fact that:
Code:
typedef int64_t CAmount;

static const CAmount COIN = 100000000;
Of course, it's a bit shift Tongue
I tried to post a simple php loop to display it, but cloudflare blocked me when I tried to add it onto my post ...

However, if core decides to extend the places to 16 at some time before that, then the 58th halving (59th row) will be zero.

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.
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
legendary
Activity: 3514
Merit: 4895
June 09, 2021, 03:14:27 PM
#12
The actual code is (which is what matters):

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.

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;
}
So at the 64th halving or approx 64x4 years (256 years) the base reward is set to zero.

While you recognized that CAmount is a 64 bit integer, you overlooked the fact that:
Code:
typedef int64_t CAmount;

static const CAmount COIN = 100000000;

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.

Code:
nSubsidy >>= halvings;
hits less than 1 satoshi when halvings is 33

It doesn't hit "less than 1 satoshi".  It hits 0.  Exactly 0.  No more, no less.

However, if core decides to extend the places to 16 at some time before that, then the 58th halving (59th row) will be zero.

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.
legendary
Activity: 4634
Merit: 1851
Linux since 1997 RedHat 4
June 08, 2021, 08:11:03 PM
#11
The actual code is (which is what matters):
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;
}
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
Code:
nSubsidy >>= halvings;
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.
legendary
Activity: 1316
Merit: 1089
Goodnight, o_e_l_e_o 🌹
June 08, 2021, 02:35:23 PM
#10
Thanks once again @DannyHamilton and @odolvlobo it's clearer now.
legendary
Activity: 3514
Merit: 4895
June 07, 2021, 08:23:33 AM
#9
Precisely, there will be 20,999,999.97690000 BTC.

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 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?

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)


legendary
Activity: 4522
Merit: 3426
June 07, 2021, 07:18:08 AM
#8

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?

The "Left To Mine" and the second "Mined BTC" columns are omitting fractions of a bitcoin. The "Reward" column is in satoshis.
legendary
Activity: 1316
Merit: 1089
Goodnight, o_e_l_e_o 🌹
June 07, 2021, 04:59:17 AM
#7

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?
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
June 07, 2021, 02:03:12 AM
#6
Now my confusion.
What mathematical analysis proves that BTC created by 2009 with a fixed supply of 21million. From 2009 to 2021 is about 12years, then about 18million has already been mined.
Now, the remaining which is about 2million+ will take about 120years to be mined?
I need clarification please.
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://bitcointalksearch.org/topic/m.56800049
legendary
Activity: 2030
Merit: 1189
June 06, 2021, 01:15:52 PM
#5
What mathematical analysis proves that BTC created by 2009 with a fixed supply of 21million.
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.
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.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
June 06, 2021, 11:54:45 AM
#4
What mathematical analysis proves that BTC created by 2009 with a fixed supply of 21million.
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.
legendary
Activity: 4522
Merit: 3426
June 06, 2021, 11:44:19 AM
#3
What mathematical analysis proves that BTC created by 2009 with a fixed supply of 21million. From 2009 to 2021 is about 12years, then about 18million has already been mined.
Now, the remaining which is about 2million+ will take about 120years to be mined?

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.
legendary
Activity: 2128
Merit: 1293
There is trouble abrewing
June 06, 2021, 11:37:12 AM
#2
What mathematical analysis proves that BTC created by 2009 with a fixed supply of 21million.

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.
legendary
Activity: 1316
Merit: 1089
Goodnight, o_e_l_e_o 🌹
June 06, 2021, 11:33:31 AM
#1
As a newbie, on my first post I was advised to research about Bitcoin in order to make some quality posts.
I made some efforts and I am now confused, that is why I created this topic.

1. I understood that there is a limited supply of BTC at 21million minable.
2. As at 2021 that about 18million BTC has already been mined.
3. And it is estimated that the last BTC would be mined at about 120yrs from now.

Now my confusion.
What mathematical analysis proves that BTC created by 2009 with a fixed supply of 21million. From 2009 to 2021 is about 12years, then about 18million has already been mined.
Now, the remaining which is about 2million+ will take about 120years to be mined?
I need clarification please.
Jump to: