I do agree with MMR being the most powerful platform for implementing UTXO commitments, actually I have been investigating the subject for a while and I have a couple of more points to share but for the time being I'm curious whether you have any idea about how we could avoid a hard fork for this? Just asking because I got one
lol.. I'm ashamed to say I hadn't actually thought about that bit.. I suppose there are the usual suspects to do it softly softly.. you could either stuff it in the coinbase - or as an OP_RETURN in the first transaction in the block... I have a feeling your method will be more
cunning.
Sure it is.
Would a block definitely be considered invalid if the commitment was wrong or missing ? (I should think yes) -
No, you shouldn't. And here is the trick:
The very interesting point about UTXO commitment is its potential to be 'delayed' (and yes, I'm borrowing this term from Peter Todd) i.e. you have time to decide about its validity. To be more precise, you MUST wait for a minimum number of commitments to start pruning the history, right? Otherwise you will be in the risk of being committed to a short-to-middle range double spend attack without any bridges behind to commit to chain rewrite, you will reject any (implied) rewrite request that goes beyond the snapshot you are committed to, because there is no history and no genesis.
You should wait for like 10,000 commitments, imo. Once you got that thresholds you are ready to get rid of the history because it takes like 8 billion dollars (nowadays) to rewrite Bitcoin blockchain in that range and it is why UTXO commitment works after all.
Another interesting issue here is your free will: you could choose a more realistic and effective strategy by pruning after 1000 blocks once you are confidentially sure about that nobody commits a 1 billion dollars attack against the network, yeah?
Now we are ready to walk through the algorithm (
it is the alpha version, published for the first time, feel free to suggest improvements) which I purposely call it
Soft Delayed Utxo Commitment
Soft Delayed Utxo Commitment
1- A SDUC compatible node takes a snapashot from UTXO every 1,000 blocks and generates a Merkle root for the set using a deterministic method that allows insertions and deletions of items such that the most recent snapshot and the last 1000 blocks always generate the same new snapshot as if it was supposed to be generated using the previous snapshot (if any) and the last 2,000 blocks.
2- A SDUC node is configurable (and queryable) for the number of
commitments it needs for committing permanently and irreversibly to an UTXO snapshot via its Merkle root. It is never allowed to be less than 1,000 commitments.
3- We define
commitments for an UTXO as the number of blocks that have embedded a
commit to its Merkle root.
4- SDUC mining nodes,
commit to a UTXO snapshot by
embedding its Merkle hash root in the coinbase transaction of their blocks as an special input. They are free to commit to as many UTXO Merkle root as they wish (by introducing more special inputs in the coinbase) but they should be
stacked properly with the last UTXO Merkle root being interpreted as a reference to the state of the system after the block numbered floor(#BlockHeight/1000 ) and the next item below it referring to the state at floor(#BlockHeight/2000 ) and so on.
5- In networking layer, we add proper message formats for SDUC nodes to identify each other and consolidate their chains and snapshots.
6- SDUC nodes bootstrap in a different way compared to legacy nodes:
- phase 1: SDUC node acts like a spv node and downloads block headers.
- phase 2: SDUC node spots at least one SDUC peer that conforms to its expected number of commitments expectation i.e. it has proof for the desired number_of_commitments for each UTXO commitment it presents and the bootstrapping SDUC node is interested in. Thereafter it consolidates its chain with the peer, in a top-down approach down to the (at least) first completely confirmed UTXO snapshot, confirmed from the bootstrapping SDUC node's point of view, obviously.
7- SDUC nodes are free to ignore all the history beyond their most recent UTXO which is held confirmed by virtue of blocks with configured number_of_commitments on the specific.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Implementation is straightforward but for such a BIP to be adopted in bitcoin core (or any other bitcoin clone) there are two options:
1- Forking the source code and building an alternative client.
Generally, I hate this approach and as much as I'm not satisfied with conservatist atmosphere in Core devs I strongly believe in keeping development centralized and open. But it would not be an issue if it was not about miners and the need for having at least a percentage of them (like 5% I suppose) running the client software and you just can't bring a software out of nowhere and ask miners to run it with the amount of stakes they have put in their business.
2- The hard but more promising way: Convincing Doomad and cellard not to ruin this topic and having a productive discussion, cooling down Gregory Maxwell and convincing him to contribute instead of arguing or showing no interest, formalizing a BIP, working hard on the implementation details, testing and praying for the commit of the BIP.
At the end of the day we have a soft-soft migration path SDUS nodes grow smoothly without any conflict or chain split because every node in sense is a SDUC node and it can be interpreted just about the
numer_of_commitments parameter being set to a very large number for legacy nodes that the owners prefer and have enough resources to stick with the whole blockchain history and more reasonable values for a growing number of nodes which need more robust and efficient management of their resources. They could coexist in peace for a very long time even forever.
but maybe users of the scheme could craft specific transactions that they share for each other only.. via the blocks.. and we don't have to fork at all.
kinda ... you are super smart dude, we should hang out a bit more
What I am more curious about is a solution to storing the old pruned data from the blocks.. in a distributed way. With all these file-store coins (I'll be honest I am not 100% up on how they are functioning), would it not be possible for the network to store JUST this one large file.. ?
Not a big deal, imo. There will always be nodes with very large number_of_commitments set and we are super safe. For a hypothetical scenario in which we are short of such nodes, your solution works, nothing will be lost and anybody would be able to rebuild the blockchain from the ground up perhaps using a special software.