Skip to content

Commit

Permalink
doc: uxtreeo
Browse files Browse the repository at this point in the history
  • Loading branch information
liamzebedee committed Jan 19, 2025
1 parent 0b95025 commit d6e9379
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/idea-uxtreeo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Idea: UXTO
==========

The state of a Bitcoin blockchain is the UXTO set - the set of unspent transaction outputs. Each UXTO is a "one-use" piece of state - a transaction consumes inputs (UXTO's) and sends their value to different outputs (which is where UXTO's are created).

There are two implications to this model:

1. Nodes must store an entire UXTO set.
2. In an account-based model, nodes must check for transaction uniqueness via account nonces.

Here is an idea for simplifying this:

1. Each block commits to a sparse merkle tree containing the state.
2. The state consists of UXTO's which are identified by key and value.
3. It is simple for light clients to verify the validity of a UXTO based on the current state of this tree, since sparse merkle trees allow for inclusion/exclusion proofs.
4. But this incurs a large cost - in order to spend a UXTO, users must produce a leaf proof - which is O(N log N) leaves in space. This times 8192 txs (the full size of a 2MB block?) means quite a lot more data storage. Each hash is 32 bytes, so at least 16*32 is a lot of bytes added.
5. So - what we can do. Nodes can prove these leaves into a ZK proof - thus reducing the cost down to O(log N) where N is the number of computational steps - and close to constant size if proof aggregation is used.

https://eprint.iacr.org/2019/611

https://bitcoinops.org/en/topics/utreexo/

0 comments on commit d6e9379

Please sign in to comment.