You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Experiencing problems? Have you tried our Stack Exchange first?
This is not a support question.
Motivation
I was looking at ways to implement simple merkle proofs within a pallet, and it seems that pallet_session::historical has this ability with the ProvingTrie.
However, the full definition for this type is within the pallet crate, and thus the simple idea of creating and using a merkle trie and proof is not available to other pallets without fully reimplementing the type.
Request
Create a generic and reusable version of the ProvingTrie which is made available by the Polkadot-SDK
Solution
Take the existing ProvingTrie, and make it generic over the data being proved.
Are you willing to help with this request?
Yes!
The text was updated successfully, but these errors were encountered:
This PR will introduce a `BasicProvingTrie` type, which makes it easy to
construct and prove data in a base-16 merkle trie within the runtime.
Data into the merkle trie only require that they implement `Encode` /
`Decode`.
A FRAME compatible `TrieError` was created and added to `DispatchError`.
Expected usage is to construct the merkle trie with all data offline,
and then place only the merkle root of that trie on-chain.
Also offchain, a user is given a compact merkle proof of some data they
want to prove exists on the blockchain.
Then in the runtime, you can call `verify_single_value_proof` or
`verify_proof` with the root, proof, and the keys and values you want to
verify exists in the merkle trie.
Closes#3880
Contributes to #5400
---------
Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Motivation
I was looking at ways to implement simple merkle proofs within a pallet, and it seems that
pallet_session::historical
has this ability with theProvingTrie
.However, the full definition for this type is within the pallet crate, and thus the simple idea of creating and using a merkle trie and proof is not available to other pallets without fully reimplementing the type.
Request
Create a generic and reusable version of the
ProvingTrie
which is made available by the Polkadot-SDKSolution
Take the existing
ProvingTrie
, and make it generic over the data being proved.Are you willing to help with this request?
Yes!
The text was updated successfully, but these errors were encountered: