casperBGD (OP)
Legendary
Offline
Activity: 2156
Merit: 1151
Nil Satis Nisi Optimum
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 01, 2021, 07:07:28 AM |
|
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?
|
|
|
|
Charles-Tim
Legendary
Offline
Activity: 1652
Merit: 5089
Leading Crypto Sports Betting & Casino Platform
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 01, 2021, 07:25:11 AM |
|
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.
|
..Stake.com.. | | | ▄████████████████████████████████████▄ ██ ▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄ ██ ▄████▄ ██ ▀▀▀▀▀▀▀▀▀▀ ██████████ ▀▀▀▀▀▀▀▀▀▀ ██ ██████ ██ ██████████ ██ ██ ██████████ ██ ▀██▀ ██ ██ ██ ██████ ██ ██ ██ ██ ██ ██ ██████ ██ █████ ███ ██████ ██ ████▄ ██ ██ █████ ███ ████ ████ █████ ███ ████████ ██ ████ ████ ██████████ ████ ████ ████▀ ██ ██████████ ▄▄▄▄▄▄▄▄▄▄ ██████████ ██ ██ ▀▀▀▀▀▀▀▀▀▀ ██ ▀█████████▀ ▄████████████▄ ▀█████████▀ ▄▄▄▄▄▄▄▄▄▄▄▄███ ██ ██ ███▄▄▄▄▄▄▄▄▄▄▄▄ ██████████████████████████████████████████ | | | | | | ▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄ █ ▄▀▄ █▀▀█▀▄▄ █ █▀█ █ ▐ ▐▌ █ ▄██▄ █ ▌ █ █ ▄██████▄ █ ▌ ▐▌ █ ██████████ █ ▐ █ █ ▐██████████▌ █ ▐ ▐▌ █ ▀▀██████▀▀ █ ▌ █ █ ▄▄▄██▄▄▄ █ ▌▐▌ █ █▐ █ █ █▐▐▌ █ █▐█ ▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀█ | | | | | | ▄▄█████████▄▄ ▄██▀▀▀▀█████▀▀▀▀██▄ ▄█▀ ▐█▌ ▀█▄ ██ ▐█▌ ██ ████▄ ▄█████▄ ▄████ ████████▄███████████▄████████ ███▀ █████████████ ▀███ ██ ███████████ ██ ▀█▄ █████████ ▄█▀ ▀█▄ ▄██▀▀▀▀▀▀▀██▄ ▄▄▄█▀ ▀███████ ███████▀ ▀█████▄ ▄█████▀ ▀▀▀███▄▄▄███▀▀▀ | | | ..PLAY NOW.. |
|
|
|
casperBGD (OP)
Legendary
Offline
Activity: 2156
Merit: 1151
Nil Satis Nisi Optimum
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 01, 2021, 08:35:13 AM |
|
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
|
|
|
|
mocacinno
Legendary
Offline
Activity: 3500
Merit: 5086
https://merel.mobi => buy facemasks with BTC/LTC
|
source: https://github.com/bitcoin/bitcoin/blob/8071ec179d75cefd41dac2a9a248eaf38054b85d/src/validation.cpp#L1185CAmount 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
|
|
|
|
pooya87
Legendary
Offline
Activity: 3556
Merit: 10811
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 01, 2021, 08:52:14 AM |
|
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.
|
|
|
|
casperBGD (OP)
Legendary
Offline
Activity: 2156
Merit: 1151
Nil Satis Nisi Optimum
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 01, 2021, 09:17:21 AM |
|
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
|
|
|
|
mocacinno
Legendary
Offline
Activity: 3500
Merit: 5086
https://merel.mobi => buy facemasks with BTC/LTC
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 01, 2021, 09:30:55 AM |
|
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.
|
|
|
|
RapTarX
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 01, 2021, 02:02:43 PM |
|
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?
|
|
|
|
bitmover
Legendary
Offline
Activity: 2408
Merit: 6190
Crypto Swap Exchange🈺
|
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: ![](https://ip.bitcointalk.org/?u=https%3A%2F%2Fstatic.mundoeducacao.uol.com.br%2Fmundoeducacao%2Fconteudo%2FUntitled-2%2859%29.jpg&t=665&c=H_jXNB-3sqSEYw) No matter how big X is, there will always be some "dust". This is expression chart: https://www.mathsisfun.com/calculus/limits-infinity.htmlthe 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. ![](https://ip.bitcointalk.org/?u=https%3A%2F%2Fcointimes.com.br%2Fwp-content%2Fuploads%2F2019%2F01%2Fbashco-bitcoin-inflation-728x551.png&t=665&c=DTocaBEDY7MGag) 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
|
|
|
|
DannyHamilton
Legendary
Offline
Activity: 3472
Merit: 4790
|
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.
|
|
|
|
buwaytress
Legendary
Offline
Activity: 2912
Merit: 3602
Join the world-leading crypto sportsbook NOW!
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 01, 2021, 03:14:36 PM |
|
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.
|
|
|
|
BlackHatCoiner
Legendary
Offline
Activity: 1624
Merit: 8002
Bitcoin is a royal fork
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 01, 2021, 03:15:46 PM |
|
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).
|
|
|
|
tranthidung
Legendary
Offline
Activity: 2380
Merit: 4191
Farewell o_e_l_e_o
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 01, 2021, 04:03:25 PM Last edit: July 01, 2021, 04:15:41 PM by tranthidung |
|
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 BTCFrom 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](https://bitcointalk.org/Smileys/default/grin.gif) (20999999.9769-20999999.9748)/(6930000-6720000)
Lots of zero for block rewards within that 4-years period ~ 0.00000001 BTC per block.
|
|
|
|
kxwhalexk
Member
![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 98
Merit: 173
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 02, 2021, 08:51:10 AM |
|
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.
|
|
|
|
Leviathan.007
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 03, 2021, 09:26:10 AM |
|
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.
|
..Stake.com.. | | | ▄████████████████████████████████████▄ ██ ▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄ ██ ▄████▄ ██ ▀▀▀▀▀▀▀▀▀▀ ██████████ ▀▀▀▀▀▀▀▀▀▀ ██ ██████ ██ ██████████ ██ ██ ██████████ ██ ▀██▀ ██ ██ ██ ██████ ██ ██ ██ ██ ██ ██ ██████ ██ █████ ███ ██████ ██ ████▄ ██ ██ █████ ███ ████ ████ █████ ███ ████████ ██ ████ ████ ██████████ ████ ████ ████▀ ██ ██████████ ▄▄▄▄▄▄▄▄▄▄ ██████████ ██ ██ ▀▀▀▀▀▀▀▀▀▀ ██ ▀█████████▀ ▄████████████▄ ▀█████████▀ ▄▄▄▄▄▄▄▄▄▄▄▄███ ██ ██ ███▄▄▄▄▄▄▄▄▄▄▄▄ ██████████████████████████████████████████ | | | | | | ▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄ █ ▄▀▄ █▀▀█▀▄▄ █ █▀█ █ ▐ ▐▌ █ ▄██▄ █ ▌ █ █ ▄██████▄ █ ▌ ▐▌ █ ██████████ █ ▐ █ █ ▐██████████▌ █ ▐ ▐▌ █ ▀▀██████▀▀ █ ▌ █ █ ▄▄▄██▄▄▄ █ ▌▐▌ █ █▐ █ █ █▐▐▌ █ █▐█ ▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀█ | | | | | | ▄▄█████████▄▄ ▄██▀▀▀▀█████▀▀▀▀██▄ ▄█▀ ▐█▌ ▀█▄ ██ ▐█▌ ██ ████▄ ▄█████▄ ▄████ ████████▄███████████▄████████ ███▀ █████████████ ▀███ ██ ███████████ ██ ▀█▄ █████████ ▄█▀ ▀█▄ ▄██▀▀▀▀▀▀▀██▄ ▄▄▄█▀ ▀███████ ███████▀ ▀█████▄ ▄█████▀ ▀▀▀███▄▄▄███▀▀▀ | | | ..PLAY NOW.. |
|
|
|
pooya87
Legendary
Offline
Activity: 3556
Merit: 10811
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 04, 2021, 06:17:23 AM Last edit: July 04, 2021, 06:29:14 AM by pooya87 |
|
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](https://bitcointalk.org/Smileys/default/tongue.gif) 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.
|
|
|
|
|