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

Merklization and preflighting for ZK Fraud Proofs #10

Merged
merged 3 commits into from
May 4, 2024

Conversation

l-monninger
Copy link
Collaborator

Summary

  • Status: WIP
  • Objective: Merklize vanilla Move VM account storage and preflight to enable guest use of large storage.

Briefly, we need to enable the analog of this from the Zeth project.

The above takes a narrowed input of the total ETH storage which is input from the host to the guest. This narrowed input contains only the state needed in a "pre-flight" run of the ETH block executed and a Merkle Proof for each state entry. The guest then verifies each element in the state.

The host can "preflight" the guest logic to determine what data will be needed. This doesn't rely on any zkVM features; instead, it's a general design pattern for hosts & guests. Briefly: the guest's logic is implemented in a crate; the guest is just a thin wrapper around this crate; and the host is able to import and use this crate. The crate provides a trait that abstracts the "database." When running in the host, an impl is used that keeps track of the data that was requested; when the host invokes the guest, it provides a serialized representation of that data; and when running in the guest, an impl i used that just reads from this serialized representation.

Note: there is an alternative which uses io_callback to retrieve the state and proofs on-demand. However...

[The RISC0] proving service doesn’t support [io_callback] at this time. That’s the main reason Zeth doesn’t use it.

Progress

  • Build MoveResolver over a Jellyfish Merkle Tree.
  • Extend MoveResolver and ChangeSet writer to support state access monitoring with WithAccessLog
  • Establish vanilla Move VM BlockExecutor.
  • Establish Move VM storage helper traits and generic tests derived from these traits.
  • Reorg no. 1
  • Manage fork of jmt into internally managed crate for extensibility and compatibility.
  • Extend WithAccessLog to include proofs with WithPreflight.
  • Add RISC0 host preflighting logic.
  • Add RISC0 guest verification logic.
  • Reorg no. 2
  • Benchmark

@l-monninger l-monninger merged commit eb27948 into main May 4, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant