Post
Topic
Board Announcements (Altcoins)
Re: Gascoin X11 | launched | No IPO | website: gascoin.info |
by
gjhiggins
on 14/02/2015, 22:33:09 UTC
Must be some error in code, i searched but couldn't find anything.



The stake reward appears to be 100000000 times too high.

https://github.com/gjhiggins/dreamcoin/blob/master/src/main.cpp#L1005 <- Dreamcoin
int64_t nSubsidy = nCoinAge * nRewardCoinYear / 365 / COIN;

vs:

https://github.com/gascrypto/Gascoin/blob/master/src/main.cpp#L1020 <- Gascoin
int64_t nSubsidy = nCoinAge * nRewardCoinYear / 365;

(Gascoin shares its code with Dreamcoin)

Dreamcoin
Code:
// miner's coin stake reward based on coin age spent (coin-days)
int64_t GetProofOfStakeReward(int64_t nCoinAge, int64_t nFees)
{
    int64_t nRewardCoinYear;
    nRewardCoinYear = MAX_MINT_PROOF_OF_STAKE;
    int64_t nSubsidy = nCoinAge * nRewardCoinYear / 365 / COIN;
    if (fDebug && GetBoolArg("-printcreation"))
        printf("GetProofOfStakeReward(): create=%s nCoinAge=%"PRId64"\n",
                 FormatMoney(nSubsidy).c_str(), nCoinAge);
    return nSubsidy + nFees;
}

Gascoin
Code:
// miner's coin stake reward based on coin age spent (coin-days)
int64_t GetProofOfStakeReward(int64_t nCoinAge, int64_t nFees)
{
    int64_t nRewardCoinYear;
    nRewardCoinYear = COIN_YEAR_REWARD;
   int64_t nSubsidy = nCoinAge * nRewardCoinYear / 365;
    if (fDebug && GetBoolArg("-printcreation"))
        printf("GetProofOfStakeReward(): create=%s nCoinAge=%"PRId64"\n",
                 FormatMoney(nSubsidy).c_str(), nCoinAge);
    return nSubsidy;
}

where:

static const int64_t MAX_MINT_PROOF_OF_STAKE = 0.15 * COIN;   // 15% annual interest <- Dreamcoin
and
static const int64_t COIN_YEAR_REWARD = 20 * CENT; // 20% annual interest <- Gascoin

respectively.

For convenience here's the arithmetic, expressed in Python with an arbitrary value of 30 for nCoinAge:

Code:
>>> 30 * (0.15 * 100000000) / 365 / 100000000 # Dreamcoin 15%
0.012328767123287671
>>> 30 * (20 * 1000000) / 365 # Gascoin 20%
1643835.6164383562
>>> 30 * (0.20 * 100000000) / 365 / 100000000 # Dreamcoin if it were 20%
0.016438356164383564
>>> 1643835.6164383562 / 0.016438356164383564 # The difference as a ratio
99999999.99999999

Seems to explain the symptoms. Anyone concur?

Cheers

Graham