yup, possible. i kinda wanna redo a website though... webdev time.
fun fact, bunsoni was wrong. there is no max coin amount for supercoin,
i just noticed it now that i look at it because of that previous post
MAX_MONEY has nothing to do with the max amount of coins. lol. its just the max you can send in 1 tx and because of that is used to invalidate a block in a few other scenarios
just to humor everyone, ill post why.
if we compare bitcoin to supercoin.
BITCOIN:
in bitcoin you have this function to determine how many coins a block produces:
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;
}
which can be found at line 1360 in main.cpp at time of posting.
the line for int halvings is nHeight / nSubsidyHavlingInterval; if this number is over 64 then the blocks subsidy is 0 meaning 0 coins will be added to the current coin amount and only fees from txs will be reput into blocks.
the value of nSubsidyHalvingInterval can be found in line 73 of chainparams.cpp to be 210000;
all in all this means if the height of the chain is greater than (64 * 210000) then a block will never add more coins to the network it will only recycle fees.
SUPERCOIN:
Now lets compare this to supercoins code. we are currently in PoS so the function to determine the next blocks value is as follows
static const int YEARLY_POS_BLOCK_COUNT = 1576800;
int64_t GetProofOfStakeReward(int64_t nCoinAge, const CBlockIndex* pindex)
{
int64_t nRewardCoinYear = MAX_PROOF_OF_STAKE_STABLE;
int nPoSHeight = GetPosHeight(pindex);
int nPoWHeight = pindex->nHeight - nPoSHeight;
int64_t nSubsidy = 0;
if(nPoSHeight < YEARLY_POS_BLOCK_COUNT)
{
nSubsidy = 100 * nRewardCoinYear * nCoinAge / 365;
uint256 hash = pindex->GetBlockHash();
std::string cseed_str = hash.ToString().substr(13,7);
const char* cseed = cseed_str.c_str();
long seed = hex2long(cseed);
int random = GenerateMTRandom(seed, 10000000);
int64_t delta = nCoinAge;
if(nPoWHeight < 19200)
{
delta = delta * 19200 / nPoWHeight;
}
if(delta > 3000000)
delta = 3000000;
int lowerLimit = 5000000 - delta;
int upperLimit = 5000000 + delta;
if(lowerLimit < 0)
lowerLimit = 0;
if(upperLimit > 10000000)
upperLimit = 10000000;
// printf(">> random = %d, lowerLimit = %d, upperLimit = %d, nPoWHeight = %d\n",
// random, lowerLimit, upperLimit, nPoWHeight);
if(random >= lowerLimit && random <= upperLimit)
{
printf(">> Got Super-PoS-Block...yay!\n");
nSubsidy += 1024 * COIN;
}
}
else if(nPoSHeight < 2 * YEARLY_POS_BLOCK_COUNT)
{
nSubsidy = 50 * nRewardCoinYear * nCoinAge / 365;
}
else
{
nSubsidy = nRewardCoinYear * nCoinAge / 365;
}
PDV = nSubsidy;
return nSubsidy;
}
which can be found at line 1122 in main.cpp of supercoins code. as you can see the last else statement is this
if the block is not less than 2 * YEARLY_POS_BLOCK_COUNT
then each block mints this nRewardCoinYear * nCoinAge / 365;
at no point does it stop minting, meaning at no point does Supercoin hit a max coin count.
i have a feeling at some point someone is gunna call me stupid and ask why arent all coins breaking then, and at which point i will say. they will over time. a good solid example of this is 42 coin which was advertised as having a max of 42 coins and the MAX_MONEY was 42, but they never fixed the minting of the coins. which is why right now there are currently 66 of the 42coins. and 66 > 42, duh. the coin is now broken since the person who cloned it didnt actually care and never fixed/updated the code.