I wonder how much thought Satoshi gave this and what his main reason was. I think it was kind of a fairness thing. Whatever it was I think this decision more than most involved his guessing about how (time line etc) Bitcoin would be adopted.
Satoshi's choice of integer representation is obvious enough, but I think that the choice of right shift for the subsidy was deliberate too. It is exact and unambiguous right down to the final unit.
Thanks for pointing this out. It may not be obvious to those with no experience in binary numbers.
In fact, I haven't even thought about it that way.
Is there any links available to how that code was "hashed" out among the developers?
It would sure be interesting to see what their discussions were when they finalized it.
There choice definitely makes for a very small piece of slick code to handle block rewards.
A right shift in the binary representation of the number 50 every 210000 blocks. Presto!
That tells me their decision was based almost entirely on getting it coded quick and keeping it simple - there were bigger fish to fry at the time.
And it was just an experiment... I don't think they really envisioned it would be where it is today. Kudos to them for their achievements.
Bitcoin uses a scaled integer representation. The subsidy is 5,000,000,000 satoshis, or 1001010100000010111110010000000000 in binary. We scale that by 100,000,000 when we show things to the user, and we call 100 million units to be 1 bitcoin.
Pay attention that this is
not similar to fixed point.
The pre-scaled value (5 billion) is what gets shifted, not the post-scaled value (50.00000000). In 33 years, the 9th shift will result in the subsidy being cut by slightly more than half for the first time. (Or is it the 10th shift in 37 years? Bah. Not going to count the zeros again.)
Every binary machine will always get this subsidy calculation right, because right-shift-without-carry is one of the simplest operations in the binary world. Every other scheme will have to figure out how to deal with inexact operations and rounding one way or another.
This BIP does call for more complex code (but not impossible) for the rewards to be handled as proposed. I've tried to stay away from the details of code implementation in the BIP because it just opens another can of worms for everyone to argue over which seems pointless until it reaches mass consensus.
However, since you bring it up... do you have an idea how hard it would be for the average developer to come up with an implementation like this? Just curious.
My opinion, is it would only take a few days, but could get take longer if there's a difference of opinion between developers (i.e. BIP16 vs. BIP 17).
Well, it can't be implemented at all, as written. To implement it, someone would have to answer the questions that I asked back in
post 38. If you don't care
how the rounding gets handled, then yeah, I should think a couple of days should suffice, if even that long.
Actually, shit. I just realized something. If the subsidy drops by 0.000031746 % on every block, before long, you are going to need to calculate something like .999999968254^200000, which is going to be painful. But, I guess we could cheat by embedding the current subsidy in the block or something, so that each node only has to calculate the next subsidy.