4

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?

1 Answer 1

4

You are looking for the method CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams) in validation.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;
}

The variables in this code snippet stand for:

  • nHeight is the number of blocks that have been found.
  • consensusParams.nSubsidyHalvingInterval is 210000 blocks, the duration of reward epochs and the interval between the halvings
  • COIN is 108, the number of satoshis in one bitcoin
  • nSubsidy finally gives the number of satoshis that may be generated per block
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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