Solves #91. Removes Decimal as a dependency, fixes tests, and uses scale of 1/10,000,000 for Elixir/Ion. UTXO amounts are only stored as ions.
Due to the shift from decimal to ions, we lose some precision when calculating block rewards, since we now have precision to 7 decimal places with ions, whereas Decimal was able to have a much higher precision. This isn't a big issue (tradeoff is that ions can be represented with fewer bits), but it does mean that our way of calculating block rewards was skewed, meaning that the total supply of elixir tokens was shifted down to 999999999.8686 rather than 1 billion. To keep the amount of total tokens as close to 1 billion as possible, I shifted the emission algorithm a bit:
Where x is total token supply, t is block at full emission, i is block index,
and s is the sigma of the total_token_supply, the Smooth emission algorithm
is as follows: Round(((x 10,000,000) max{0, t - i}) / s) (+1 if i % 172 = 0)
This brings us much closer to 1 billion total token supply, with a total of 1,000,000,000.0000028
Wallet, node, and miner need to be updated accordingly.
Solves #91. Removes Decimal as a dependency, fixes tests, and uses scale of 1/10,000,000 for Elixir/Ion. UTXO amounts are only stored as ions.
Due to the shift from decimal to ions, we lose some precision when calculating block rewards, since we now have precision to 7 decimal places with ions, whereas Decimal was able to have a much higher precision. This isn't a big issue (tradeoff is that ions can be represented with fewer bits), but it does mean that our way of calculating block rewards was skewed, meaning that the total supply of elixir tokens was shifted down to 999999999.8686 rather than 1 billion. To keep the amount of total tokens as close to 1 billion as possible, I shifted the emission algorithm a bit:
This brings us much closer to 1 billion total token supply, with a total of
1,000,000,000.0000028
Wallet, node, and miner need to be updated accordingly.