2

I have question about the source code, under src/amount.h I see the max coin supply being 21.000.000 (million) under the variable called MAX_MONEY. I want to ask what other variables mean,

CAmount COIN

CAmount CENT

And I want to know how they're used. As an interest in forking coins, I am analyzing source code and I would like to see how these numbers affect the blockchain.

Here is the link.

https://github.com/bitcoin/bitcoin/blob/master/src/amount.h

1 Answer 1

4

I see the max coin supply being 21.000.000 (million) under the variable called MAX_MONEY.

MAX_MONEY is not what controls the maximum coin supply. It is just a variable for use elsewhere that estimates the coin supply. The actual coin supply is regulated by the halving interval and the starting generation amount.

CAmount COIN

CAmount CENT

The base unit in Bitcoin is actually a satoshi, which is 1/100000000th of a Bitcoin. So COIN and CENT are used as multiplier values to convert units in Bitcoin (for COIN) and bitcent (1/100th of a Bitcoin) (for CENT) to the actual value that would be found in transactions which is in satoshis.

2
  • when I am forking the coin, where do I set a max coin limit then? Also when i first launch i want to be able to sell ICOs, meaning i want small amount of coins for myself, which code does it? where do I set wallet addresses for myself (devs), I want to learn all these @AndrewChow Jan 26, 2018 at 7:26
  • To change the coin limit, you need to change the subsidy halving interval here: github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L77 and change the initial subsidy value here: github.com/bitcoin/bitcoin/blob/master/src/validation.cpp#L1138. As for the other things you want, they are not part of Bitcoin Core so there isn't anything you can change to add those. You will need to figure out how to add them yourself.
    – Andrew Chow
    Jan 26, 2018 at 15:43

Your Answer

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

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