Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incremental tree? #10

Open
sanderpick opened this issue Aug 12, 2023 · 3 comments
Open

Incremental tree? #10

sanderpick opened this issue Aug 12, 2023 · 3 comments

Comments

@sanderpick
Copy link

Any ideas on how one might build a tree incrementally? I'd like to add a leaf in a contract function and save the root in contract storage. Then, later check that some supplied hash is part of the tree in a different function (different txn). i.e., an inclusion proof against a dynamic tree.

Cheers!

@dmfxyz
Copy link
Owner

dmfxyz commented Aug 12, 2023

Murky does not currently support this. However there's an interesting article here: https://ethresear.ch/t/efficient-on-chain-dynamic-merkle-tree/11054.

Obviously open to contributions, or may take a look at this myself (not sure when).

@sanderpick
Copy link
Author

Very cool, thanks for the tip. I played around with it a bit here. The general class of sparse merkle trees (MMRs specifically) is pretty compelling for efficiently proving off chain dynamic state. To make this compelling as an addition to murky / a standalone lib, I think it would have to come with tooling to build the trees and get proofs in various languages.

@yorhodes
Copy link

yorhodes commented Oct 14, 2023

there is an incremental tree implementation here https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/libs/Merkle.sol as well as accompanying rust tooling https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/hyperlane-core/src/accumulator/merkle.rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants