-
Is the latency linear to only the number of public parameters ( [1] https://medium.com/@mehialiabadi/plonk-vs-groth16-50254c157196 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The prover speed is O(n logn) in the number of constraints (essentially circuit size). The verifier cost is indeed linear in the number of public parameters. For this reason if the circuit would require many public inputs, then it makes sense to hash them and only provide hash of the public parameters as a single public input and then in-circuit verify that the hash is correctly computed. This helps for example when implementing Solidity verifier. That said - we unfortunately right now don't have separate Solidity library for MiMC/Poseidon2 hashing. So it would be necessary to implement yourself. Other option is to use SHA2/Keccak which has native Ethereum support, but it is expensive to compute in-circuit. We also have one additional optimization for proving performance, which computes a Fiat-Shamir challenge efficiently in-circuit. But this requires one additional pairing computation by the verifier. This optimization is toggled automatically depending if the circuit uses features which require Fiat-Shamir challenges (non-native arithmetic, SHA2/3 hashing). |
Beta Was this translation helpful? Give feedback.
Indeed - I gave a simplified explanation, but essentially for Groth16 proof verification there are a few components which count towards the verification time:
Additionally, when in-circuit challenge computation is performed, we additionally have (n number of commitments)
But in practice we always have n=1 or we don't have commitment at all.
And usually the scalar multiplication is a lot cheaper than pairingcheck, so if you increase number of public inputs by a little (i.e. 1->2…