celestia-app icon indicating copy to clipboard operation
celestia-app copied to clipboard

Proof Verification of the Merkle Partricia Trie

Open cmwaters opened this issue 1 year ago • 1 comments

Summary

IBC Clients require a means of verifying parts of state of a counterparty chain. This is usually done in two steps 1) Verify the state root from a previous one 2) verify some set of data is included in the state root.

Most EVMs use a Merkle Patricia Trie (MPT) (I think here is the geth implementation). We need to support this tree structure (which is not currently part of ICS23 and has been too difficult in the past).

If we have a look at the VerifyMembership that it has to comply with we see the inputs:

  • StateRoot []byte
  • Value []byte
  • Proof []byte
  • Path string

Thus we need to use the geth library for some function that looks like this

Verify(stateRoot []byte, path string, value []byte, proof []byte) error

This will then be imported by the ZK IBC Client

cmwaters avatar Oct 17 '24 12:10 cmwaters

prototype https://github.com/celestiaorg/celestia-app/tree/nina/mpt-proofs

ninabarbakadze avatar Oct 30 '24 03:10 ninabarbakadze

closing this as completed in the lazybridging repo. https://github.com/celestiaorg/celestia-zkevm-ibc-demo/blob/4c43989012340c400d525751c32ef1a2d7762e8f/ibc/mpt/mpt.go

ninabarbakadze avatar Jun 02 '25 07:06 ninabarbakadze