Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate strategy for constructing and verifying membership proofs from a Starknet commitment root #40

Open
soareschen opened this issue Aug 2, 2024 · 0 comments
Labels
after mvp Will only work on this at Q2 2025 onward, after the MVP demo is done starknet light client starknet

Comments

@soareschen
Copy link
Collaborator

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.

@soareschen soareschen added starknet light client after mvp Will only work on this at Q2 2025 onward, after the MVP demo is done labels Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
after mvp Will only work on this at Q2 2025 onward, after the MVP demo is done starknet light client starknet
Projects
None yet
Development

No branches or pull requests

2 participants