Skip to content

Combine the dual MSM and accumulator pairing checks in IVC proof verification #3420

Description

@jpraynaud

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

  • Fold the accumulator into the proof DualMSM scaled by a transcript-derived random challenge, and replace the two check calls with a single one (an unscaled sum would let one side cancel the other)
  • Decide how to handle the loss of error granularity between IvcProofError::KzgOpeningFailed and IvcProofError::AccumulatorFailed, and update the tests and doc comments that rely on the distinction
  • Benchmark the combined verification to confirm the gain

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions