zkevm-circuits
zkevm-circuits copied to clipboard
newbie question regarding how zkevm works
hey, I understand one usecase of zkevm circuit project is to generate the proof offchain and verify it onchain via solidity code, that means the circuit itself should be independent of specific block data, in that way we can generate the vk from the circuit and put the vk in verifying contract. While i am looking at some implementation for example pi_circuit.rs, it contains public block data as part of the circuit, that means vk for pi_circuit is not a fixed thing. am i missing something? can someone shed light on how it should work? thanks.
Best I can provide is some intro docs I made that I have pending to be published.
See: https://hackmd.io/SJ0e7p_dS9y3ZIq-MmXm4Q?view
While i am looking at some implementation for example pi_circuit.rs, it contains public block data as part of the circuit, that means vk for pi_circuit is not a fixed thing. am i missing something? can someone shed light on how it should work? thanks.
Could you elaborate on where is the public block data part of the circuit? The circuit is defined from:
- custom gates (the polynomial constraints)
- lookups
- fixed columns (either fixed or selectors)
- copy constraints
That's what defines the
vk. The public input circuit should not contain any block data as part of those 4 sets. Once the circuit is defined, we fill the advices (witness) with values derived from the public block data in order to calculate a proof, but the same circuit can be reused for different blocks. We do have some circuit parameters that affect thevklike max number of txs, or max call data, but that will be fixed (once a sensible value is decided) and reused for all blocks.
Close due to inactivity. Also, FYI, we have a new video on zkevm-circuit codebase released https://www.youtube.com/watch?v=01U8O2I3quI