Expand description

Chain MMR Pallet

Overview

This is the pallet to maintain accumulate headers Merkle Mountain Range and push the mmr root in to the digest of block headers on finalize. MMR can be used for light client to implement super light clients, and can also be used in other chains to implement chain relay for cross-chain verification purpose.

Terminology

Merkle Mountain Range

For more details about the MMR struct, refer https://github.com/mimblewimble/grin/blob/master/doc/mmr.md#structure

MMR Proof

Using the MMR Store Storage, MMR Proof can be generated for specific block header hash. Proofs can be used to verify block inclusion together with the mmr root in the header digest.

Digest Item

The is a MerkleMountainRangeRoot(Hash) digest item pre-subscribed in Digest. This is implemented in Darwinia’s fork of substrate: https://github.com/darwinia-network/substrate The Pull request link is https://github.com/darwinia-network/substrate/pull/1

Implementation

We are using the MMR library from https://github.com/nervosnetwork/merkle-mountain-range Pull request: https://github.com/darwinia-network/darwinia/pull/358

References

Darwinia Relay’s Technical Paper: https://github.com/darwinia-network/rfcs/blob/master/paper/Darwinia_Relay_Sublinear_Optimistic_Relay_for_Interoperable_Blockchains_v0.7.pdf

https://github.com/mimblewimble/grin/blob/master/doc/mmr.md#structure https://github.com/mimblewimble/grin/blob/0ff6763ee64e5a14e70ddd4642b99789a1648a32/core/src/core/pmmr.rs#L606 https://github.com/nervosnetwork/merkle-mountain-range/blob/master/src/tests/test_accumulate_headers.rs https://eprint.iacr.org/2019/226.pdf

Re-exports

pub use pallet::*;

Modules

The module that hosts all the FRAME types needed to add this pallet to a runtime.

Structs

Constants

Traits