Post
Topic
Board Development & Technical Discussion
Re: Continuous & piecewise linear block reward function with 21M limit unchanged
by
TierNolan
on 12/03/2015, 19:51:00 UTC
Original sum of block rewards = 20,999,999.97690000 BTC
Proposed sum of block rewards = 21,000,033.29639948 BTC

So, a way to add 0.000159% inflation in a sneaky way Smiley ?

A soft fork could accomplish this by reducing the minting fee.  Miners don't have an incentive to support that though.

The effect would be to reduce the total number of coins.

The suggested function always gives a minting fee that is less than or equal to the current rule.  This makes things a soft fork.

Starting when it drops from 12.5 to 6.75, the minting fee drop becomes linear.

This has a deflationary effect and would increase the value of current bitcoin holdings, assuming no loss of security.

Code:
CAmount GetBlockValue(int nHeight, const CAmount& nFees)
{
    CAmount nSubsidy = 50 * COIN;
    int halvingInterval = Params().SubsidyHalvingInterval();
    int halvings = nHeight / halvingInterval;
    
    // Force block reward to zero when right shift is undefined.
    if (halvings >= 64)
        return nFees;

    if (halvings < 3)
    {
        // Use current rule for first 3 halvings (50, 25, 12.5)

        // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
        nSubsidy >>= halvings;
    }
    else
    {
        // Use new rule for mint (6.75 and after)
  
        int phase = nHeight % halvingInterval;

        // Subsidy is a continuous and piecewise linear function that halves every 210,000 blocks

        // The subsidy is always less than or equal to the old rule
        nSubsidy = (nSubsidy * (2 * halvingInterval - phase)) / (2 * halvingInterval);
        nSubsidy >>= halvings;
    }
    return nSubsidy + nFees;
}