Why
IvcProof::verify runs two independent pairing checks in sequence: the KZG opening check (dual_msm.check) and the folded accumulator check (accumulator.check), so each one pays for its own multi-Miller loop and final exponentiation. Batching them is only possible since the upgrade to midnight-zk 2.3, which made both checks reduce to the same pairing equation against the same verifier parameters.
Benchmarks reported in this review comment show the combined check runs in 7.421 ms versus 8.677 ms when run separately (roughly 15% faster).
What
Combine the dual MSM check and the accumulator check in IvcProof::verify into a single batched pairing check, keeping soundness equivalent to the two separate checks.
How
Why
IvcProof::verifyruns two independent pairing checks in sequence: the KZG opening check (dual_msm.check) and the folded accumulator check (accumulator.check), so each one pays for its own multi-Miller loop and final exponentiation. Batching them is only possible since the upgrade to midnight-zk 2.3, which made both checks reduce to the same pairing equation against the same verifier parameters.Benchmarks reported in this review comment show the combined check runs in 7.421 ms versus 8.677 ms when run separately (roughly 15% faster).
What
Combine the dual MSM check and the accumulator check in
IvcProof::verifyinto a single batched pairing check, keeping soundness equivalent to the two separate checks.How
DualMSMscaled by a transcript-derived random challenge, and replace the twocheckcalls with a single one (an unscaled sum would let one side cancel the other)IvcProofError::KzgOpeningFailedandIvcProofError::AccumulatorFailed, and update the tests and doc comments that rely on the distinction