Every x blocks the mining reward is halved. Will the reward be halved forever such that we never quite reach 21 million bitcoins, or will we reach 21 million bitcoins at some point and will the reward cease to exist altogether?

Extra points for pointing to the relevant code!

up vote 91 down vote accepted

People say the total will be 21000000 BTC.

... however:

  • The 1st 210000 blocks each allow creating 50 BTC.
  • The 2nd 210000 blocks each allow creating 25 BTC.
  • The 3rd 210000 blocks each allow creating 12.5 BTC.
  • ...

  • The 10th 210000 blocks each allow creating 0.09765625 BTC.

  • The 11th 210000 blocks each allow creating 0.04882812 BTC, and not 0.048828125 BTC, because only 8 decimals of precision are supported.

  • ...

  • The 33rd 210000 blocks each allow creating 0.00000001 BTC.

After that, the reward is 0.

If you sum all these numbers together, you get 20999999.9769 BTC.

... however, either due to an oversight or intentionally, the coins created in the genesis block cannot be spent.

This leaves us with 20999949.9769 BTC.

... however, due to an early problem in Bitcoin, fixed by BIP30, it was possible to create a coinbase transaction identical to a previous coinbase. This caused the coins created by that older coinbase to be irreversibly "overwritten". This happened in block 91842 (overwriting the coinbase of block 91812) and 91880 (overwriting the coinbase of block 91722). Each time, 50 BTC was lost.

This leaves us with 20999849.9769 BTC.

... however, the protocol rules allow creating up to the amounts listed above. Due to various bugs and miners experimenting with code, some blocks claim less than allowed. Those coins can never be recovered.

  • Block 124724 tried to intentionally claim 0.00000001 BTC less than allowed, but accidentally also failed to claim the fees, losing 0.01000001 BTC.
  • Between block 162705 and block 169899, 193 blocks claimed less than allowed due to a bug, resulting in a total loss of 9.66184623 BTC.
  • Between block 180324 and block 249185, another 836 blocks claimed less than allowed, resulting in a total loss of 0.52584193 BTC.
  • Block 501726 had no transaction outputs (except a 0-value commitment), losing the entire 12.5 BTC subsidy.
  • Block 526591 didn't claim half of the block reward, losing 6.25 BTC.

This leaves us with 20999821.02921183 BTC.

... however, since recently there is a concept of provably unspendable coins. Coins can be sent to an "address" which provably burns them (using OP_RETURN). Bitcoin Core tracks these and removes them from its database, so they are easily accounted for. At least 3.71612692 BTC were burned this way.

This leaves us with 20999817.31308491 BTC (taking everything up to block 528333 into account)

... However, various wallets have been lost or stolen, transactions have been sent to the wrong address, people forgot they owned bitcoin. The totals of this may well be millions. People have tried to tally known losses up here.

This leaves us with: ??? BTC.

  • 1
    What were the bugs that caused the 9.66184623 and 0.52584193 bitcoins to be lost? – StephenM347 Aug 7 '15 at 0:42
  • 1
    Those were bugs in the (customized) software that the miners were running, so you'd have to ask the miners themselves. – Jannes Aug 7 '15 at 11:15
  • 2
    I thought that OP_RETURN gave the money back to the miners. – Arturo Torres Sánchez Aug 7 '15 at 13:06
  • 3
    Arturo: no. You can just create a transaction with a higher fee though, if you want to give money to miners. – Pieter Wuille Aug 7 '15 at 13:09
  • 2
    Arturo: to clarify, typically an OP_RETURN output would have value 0, so it won't burn anything. It still increases the transaction size, so it increases the necessary fee for relay and mining. – Pieter Wuille Aug 7 '15 at 19:23

Neither. The reward eventually ceases, but not at 21 million Bitcoins.

Here's the code (edited for clarity and brevity):

int halvings = nHeight / 210000;
CAmount nSubsidy = 50 * COIN; // COIN is one Bitcoin
// Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
return nSubsidy >> halvings;

(Source.)

Note that it cuts the reward in half using the bit-shift operator, which means that eventually it won't be able to reduce the block reward by exactly half. So how many Bitcoins does it end up making in total?

20,999,999.9769 BTC, or 2,310,000 satoshis short of 21 million. (If you want to be a lot of fun at parties, bring this up whenever someone says that the maximum number of Bitcoins is 21 million.)

Then there are the various Bitcoins that aren't spendable due to various quirks of the Bitcoin protocol, like the genesis block coinbase, or the duplicated coinbase. [Edit: Or the many other instances of unspendable Bitcoins that Pieter mentions in his answer.]

  • 2
    Upvoting, as my own answer does not actually link to the code! – Pieter Wuille Aug 7 '15 at 0:26
  • 3
    Note that the right-shift operator's behavior isn't defined for shifts of 64 or more bits. So block 13,440,000 will set 'halvings' to 64, and most compilers currently treat ">> 64" the same as ">> 0", so the reward goes back to 50 BTC per block after 64 halvings (in around 2272). Except that this bug was already fixed, hard-coding the reward to be 0 after 63 halvings. – Chris Moore Jul 8 '16 at 1:08
  • Yes, it was replaced by this in 2014. Here's the pull request. – MCCCS Sep 15 at 16:33

20997107.88801356 once you remove the 2709.42507135 BTC “burn addresses” i.e. the bitcoin addresses with almost assuredly no earthly known private keys and therefore unspent lost forever. There are ~400 burn addresses with a total balance of 2759.42507135 as of Dec 2017 (2709.42507135 excluding the genesis block). Last year the burn addresses balance grew by 8.97 BTC

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.