Proof of Stake Reward Formula

Please somebody can explain me what are these numbers 33 and 8 are used for?

// ppcoin: miner's coin stake is rewarded based on coin age spent (coin-days)
int64 GetProofOfStakeReward(int64 nCoinAge)
{
    static int64 nRewardCoinYear = CENT;  // creation amount per coin-year
    int64 nSubsidy = nCoinAge * 33 / (365 * 33 + 8) * nRewardCoinYear;
    if (fDebug && GetBoolArg("-printcreation"))
        printf("GetProofOfStakeReward(): create=%s nCoinAge=%"PRI64d"\n", FormatMoney(nSubsidy).c_str(), nCoinAge);
    return nSubsidy;
}

Also, is this executed as (nCoinAge * 33 / (365 * 33 + 8)) * nRewardCoinYear or as nCoinAge * 33 / ((365 * 33 + 8) * nRewardCoinYear) ?

doesn’t it have to do with that you need to wait 30 days (33?) before you start accumulating coinage?
no idea actually, I wonder why it is spelled like (365 * 33 + 8 ) and not like 12053

would like to know too now :slight_smile:

When reading the code (365 * 33 + 8 ) is more meaningful than just putting 12053. Ideally you would have wanted to use a constant variable with a descriptive name instead.

As far as I can tell, you will get one full yearly reward every 373 days. I can’t figure out what the 33 and 8 are for either, just looking at it.

Edit: I did the math wrong. It is approximately every 365.25, which is probably to account for leap years as singlethread indicated.

It is probably just an approximation of the average number of days per year.
( 365 * 33 + 8 ) / 33 = 365.242424
The actual average number of days per year is 365.2425

Also, is this executed as ... ?

If you are a programmer, shame on you; you should either know this stuff or know where to look it up. If you are not a programmer you are excused :wink:
Answer:

((nCoinAge * 33) / ((365 * 33) + 8)) * nRewardCoinYear

In other words, the reward is rounded down to a whole number of cents.

I have posted a thread regarding the topic in Chinese:
http://8btc.com/thread-1926-1-1.html

I withdrew 968.05 PPC to my own wallet on 4th May, 2013 from BTCE.

While I keep my ppc client running for PoS minting, I got the PoS block with reward of 5.56 PPC on 30th Nov.

Based on the example, I think the formula for PoS reward is quite simple and adherent to the protocol.
Days variance between 2013.05.04 and 2013.11.30 is 210.

PoS reward formula:210d/365d968.051%=5.56

968,05+5.56=973.61 were in Stake balance and locked for 520 blocks.