freicoin / freicoin-old

Bitcoin integration/staging tree
http://www.bitcoin.org
MIT License
26 stars 8 forks source link

Switch CTxOut::nValue to decimal64 for practically infinite divisibility #70

Open maaku opened 11 years ago

maaku commented 11 years ago

IEEE-standard decimal64 occupies the same number of bytes as int64, and the maximum monetary base of Freicoin has already been adjusted to fit within the precision of the decimal64 type, allowing exact representation of all existing values. Internally, arithmetic would have to be done exactly using arbitrary-precision rational arithmetic and time-value adjustments truncated at 16 digits.

Multiple transaction outputs could be used if greater than 16 decimal digits of precision are required, otherwise the exact remainder would be added to the transaction fee (and if the miner chooses not to claim it, it's destroyed).

This would be a candidate for a BIP proposal and submission upstream to the Bitcoin Satoshi client.

Forked from the discussion surrounding GH #67.