Files
CHIP-MilliSatoshi/readme.md
T

153 lines
8.1 KiB
Markdown
Raw Normal View History

2023-12-18 14:52:51 +01:00
# CHIP 2024-sub-satoshi: increase accuracy in transactions
2023-04-03 13:36:21 +02:00
Title: Sub-Satoshi storage of amounts
2023-12-18 14:52:51 +01:00
Type: protocol upgrade
2023-04-03 13:39:19 +02:00
Layer: All
2023-04-03 13:36:21 +02:00
Maintainer: Tom Zander
2023-12-18 14:52:51 +01:00
Status: Draft
Initial Publication Date: 2024-01-01
Latest Revision Date: 2023-12-18
Version: 0.0.2
2023-04-03 13:36:21 +02:00
<details>
<summary><strong>Table of Contents</strong></summary>
- [Summary](#summary)
- [Deployment](#deployment)
- [Motivation](#motivation)
- [Technical Specification](#technical-specification)
- [Prior Art & Alternatives](#prior-art-alternatives)
- [Implementations](#implementations)
- [Feedback & Reviews](#feedback--reviews)
2023-12-18 14:52:51 +01:00
- [Acknowledgements](#acknowledgements)
2023-04-03 13:36:21 +02:00
- [Changelog](#changelog)
- [Copyright](#copyright)
</details>
## Summary
2023-12-18 14:52:51 +01:00
This proposal is a small change in transactions in order to allow us to move from 8 zero's behind the BCH number to instead have at least 3 more.
2023-04-03 13:36:21 +02:00
## Deployment
2023-12-18 14:52:51 +01:00
This is a minor protocol upgrade in the form of a new transaction version where a small change is needed in all places that interprets transactions.
2023-04-03 13:36:21 +02:00
## Motivation
2023-12-18 14:52:51 +01:00
BitcoinCash follows the lessons from economics and this means that the total supply of coins ever created is limited. You probably heard the term, there will never be more then 21 million Bitcoin.
2023-04-03 13:36:21 +02:00
2023-12-18 14:52:51 +01:00
There are obviously a lot more people that are intended to use and own some Bitcoin and therefore there are 8 zero's behind the separator, each is called "a Satoshi". Leading to not 21 million but
two quadrillion one hundred trillion Satoshi. (21 e+14).
2023-04-03 13:36:21 +02:00
2023-12-18 14:52:51 +01:00
While this is a lot, with a population of 8 Billion people that leaves only 2625,00 for each person on average. The actual for a lot of people will be a lot less as the wealth is not evenly spread and this raises the question if this can work as a world currency.
2023-04-03 13:36:21 +02:00
2023-12-18 14:52:51 +01:00
The idea of sub-Satoshis has come up before, it is the simple concept that instead of a bread costing $4.00 it overnight changes to cost $4.00000. Which is actually exactly the same amount, but with extra precision.
2023-04-03 13:36:21 +02:00
2023-12-18 14:52:51 +01:00
The idea, as tested in economics and concepts like stock-splits, is that we simply multiply the amount of money stored in any users wallet. Or, maybe easier to understand. We add a couple of digits behind the separator. Instead of owning $100.00, you now own $100.0000. Which is, exactly the same amount. But with more zeros behind the separator. With more precision for sub-Satoshis.
2023-04-03 13:36:21 +02:00
2023-12-18 14:52:51 +01:00
The benefit is that as the value rises due to BitcoinCash absorbing more and more of the worlds economy, it becomes possible to start giving out sub-Satoshi prices for payments. We can also split the money over more people than before. Essentially it allows us to keep growing whereas otherwise the system may hit a glass ceiling where it simply can't on-board more people.
2023-04-03 13:36:21 +02:00
2023-12-18 14:52:51 +01:00
# Technical Specification
2023-04-03 13:36:21 +02:00
2023-12-18 14:52:51 +01:00
# Space for more digits
2023-04-03 13:36:21 +02:00
2023-12-18 14:52:51 +01:00
The 'amount' field in a transaction is capable of expansion. It it an 8-byte number and after 33 halving we'd get 20 999 999.976 900 00 BCH. This, in Satoshi, is the same but without that dot. In absolute storage this is 6 bytes. Hex: 0x0000BEFE6F6399A8
2023-04-03 13:36:21 +02:00
2023-12-18 14:52:51 +01:00
What that means is that if 100% of all block rewards since the beginning of time end up in 1 transaction-output, the number in that transaction-output will only need 6 bytes to record the amount. The actual space reserved is actually 8 bytes. So we have space for more digits. Lets find out how much space we have.
2023-04-03 13:36:21 +02:00
2023-12-18 14:52:51 +01:00
To find out, we repeatedly multiply this huge number by 10, stopping when the total amount no longer fits in 8 bytes, we get to the following outcome:
2023-04-03 13:36:21 +02:00
* An extra 3 digits behind the separator.
2023-12-18 14:52:51 +01:00
* The block reward doesn't stop after 33 halvings, but after 42.
* The extra block reward add a total of 0.02307 BCH to the entire supply.
2023-04-03 13:36:21 +02:00
The total amount is then 2099999999997060000, or in hexadecimal: 0x1d24b2dfac2523a0
2023-04-03 14:18:07 +02:00
<details>
<summary><strong>Supply Era's</strong></summary>
A [simple program](supply.cpp) can do the math. Below is the output:
2023-12-18 14:52:51 +01:00
Today's reward schedule:
2023-04-03 14:18:07 +02:00
| Era | Added in Era | Total supply |
| --- | ---| ---|
| 00| 1050000000000000 | 1050000000000000 |
| 01| 525000000000000 | 1575000000000000 |
| 02| 262500000000000 | 1837500000000000 |
| 03| 131250000000000 | 1968750000000000 |
| 04| 65625000000000 | 2034375000000000 |
| 05| 32812500000000 | 2067187500000000 |
| 06| 16406250000000 | 2083593750000000 |
| 07| 8203125000000 | 2091796875000000 |
| 08| 4101562500000 | 2095898437500000 |
| 09| 2050781250000 | 2097949218750000 |
| 10| 1025390520000 | 2098974609270000 |
| 11| 512695260000 | 2099487304530000 |
| 12| 256347630000 | 2099743652160000 |
| 13| 128173710000 | 2099871825870000 |
| 14| 64086750000 | 2099935912620000 |
| 15| 32043270000 | 2099967955890000 |
| 16| 16021530000 | 2099983977420000 |
| 17| 8010660000 | 2099991988080000 |
| 18| 4005330000 | 2099995993410000 |
| 19| 2002560000 | 2099997995970000 |
| 20| 1001280000 | 2099998997250000 |
| 21| 500640000 | 2099999497890000 |
| 22| 250320000 | 2099999748210000 |
| 23| 125160000 | 2099999873370000 |
| 24| 62580000 | 2099999935950000 |
| 25| 31290000 | 2099999967240000 |
| 26| 15540000 | 2099999982780000 |
| 27| 7770000 | 2099999990550000 |
| 28| 3780000 | 2099999994330000 |
| 29| 1890000 | 2099999996220000 |
| 30| 840000 | 2099999997060000 |
| 31| 420000 | 2099999997480000 |
| 32| 210000 | 2099999997690000 |
| 33| 0 | 2099999997690000 |
New schedule from the point where the previous would hit zero, and with everything multiplied by 1000.
| Era | Added in Era | Total supply |
| --- | ---| ---|
| 33| 122220000 | 2099999999875680000 |
| 34| 61110000 | 2099999999936790000 |
| 35| 30450000 | 2099999999967240000 |
| 36| 15120000 | 2099999999982360000 |
| 37| 7560000 | 2099999999989920000 |
| 38| 3780000 | 2099999999993700000 |
| 39| 1890000 | 2099999999995590000 |
| 40| 840000 | 2099999999996430000 |
| 41| 420000 | 2099999999996850000 |
| 42| 210000 | 2099999999997060000 |
</details>
2023-12-18 14:52:51 +01:00
This 1000x is us limiting ourselves based on the assumption that 100% of all BCH ever minted should still be possible to store in a single transaction-output. It should be noted that since this is never actually going to happen in practice, a further 2 zero's should be easy and mostly safe to add. But the complexity in the full node might go up as a result.
2023-04-03 14:18:07 +02:00
2023-12-18 14:52:51 +01:00
## New transaction version
2023-04-03 13:36:21 +02:00
2023-12-18 14:52:51 +01:00
In the May 2023 we introduced the protocol rule that transaction versions not known to the network are not allowed. This gives us a good opportunity to allow users to use the transaction version as an indication that something is to be used slightly different again. Similar to how this is happening with version 2 transactions and BIP68.
2023-04-03 15:48:14 +02:00
2023-12-18 14:52:51 +01:00
For transactions that are marked as version 3 or later, the 'amount' field in each output is to be interpreted as being a number that includes sub-Satoshis.
2023-04-03 15:48:14 +02:00
2023-12-18 14:52:51 +01:00
Payments from a version 2 (or earlier) transaction-output to a version 3 (or later) transaction-output will thus convert the amount by multiplying it with 1000. And vice versa.
2023-04-03 15:48:14 +02:00
2023-12-18 14:52:51 +01:00
A version 3 transaction can thus split an amount in sub-Satoshis among its outputs, should it wish to do so. The monetary value of a single Satoshi is so low that doing this in the 2025 upgrade is advised in order to make transactions maybe losing sub-Satoshis if they go back to version 2 transactions accidentally to be a non-event that simply increases the miner fee a tiny little bit. The ability to be backwards compatible at low cost with old transaction generators this way is likely quite valuable.
2023-04-03 13:36:21 +02:00
## Feedback & Reviews
2023-12-18 14:52:51 +01:00
2023-04-03 13:36:21 +02:00
## Changelog
2023-12-18 14:52:51 +01:00
At the end of 2023 the proposal was massively simplified after realization that some problems that were solved with the extra complexity was a non-issue in practice. Check git if you're curious.
2023-04-03 13:36:21 +02:00
## Copyright
Copyright (C) 2023 Tom Zander
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.