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

Sparse merkle tree multi-proof #555

Closed
wants to merge 1 commit into from
Closed

Sparse merkle tree multi-proof #555

wants to merge 1 commit into from

Conversation

hujw77
Copy link

@hujw77 hujw77 commented Dec 21, 2021

For gas saving, we could use the sparse merkle tree multi-proof to validate the commitment signed by beefy authority set.
More detail can see darwinia-network/darwinia-messages-sol#104

@vgeddes vgeddes requested review from musnit and vgeddes December 22, 2021 11:51
@vgeddes
Copy link
Collaborator

vgeddes commented Dec 22, 2021

Hey @hujw77 thanks for the contribution. I'll be able to review this properly next week, unless my colleagues get to it first.

@musnit
Copy link
Collaborator

musnit commented Jan 12, 2022

@hujw77 Taking another quick look - Using a multiproof instead of an array of individual proofs looks like a great idea and optimization!

We'll need to build the proof creation logic into our relayer and do a deeper team audit and review before merging this. At the moment we're focused on some other maintenance and new feature work, so it may take a few weeks before we schedule this work in, but will leave this open as it's definitely something we'll want to merge in before this code is used in production.

Thanks again!

@hujw77
Copy link
Author

hujw77 commented Jan 13, 2022

@musnit For the proof creation logic, there is research about it at https://github.com/hujw77/sparse-merkle-tree
It may be some help for audit and review.

@vgeddes
Copy link
Collaborator

vgeddes commented Jan 12, 2023

Very obsolete. Now that paritytech/substrate#12857 has been merged, we can use the OpenZeppelin multi-proof verifier for this:

https://github.com/OpenZeppelin/openzeppelin-contracts/blob/5dbde1a5c954a79338959d4eb9c7e716a217d6a1/contracts/utils/cryptography/MerkleProof.sol#L77

@vgeddes vgeddes closed this Jan 12, 2023
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

Successfully merging this pull request may close these issues.

3 participants