zero-knowledge-gadgets icon indicating copy to clipboard operation
zero-knowledge-gadgets copied to clipboard

[TASK] Sync the order of public inputs for R1CS and PLONK

Open lazovicff opened this issue 3 years ago • 1 comments

For Mixer:

  1. nullifier_hash
  2. root
  3. arbitrary data

For Anchor:

  1. chain_id
  2. nullifier_hash
  3. arbitrary_data
  4. roots[]

For VAnchor:

  1. public_amount
  2. public_chain_id
  3. arbitrary_data
  4. in_nullifier_hashes[]
  5. in_root_set[]
  6. out_commitments[]

We would have to sacrifice some of the performance to achieve this in PLONK. For example: Set gadgets expects a set to be Vec<F> which are public inputs (https://github.com/webb-tools/arkworks-gadgets/blob/master/arkworks-plonk-circuits/src/set_membership/mod.rs#L15). They are inserted into the circuit at the specific time to avoid additional gates. We would have make a standard for PLONK to give us control where the public inputs are defined, which will make it easier for make PLONK and R1CS interoperable.

lazovicff avatar Mar 01 '22 17:03 lazovicff

Should be equal to solidity side

lazovicff avatar Mar 03 '22 15:03 lazovicff