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

Support for storage value proof verification #1481

Closed
ERussel opened this issue May 11, 2022 · 3 comments
Closed

Support for storage value proof verification #1481

ERussel opened this issue May 11, 2022 · 3 comments
Labels

Comments

@ERussel
Copy link

ERussel commented May 11, 2022

polkadot/api has a function to retrieve a proof for storage value given corresponding key. But is there a library that allows to verify received proof against Merkle root?

Our research shows that we need proper implementation of the trie-db. We tried to use one from polkadot/common 1.8.1 but looks like it is outdated (for example, NibbledBrachNode type is missing for Trie node). The only option we see now is to port Rust implementation of the proof verification that looks very complicated but may be there is an easier way?

@jacogr
Copy link
Member

jacogr commented May 11, 2022

The trie-hash is indeed very outdated, it has not kept up with the latest changes. (It has moved code locations, here is the PR with the latest code that was in common https://github.com/polkadot-js/client/pull/250/files). I'm assuming the @polkadot/trie-hash should actually be sufficient for this usage, but yes, it is seriously outdated compared to Rust master.

I cannot think of another way. I guess without porting if the trie-root can be compiled to WASM (it is certainly compatible since it is used in Substrate), it would be the best solution from a compatibility perspective.

@polkadot-js-bot
Copy link

This issue has been open for 21 days with no activity and is not labelled as an enhancement. It will be closed in 7 days.

@polkadot-js-bot
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Jun 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants