zkevm-circuits icon indicating copy to clipboard operation
zkevm-circuits copied to clipboard

MPT: Connect Witness generation to zkEVM circuits

Open aguzmant103 opened this issue 2 years ago • 2 comments

Depends: #740 and #812

Description:

  • Repo https://github.com/privacy-scaling-explorations/mpt-witness-generator (main branch)
  • Could require some changes to the API to this bindings.

Another task:

  • Review the changes and witness generation #812

aguzmant103 avatar Sep 28 '22 12:09 aguzmant103

Here are some details of this task taken from an old issue. In particular, the MPT witness generation needs to be integrated into the Circuit Input Builder, more or less like this:

  1. Merge results from all account and storage accesses that happen in a block, and combine their MPT proofs into a Partial State Trie to generate proofs for the circuit.
    • [x] Implement a Partial State Trie that supports updates and proof generation https://github.com/privacy-scaling-explorations/mpt-witness-generator
    • [ ] Build a Partial State Trie from collected proofs
    • [ ] Generate intermediate proofs for StorageOps and AccountOps (Blocked by inputs / witness spec of MPT Circuit https://github.com/appliedzkp/zkevm-circuits/tree/mpt2) - Sort all state/storage accesses by (address, key, rwc) - Use wrapper over MPT witness generation https://github.com/privacy-scaling-explorations/mpt-witness-generator - Storage: For each unique (address, key), get a "before" proof, apply last write, get "after" proof - Account: For each unique (address), get "before" proof, apply write with final values, get "after" proof - Append all hashes used by the MPT into the hash source list.

ed255 avatar May 02 '23 14:05 ed255

Related to https://github.com/privacy-scaling-explorations/zkevm-circuits/issues/812

ed255 avatar Jun 01 '23 09:06 ed255