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

Define and implement the Root Circuit

Open ed255 opened this issue 3 years ago • 9 comments

The Root circuit is in charge of

  • Passing the public inputs to super circuit
  • Aggregating Super Circuit proof

ed255 avatar Aug 06 '22 10:08 ed255

Useful ref> https://github.com/privacy-scaling-explorations/plonk-verifier

andyguzmaneth avatar Sep 01 '22 12:09 andyguzmaneth

Pending: Pinkie has done part of this work, pending to review how this was implemented in zkevm-chain repo.

andyguzmaneth avatar Oct 27 '22 11:10 andyguzmaneth

At the moment, it's using the evm-verifier-with-accumulator example and only aggregates a single proof. Does it make sense to test a different setup where it aggregates all zkevm sub-circuits instead of just the super circuit?

link to aggregation circuit

pinkiebell avatar Nov 02 '22 10:11 pinkiebell

Does it make sense to test a different setup where it aggregates all zkevm sub-circuits instead of just the super circuit?

Do you mean to prove each sub-circuit separately then aggregate and connect them inside the Root circuit? If so I think we'd have an issue for now because currently most shared lookup tables contain RLC values, which doesn't follow the fiat-shamir process.

To make this happen, we have 2 approach:

  1. Share transcript among sub-provers: Refactor all sub-circuits with challenge API first, then while create each sub-circuit's proof, we need coordinate sub-provers to stop at each phase to gather the committed values and squeeze the challenge then continue. Then we can have share lookup table containing RLC values.
  2. Remove RLC values from shared lookup table Still need to refactor all sub-circuits with challenge API first, then we export the shared lookup table with raw value without RLC, then the depending circuit (e.g. EVM circuit lookups Keccak circuit) should build the RLC values inside its own proof.

But it should still be interesting to see the benchmark first, we can use a mocking fixed challenge value to see how much we can shrink for the required prover resource.

han0110 avatar Nov 03 '22 06:11 han0110

Currently, blocked/dependent by #790

"Should the RootCircuit depend on the Super circuit? Otherwise, it may not be a blocker."

andyguzmaneth avatar Nov 17 '22 12:11 andyguzmaneth

Basically done but can't test it due to #790

andyguzmaneth avatar Nov 24 '22 12:11 andyguzmaneth

Pinkie's PR (https://github.com/privacy-scaling-explorations/zkevm-chain/pull/102) is merged, so once Marios observes another successful aggregation proof, I think https://github.com/privacy-scaling-explorations/zkevm-circuits/issues/664 could be counted as done.

andyguzmaneth avatar Dec 01 '22 12:12 andyguzmaneth

So it seems that current zkevm-chain only implements the aggregation part, and the public input part passing is still WIP, and it kind of depends on https://github.com/privacy-scaling-explorations/zkevm-chain/issues/79, right @pinkiebell?

han0110 avatar Dec 08 '22 13:12 han0110

So it seems that current zkevm-chain only implements the aggregation part, and the public input part passing is still WIP, and it kind of depends on privacy-scaling-explorations/zkevm-chain#79, right @pinkiebell?

The public input part is implemented only for the original pi,super circuit inputs but not for the aggregation circuit. 👌

pinkiebell avatar Dec 08 '22 13:12 pinkiebell

This depends on https://github.com/privacy-scaling-explorations/zkevm-chain/issues/79

andyguzmaneth avatar Dec 15 '22 12:12 andyguzmaneth

Reviewing #1000

Depends on https://github.com/privacy-scaling-explorations/snark-verifier/pull/22

andyguzmaneth avatar Dec 22 '22 12:12 andyguzmaneth

https://github.com/privacy-scaling-explorations/snark-verifier/pull/22 is unblocked now

ChihChengLiang avatar Jan 20 '23 06:01 ChihChengLiang