Post
Topic
Board Development & Technical Discussion
Merits 2 from 2 users
Re: How max money works?
by
starmyc
on 11/07/2018, 08:55:40 UTC
⭐ Merited by AdolfinWolf (1) ,ETFbitcoin (1)
MAX_MONEY is bitcoin's source code is not the limit of the number of coin you can mine in the chain. This is controlled by a set of other parameters & algorithm defined in the protocol (difficulty, rewards through time, etc). MAX_MONEY is used for some controls/checks (do a quick "grep -r MAX_MONEY src", you'll be able to see by yourself).

It is even written in source code (src/amount.h):

Code:
/** No amount larger than this (in satoshi) is valid.
 *
 * Note that this constant is *not* the total money supply, which in Bitcoin
 * currently happens to be less than 21,000,000 BTC for various reasons, but
 * rather a sanity check. As this sanity check is used by consensus-critical
 * validation code, the exact value of the MAX_MONEY constant is consensus
 * critical; in unusual circumstances like a(nother) overflow bug that allowed
 * for the creation of coins out of thin air modification could lead to a fork.
 * */
static const CAmount MAX_MONEY = 21000000 * COIN;

Most cheap altcoins developers would think that it is sufficient to change this number, but in fact, this is whole wrong. Controlling the whole supply of a Bitcoin fork protocol is not as easy as changing a simple number.