Hi all,
I'm trying to make sure I properly understand the block reward structure for BBR, so please correct me if I'm wrong. The formula is easy enough to find:
uint64_t base_reward = (EMISSION_SUPPLY - already_generated_coins) >> EMISSION_CURVE_CHARACTER;
But then when I dig deeper, what we're really saying is the reward is:
uint64_t base_reward = ((2^64 -1) * 0.99) - already_generated_coins) >> 20;
Okay, fine... but WTF value is used for already_generated_coins? I can look around online and see that currently there are around 657,687 BBR at the time of writing, but obviously we're not just using that number in the formula. There has to be a multiplier...
EMISSION_SUPPLY ~= 18262276632972456099 >> 20 ~= 17416264183971
That looks like the proper base coin reward for block 0, but with 12 digits that should be to the right of the decimal point. So if I take the current number of "real" coins (as a user would think about them), multiply by a trillion (1,000,000,000,000), subtract that from 18262276632972456099, divide by 2^20 (shift right 20 bits), and finally divide by 1 trillion, I get the base block reward?
Or to simplify, I can use 18262277 as the maximum number of coins and forget about the multiplying by 1 trillion. Thus the base reward is approximately:
(18262277 - [Current BBR Supply]) / 1048576 = [Reward]
The reward will scale slightly for larger blocks (above the median size), but that should only be the case on blocks with multiple transactions, so as a baseline estimate the above formula would be sufficient, right? So when I plug in 657,855 as the current supply, I end up with 16.789 as the reward, which is reasonably close the the actual current block reward of 16.793937 BBR. I'm not quite sure why I appear to be off by 0.004 BBR, though; if anyone wants to fix that small error and tell me why, that would be great. :-)
Sorry for late response.
Your calculation seems to be correct. Note that block reward for each block is truncated to remove dust:
base_reward = base_reward - base_reward%DEFAULT_DUST_THRESHOLD
Also, 1% of emission is reserved for team bounty, it paid in each 720s(once a day) block according to votes(1% of day reward is a maximum).
Feel free to ask if you have questions.