IntroductionWith a market capitalization ranking of 61
[1], the coin "42"
[2] is advertised as the "Highest Priced Crypto Coin Ever"
[3]. This high price is attributed to the coin's rarity, which is advertised to be limited to 42 total coins. Unfortunately, it looks like 42 coin and descendents thereof (like 8 coin) do not cap the money supply at the advertised number of coin. In fact, unlike most cryptocoins, the money supply of 42 appears to be unlimited.
Money GenerationIn bitcoin and most descendents the money supply is capped algorithmically in the function that calculates the mining subsidy. This function is called
GetBlockValue() in the source file "main.cpp". In the bitcoin code base, the source for this function is:
int64_t GetBlockValue(int nHeight, int64_t nFees)
{
int64_t nSubsidy = 50 * COIN;
// Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
nSubsidy >>= (nHeight / Params().SubsidyHalvingInterval());
return nSubsidy + nFees;
}
Here, the subsidy is halved for each "halving interval", measured in blocks (although the calculation is obfuscated somewhat for the sake of computational efficiency). It can be proven
[4] that if all halving intervals are the same length (210,000), then the maximum amount of bitcoin ever produced will be
21,000,000 = 2 * 50 * 210,000
42 (and probably several descendants, such as
uses a
GetBlockValue() function like the following, taken from the 42 code base:
int64 static GetBlockValue(int nHeight, int64 nFees)
{
int64 nSubsidy = 0.000042 * COIN;
if(nHeight < 419)
{
nSubsidy = 0.0000001 * COIN;
}
if(nHeight == 1)
{
nSubsidy = 0.42 * COIN;
}
if(nHeight == 420) // yay its 420 :) Time for a smoke
{
nSubsidy = 0.00042 * COIN;
}
if(nHeight == 4242)
{
nSubsidy = 0.00042 * COIN;
}
if(nHeight == 42424)
{
nSubsidy = 0.00042 * COIN;
}
if(nHeight == 424242)
{
nSubsidy = 0.00042 * COIN;
}
if(nHeight == 4242424)
{
nSubsidy = 0.00042 * COIN;
}
return nSubsidy + nFees;
}
Except in a few cases (blocks 1-420, 4242, 42424, ...) all blocks will have the same reward of 0.000042 coin (ignoring fees). Notice that the 42 version of
GetBlockValue() has no halving interval and makes no attempt to curtail coin generation at the advertised maximum of 42 coin. Without a geometrically decreasing reward value, the money supply will grow indefinitely.
For 42, the advertised coin maximum of 42 coin will be produced before block 1,000,000 (42 / 0.000042), or in about 1.33 years. But the existing 42 code makes no provision to stop coin production at that time.
MAX_MONEYOne part of the code for most cryptocoins that may be confusing to developers is the MAX_MONEY constant in the source file called "main.h". MAX_MONEY has two uses in the 42 code: (1) as a sentinel return value (which won't be discussed) and (2) to check some transaction values to ensure that they make sense. For the latter purpose, MAX_MONEY is used in the inline function called
MoneyRange() in the "main.h" file:
inline bool MoneyRange(int64 nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
This function simply checks to ensure that a value is not negative and does not exceed MAX_MONEY. Nowhere in the 42 codebase is MAX_MONEY checked against a sum of the balances of all accounts, which would require the computationally expensive task of either (1) calculating every account balance in the block chain and then adding them up, or (2) summing the coinbase (money generating) transactions over all blocks. The running total of money supply is not explicitly kept in the block chain.
The
MoneyRange() function is used a few times in the 42 code. An arbitrary example is checking the the sanity of a transaction, as in the
CTransaction::CheckTransaction() function within "main.cpp":
if (!MoneyRange(nValueOut))
return DoS(100, error("CTransaction::CheckTransaction() : txout total out of range"));
Nowhere in the code for 42 does is
MoneyRange() used to validate the total money supply of 42.
Notes:[1] http://coinmarketcap.com/[2] My screen name, tx42, is unrelated to 42 coin.
[3] http://www.42coin.org/[4] http://en.wikipedia.org/wiki/1/2_%2B_1/4_%2B_1/8_%2B_1/16_%2B_%E2%8B%AF