Assumption is the mother of all fok ups.
My earlier posting was pretty good except for the following part:
"
So what we need to calculate now is the number of times this 21m number can be halved.
Which is log10(21m) / log10(2) = 24.323885992102934376117624838116
So that's roughly:
24.32 * 210k blocks = 5108016.0583416162189847012160044 blocks.
5.1m blocks will be mined and then the rewards should go to zero.
"
This is wrong.
It's not the supply that's being halved... it's the reward that's being halved:
50 * COIN
COIN is defined as 1 0000 0000 (without the space)
So the function starts with 50 0000 0000
It is then right shifted by:
BlockNumber / 210000
So the question is then at what block number will the reward go to zero or near zero ?
The answer is:
Step 1. Figure out how many times 50 0000 0000 can be shifted right. It turns out this is 33.
(Note... this is over the safety range of 0..31 for shift values... so any 32 bit software version of bitcoin might be unsafe).
Step 2. Calculate which block turns into zero reward or problem:
33 * 210000 = 6930000
Another little bit of interesting tid bit is:
5.000.000.000 is already over the 32 bit safety limit.
Another little bit of interesting information is, this table below is wrong...
https://en.bitcoin.it/wiki/Controlled_supply#Projected_Bitcoins_Long_TermThe reward will not be 1 but 0.
At least according to windows calculator !
It's very funny to see how hard it is to get it right... but I am trying to get it right this time ! =D
(I am also glad I can login again ! password reset working =D)
The correct shift value to still get an reward is 32...
Anyway block 6930000 should probably be the first block to have a reward of zero. Thus shift value 33 is reward = 0.
When will reward go to zero 4*210k so 4x33 = 132 years from genesis or so... maybe sooner or later... correct calculation would be taking the 10 minutes... too lazy now to do that... maybe later.
However point is: for 32 bit software it would already go undefined sooner... at 32: 32x4 = 128 years from genesis.
So let's step:
Step 3. Multiple by halving time (expressed in dividing block number by 210.000 which more or less equals 4 years):
ShiftValue * 210.000 = X
So see above.
Bit vague posting maybe... but I am not too sharp anymore... heat, sleep lol but it's pretty good anyway.
But strange maybe... but true: 210.000 and 4 years related to each other.
I will leave it at that for now... just to correct my posting a little bit.