Author

Topic: BTC reward per block - supply is not actually limited? (Read 302 times)

jr. member
Activity: 39
Merit: 2
Bitcoin is limited i.e only 21 million bitcoin are there and if bitcoin is limited so is the BTC reward.
legendary
Activity: 3472
Merit: 10611
However since bitcoin protocol does not actually divide by 2, the new subsidy is exactly 4882812.
Mathematically that is dividing by 2 and rounded down to get rid of the decimals.

Nitpicking Tongue
Since CAmount type is int64_t (signed) the >> operation is not a simple shift right (SHR) it is instead a right shift then a most significant bit flip (SAR). But since the initial amount (and all subsequent ones) is smaller than 0x7FFFFFFFFFFFFFFF (MSB is always 0) the result of SHR (logical shift right) and SAR (arithmetic shift right) are the same but your code is still taking both steps.
Code:
 1 >> 1 =  0
-1 >> 1 = -1
hero member
Activity: 1778
Merit: 722
Leading Crypto Sports Betting & Casino Platform
The total supply is limited and I guess that's not even possible to see exactly 21m bitcoins but less because the value is will be one satoshi less than 21m coins after n halvings. No matter for how long we wait, buy there will be never more than 21m bitcoins. Actually, that's what makes the supply limited and since we do have the increase of demand, bitcoin will be more popular between people and become so much rare. That's why some people say if you only own one single bitcoin you will be a millionaire in next years, that's all because of limited totally supply.   
member
Activity: 98
Merit: 173
There are similar problems in Beginners & Help BitCoin: is it really finite?

This post has a good explanation of the problem.

I want to share my views as a novice.

One block every ten minutes will be rewarded at the beginning of the packaged 50 bitcoins.

In fact, the time is calculated based on 210,000 blocks, each block is 10 minutes,

so it should be 210000*10/60/24=1458.333..days

The number of bitcoins you get in first 1458.33..days is 210,000*50=10500000

Since it is halved every 1458.33..days , you can use the following formula to calculate:10500000*(1+1/2+1/22+.....+1/2n)

Since it is halved every four years, you can use the following formula to calculate:10512000*(1+1/2+1/22+.....+1/2n)=21000000btc

(A key limiting factor is that the smallest unit of Bitcoin is 8 digits after the decimal point.So 1/2n must be greater than 0.00000001)

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I learned some extra knowledge in this reply, I hope this is useful to you

A key limiting factor is that the smallest unit of Bitcoin is 8 digits after the decimal point.So 1/2n must be greater than 0.00000001
This will first play a part when we hit block 2,100,000. At that point, the block reward will drop from 0.09765625 BTC to 0.04882812 BTC, meaning we will lose 0.5 sats from every block mined.

Because of these accumulated rounding errors, the total number of bitcoin which could ever be mined is actually 20,999,999.9769. There have also been a couple of occasions in which miners have failed to claim the entire block reward they were allocated, and so these bitcoin are also permanently lost and would need to be subtracted from the total supply. And of course the very first 50 bitcoin mined in the genesis block can't actually be spent, so you could subtract them from the total supply as well.

When did the miners fail to claim the reward?
One example is block 124,724, where the miner claimed a reward of 49.99999999 BTC instead of 50 BTC and also failed to claim the 0.01 BTC in fees, permanently destroying 0.01000001 BTC.

A more notable example is block 501,726, where the miner failed to claim the entire reward of 12.5 BTC.

Block 526,591 only claimed 6.25 BTC instead of the maximum 12.5 BTC permitted.

Block 162,705 failed to claim any of the fees in the block, only claiming the 50 BTC block reward, resulting in a loss of 0.0240192 BTC.

There are lots more examples of miners making similar mistakes.
legendary
Activity: 2310
Merit: 4085
Farewell o_e_l_e_o
it is better to say that reward-per-block will fall below 1 satoshi after 2140, what do you mean?
Theoretically, satoshi is the smallest unit of Bitcoin and I guess the block reward will be 1 satoshi minimally.
Total supply of Bitcoin is less than 21 M that is a rounded number.
Exactly it is capped at 20,999,999.9769 BTC

From 2136 to 2140, there will be 0.0021 BTC added to total supply. I am not kidding. It means current weekly payment rate of signature campaign will be about what miners will get within four years (2136 to 2140).  Grin

