Skip to content
Snippets Groups Projects
  • Shawn Tabrizi's avatar
    Create a Basic Proving Trie for the Runtime (#3881) · 1cff666b
    Shawn Tabrizi authored
    
    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 https://github.com/paritytech/polkadot-sdk/issues/3880
    
    Contributes to #5400
    
    ---------
    
    Co-authored-by: default avatarAnkan <10196091+Ank4n@users.noreply.github.com>
    Co-authored-by: default avatarOliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
    Unverified
    1cff666b
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Cargo.lock 512.25 KiB