Firstly the Bitcoin total supply us not 21 million but is actually 20999999.9769
BTC which is then rounded up to the closest whole figure ehiu us 21 million.
Then to the reason for why ~21 million was chosen it was most likely just a random number which was the result of the aggregation of the coinbase rewards starting from 50
BTC and then gradually getting halved every 210,000 blocks until we get to zero.
Check out this thread for more information -
https://bitcointalksearch.org/topic/why-21-million-bitcoins-why-was-that-number-chosen-1090560Thanks for the share mate. I just went through the thread to which you referred us. It seems there are number of justification for the 21 million number and thus lot of theories behind it.
However, I see that every one is trying to add up and substract the numbers, years, time in minutes, and much more! I think math's is funny language for this very reason. There is one problem and you can have N-number of solutions for the same. It's but obvious that we will never be able to look at the correct answer.
The closest one seems that it's just random number with block reward process as described by @Upgrade00
Some of the quotes from earlier discussion: It gets as interesting as you keep on digging more.
Start with a block reward of a nice simple number of 50 BTC per block.
Then every 210000 block (approximately every 4 years if blocks are generated on average every 10 minutes), cut the block reward in half and throw away any decimals after the 8th decimal place.
So after 210000 blocks you will have generated 50 * 210000 = 10500000 BTC
Then after another 210000 blocks you will have generated another 25 * 210000 = 5250000 BTC for a total of 10500000 + 5250000 = 15750000 BTC
Then after another 210000 blocks you will have generated another 12.5 * 210000 = 2625000 BTC for a total of 10500000 + 5250000 + 2625000 = 18375000 BTC
4 years / 10 minutes ≈ 210 000
50 + 25 + 12.5 + 6.25 + ... = 100
210 000 * 100 = 21 million
A double precision floating point has 52 significant bits so is capable of describing every number between 0 - 4503599627370496 exactly.
Or converting that number of satoshi's in Bitcoins this gives
45,035,996. 27370496
So whilst he could have use 45 million my guess is that the maths of starting with 50BTC and halving came to ~21 million which is high enough to use the full range while giving some room for error such as someone doing
( coins in circulation + satoshi's stash ) / 2 and not worrying about overflow errors.