Investigate strategy for constructing and verifying membership proofs from a Starknet commitment root #40
Labels
after mvp
Will only work on this at Q2 2025 onward, after the MVP demo is done
starknet light client
starknet
Milestone
On Cosmos side, we know that it should probably be relatively easy to verify the UpdateClient of a Starknet state transition using Stark proofs and sequencer signatures. (#12) However, it is currently unclear how we can construct membership proofs from a commitment root. This is required for verifying commitment of packets sent from Starknet to Cosmos.
The proof will probably consist of two parts: one is to link a given global commmitment root to the commitment root of a specific smart contract, and one is to link the commitment root of the smart contract to the membership proof.
We need to investigate how Starknet constructs its commitment root by aggregating all smart contract states, and how each smart contract layout their state. Hopefully, the storage is still in the form of merkle trees, so that we can construct merkle proofs as membership proofs.
Alternatively, it may be possible that Starknet contracts use custom layout for their data storage. In such case, we may need to write custom Cairo programs that prove the existence of certain element in the smart contract's storage. That may require significantly more work, as we are unsure how to write such a program and how to obtain the state from a Starknet node.
We should also investigate whether Starknet full nodes provide any API for fetching such membership proof. At the very least, we will probably need an API to construct the proof from the global commitment root to the smart contract commitment root. As for the second part, it may be possible to construct the proof within the smart contract by implementing a query call.
The text was updated successfully, but these errors were encountered: