feat(cardano): store full merkle tree branches in mailbox datum #4
+564
−176
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, the mailbox only stored the merkle root, which meant the on-chain validator couldn't verify that the merkle tree was correctly updated during dispatch - it had to trust the submitted root.
By storing the full branch state (32 branches × 32 bytes), the mailbox validator can now compute and verify the merkle root on-chain after each message insertion, providing cryptographic guarantees that the tree is correctly maintained.
This costs ~4.4 ADA more in minUTxO but eliminates the trust assumption and simplifies the validator/relayer architecture since tree.root() now returns the correct value directly from chain state.
Updates task-1.1 documentation to reflect the new full-branch storage design and marks implementation as complete.