Code:
(20999999.9769-20999999.9748)/(6930000-6720000)
Lots of zero for block rewards within that 4-years period ~ 0.00000001 BTC per block.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Notice that 9765625 / 2 does NOT equal 4882812.  It equals 4882812.5.  However since bitcoin protocol does not actually divide by 2, the new subsidy is exactly 4882812.
^That @casperBGD. The Bitcoin protocol divides the rewarding satoshis, but since they're an integer, the amounts will be split to everything above 1 sat. Anything lower than that is essentially “burned”. That's why there won't be exactly 21,000,000.00000000 coins, but 20,999,999.97690000 (0.0231 BTC less).
legendary
Activity: 2968
Merit: 3684
Join the world-leading crypto sportsbook NOW!
Not new news, but yeah, I guess it's important enough to say for clarification, but practically speaking, it's not any less meaningful, as RapTarX says, and others prove, to say that it will never more than 21 million Bitcoin.

And that, effectively, is the limit of supply. I see nothing wrong with saying that. And it helps my tiny brain make sense of it, why not? What interests me more is stuff like if I might actually still be around when the reward could potentially be less than the fee from a single transaction.
legendary
Activity: 3472
Merit: 4801
it is not possible to reach zero with constant /2 on any value that is different from zero

This is a common misunderstanding.  For the average user that is not a programmer, the words "halving", "cut in half", "divide by 2", "reduced to half" are used to give them a simplified understanding of what they can expect.

However, that's not actually what happens in the code.  There is NO DIVISION.  The value of the subsidy is NOT divided in half.

Instead, the subsidy starts at an integer value of 5000000000  (100101010000001011111001000000000 in BINARY) and then the code performs right bit-shifts on the integer value.

Since computers use BINARY bits, this has the equivalent effect of: dividing by two AND truncating any remaining decimal value.

As you can see looking at the binary value above, for the first 9 "halvings" the right shift will eliminate a ZERO, meaning that the value can be evenly divided by 2 with no remainder or decimal portion.

That allows "halvings" down to subsidy with an integer value of 9765625 (also known as 0.09765625 BTC).  The next "halving" after that will drop a ONE from the binary value, resulting in a subsidy with an integer value of 4882812 (also known as 0.04882812 BTC)!

Notice that 9765625 / 2 does NOT equal 4882812.  It equals 4882812.5.  However since bitcoin protocol does not actually divide by 2, the new subsidy is exactly 4882812.
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
But, the code i posted is a catch-all code in case we decide to stop using satoshi as smallest unit, and decide to use even smaller units to count with (for example, because the exchange rate skyrockets to thousands of times what it is today, and 1 satoshi becomes far to valuable to count with when calculating how much value to transfer OR which fee to use).
Even if we decide start using a smallest unit that's millions of times smaller than 1 satoshi, no subsidy will be given after halving 64, even if the subsidy is a valid integer due to us starting using a much smaller baseunit.

Will the total supply ever be above 21 million?


Thinking mathematically, even thought there is a change in the code and miners receive sub satoshis per mined block, it will never reach 21.000.000.

For those who knows calculus, I always thought about this as a limit problem.

For example, for this simple expression:


No matter how big X is, there will always be some "dust".
This is expression chart:

https://www.mathsisfun.com/calculus/limits-infinity.html

the value will never reach zero, only in infinity. And as there isn't really an infinity, it tends towards 0.

The same about bitcoin total supply!

Bitcoin total supply tends towards 21.000.000, never really reaching it (it will be always missing one/few satoshis). Even if we add sub-satoshis, it will never reach 21.000.000.


No matter how much time pass, it will never cross 21.000.000, as you can see in that chart above.


I found some article which tries to explain this idea:
https://medium.com/swlh/cryptocurrency-supply-algorithms-and-the-equation-of-exchange-bb5be462f5ee
hero member
Activity: 1358
Merit: 851
Whatever the block reward is, whatever the times it take, the supply will never be above 21 million. This is the truth. Then why do you make the point more complex? Will the total supply ever be above 21 million?
legendary
Activity: 3584
Merit: 5243
https://merel.mobi => buy facemasks with BTC/LTC
Well, @pooya87's explanation is equally valid with the current protocol. It's indeed true that the variable is an integer, so the actual subsidy will be 0 long before halving 63.

But, the code i posted is a catch-all code in case we decide to stop using satoshi as smallest unit, and decide to use even smaller units to count with (for example, because the exchange rate skyrockets to thousands of times what it is today, and 1 satoshi becomes far to valuable to count with when calculating how much value to transfer OR which fee to use).
Even if we decide start using a smallest unit that's millions of times smaller than 1 satoshi, no subsidy will be given after halving 64, even if the subsidy is a valid integer due to us starting using a much smaller baseunit.
legendary
Activity: 2156
Merit: 1151
Nil Satis Nisi Optimum
it is a situation that reward-per-block will fall below 1 satoshi after 2140 (since it is not possible to reach zero with constant /2 on any value that is different from zero)

