AEIP | Title | Author | Type | Category | Status | Created |
---|---|---|---|---|---|---|
25 |
Merkel Trees to secure the validation stamp, unspent inputs and consumed outputs |
Akshay Kumar KANDHI MANJUNATHA REDDY <[email protected]> ; Samuel Manzanera <[email protected]> |
Standard Track |
Core |
Review |
2024-02-13 |
This AEIP solves the problem of
- Security of data for Unspent Outputs (UTXOs) and Consumed Inputs:
- Verifying maliciousness without revealing the actual data:
There are 3 steps to understanding Merkel Trees (if you already know about Merkel trees skip introduction section) (* This introduction is directly copy pasted from ChatGPT)
Below is the transaction validation process (updated to also include AEIP 21). Only the steps in Violet are modified with the inclusion of merkel trees
- Fetch Previous Transaction and Network View: The elected nodes (coordinators and cross validation nodes) get all the transactions necessary for validation from the closest storage nodes
- Fetch the Unspent entries (UTXO): The elected nodes also get all the transactions related to unspent entries (UTXO) on the respective genesis pools. (During this fetching make sure to take the data from all the genesis nodes so that no UTXO entry is missed)
Sender's Genesis: Once the context of the transaction has been rebuilt, the cross-validation nodes communicate to the coordinating node the list of storage nodes used to collect the data and their views on the availability of the validation and storage nodes.
The Coordinator node, later has to rebuild the context of the transaction (chain, inputs, output), figure out the proof of work (PoW), compute the replication tree , define the operations on the ledgers and sign the validation stamp and transmit it to the cross validation nodes.
Validation Stamp contains ( Merkel Root | Proof of Integrity | Proof of election | Recepients | Fee | Protocol Version | Time Stamp | Ledger Operations (From, Type, Amount, Aggregated Signature, Merkel Root & Merkel Path) | Unspent Outputs (Sender’s Genesis) | Spent Outputs (Sender’s Genesis)
This is Merkel Root of validation stamp is needed
- Cross validation nodes can prepare the merkel root of validation stamp even before the coordinator nodes sends the validation stamp to cross validation.
- Any part of the validation stamp can be verified without revealing the contents of the stamp. This is helpful and important in malicious detection and elimination.
Unspent Outputs and Consumed Inputs Calculation:
- The validation stamp also builds the new “Consolidated Unspent UTXO” that is the full consolidation of the previous “Consolidated Unspent UTXO” and “New UTXOs”
- The validation stamp computes the Consumed Inputs into the “Spent”, calculating the new Merkel Root from the previous spent merkel path for the new “Spent”.
The content of the Validation Stamp is verified by each cross-validation node which will further issue a "CrossValidation Stamp" to the coordinator and other cross validation nodes.
The cross validation just verify the merkel root. This saves the time taken to verify the validation stamp.
Finally with the fully validated transaction,
The Sender’s genesis nodes are updated with the new Consolidated Unspent UTXOs and Spent Outputs.
The Receiver’s genesis nodes are updated with the new Unspent UTXO from the sender Both Sender and Receiver genesis nodes will verify the contents of the UTXOs before taking it into account.