celestiaorg / celestia-app

Celestia consensus node
https://celestiaorg.github.io/celestia-app/
Apache License 2.0
345 stars 292 forks source link

Proof Verification of the Merkle Partricia Trie #3985

Open cmwaters opened 1 month ago

cmwaters commented 1 month ago

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:

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

ninabarbakadze commented 3 weeks ago

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