2

As per Bitcoin documentation, new coins are generated and brought into circulation when miner receive the reward. I am not talking about existing coins that are collected at the time of mining.

Can somebody guide me, where exactly this generation of new coins takes place?

2

You are looking for the method CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams) in main.cpp.

CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
{
    int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
    // Force block reward to zero when right shift is undefined.
    if (halvings >= 64)
        return 0;

    CAmount nSubsidy = 50 * COIN;
    // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
    nSubsidy >>= halvings;
    return nSubsidy;
}

Further explanation:
nHeight is the number of blocks that have been found.
consensusParams.nSubsidyHalvingInterval are 210000 blocks, the interval of the halvings
COIN is 10^8, the number of satoshi in one bitcoin
nSubsidy finally gives the number of satoshi that the coinbase may create

  • Hi, Thanks for the answer and explanation. Is this code also holds true for bitshares code ? Does new bitshares version support new coin generation ? I have old code of bitshares V 0.4.20, and I could not find above function in the code. Thanks and Regards – Vinay Chitale Dec 23 '15 at 13:37
  • You could look for GetBlockValue instead, it used to be named that. To be honest, I don't even know if Bitshares is based on Bitcoin or a separate development. – Murch Dec 23 '15 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.