It's oversimplification and ignoring the fact last block with reward will happen on 2140. Check this page which shows more accurate formula and table about supply generation until 2140, https://en.bitcoin.it/wiki/Controlled_supply.

it is actually after halving 63, as per what @mocacinno explained, with the code and halving 63 is planned for 2272 (in 2140 is planned halving 34, although it will come some earlier time, since 4 year interval is obviously longer than halving, counting from first three)

~snip
Even if we decide to start using µsat (or smaller) in the future due to a price increase, the maximum amount of halvings after which a subsidy still exists is 63... unless we do a hard fork removing line 1187-1190


thanks for explanation
legendary
Activity: 3472
Merit: 10611
it is widely known that BTC has limited supply, but from a math/programming point-of-view, that is not entirely true, it is a situation that reward-per-block will fall below 1 satoshi after 2140 (since it is not possible to reach zero with constant /2 on any value that is different from zero)
Actually it is true with both math and programming language simply because the amount field is a 64-bit integer not a decimal type and when you divide it by two it eventually reaches zero. For example (int64)1 / 2 = 0 and not 0.5.

- around 2140 (in thirty halvings) will fall below 1 satoshi - to 0,58 satoshi and that is taken in "mass media" as last halving, that is something one can find on the media, but that is not completely true, BTC will keep halving afterwards, but rewards will be low enough to call it finite supply ("code rules")
This is wrong as I explained above.
legendary
Activity: 3584
Merit: 5243
https://merel.mobi => buy facemasks with BTC/LTC
source: https://github.com/bitcoin/bitcoin/blob/8071ec179d75cefd41dac2a9a248eaf38054b85d/src/validation.cpp#L1185

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;
}

basically consensusParams.nSubsidyHalvingInterval is hardcoded to be 210000 (source)
So, if the height, divided by 210000 is equal to, or bigger than 64, the block reward will be 0, even if it should have been a small fraction of a satoshi.

Even if we decide to start using µsat (or smaller) in the future due to a price increase, the maximum amount of halvings after which a subsidy still exists is 63... unless we do a hard fork removing line 1187-1190
legendary
Activity: 2156
Merit: 1151
Nil Satis Nisi Optimum
so, when you want to be completely transparent, it is better to say that reward-per-block will fall below 1 satoshi after 2140, what do you mean?
If the reward per block fall below 1 satoshi, is that what makes Bitcoin supply to be finite? No. Once the total supply is not more than 21 million BTC, it is still limited/finite, one of the reasons Bitcoin is deflationary.

it cannot reach 21 million either, it will always be lower than 21 million, do the math, but that is not what I am saying, there will always be new BTC supply, it will never stop, that is what I am saying

after 30 halvings - total supply will be 20.999.999,99002 BTC
after 34 halvings - total supply will be 20.999.999,99038 BTC - when reward per block reach 1,16 satoshi
after 40 halvings - total supply will be 20.999.999,99999 BTC
but it will never touch 21m
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
so, when you want to be completely transparent, it is better to say that reward-per-block will fall below 1 satoshi after 2140, what do you mean?
If the reward per block fall below 1 satoshi, is that what makes Bitcoin supply to be finite? No. Once the total supply is not more than 21 million BTC, it is still limited/finite, one of the reasons Bitcoin is deflationary.
legendary
Activity: 2156
Merit: 1151
Nil Satis Nisi Optimum
here is my post from Croatian board translation, regarding finite supply for BTC

it is a mathematical trivia, but I would like to here is there a different explanation from prominent forum members

it is widely known that BTC has limited supply, but from a math/programming point-of-view, that is not entirely true, it is a situation that reward-per-block will fall below 1 satoshi after 2140 (since it is not possible to reach zero with constant /2 on any value that is different from zero)

per calculation, reward shall be:
- 2020 - 2024 - 6,25 BTC per block
- around 2032 (in three halvings) will fall below 1 BTC - to 0,78125 BTC
- around 2072 (in thirteen halvings) will fall below 1 mBTC - to 0,7629395 mBTC
- around 2112 (in twenty-three halvings) will fall below 1 uBTC - to 0,7451 uBTC
- around 2136 (in twenty-nine halvings) will fall to around 1 satoshi - to 1,16 satoshi

- around 2140 (in thirty halvings) will fall below 1 satoshi - to 0,58 satoshi and that is taken in "mass media" as last halving, that is something one can find on the media, but that is not completely true, BTC will keep halving afterwards, but rewards will be low enough to call it finite supply ("code rules")

so, when you want to be completely transparent, it is better to say that reward-per-block will fall below 1 satoshi after 2140, what do you mean?
Jump to: