Skip to content

feat: precompute from public inputs in verification #1521

@akakou

Description

@akakou

Background

In Groth16, the verification process incurs a linear latency increase due to the computation of the multi-scalar multiplication (MSM). When there are many public inputs, this computation becomes a significant bottleneck in the system.

Problem

When a verifier uses the same part of the public inputs for every proof, it redundantly computes the MSM during each verification, even though the MSM result remains unchanged.

Solution

I propose precomputing the MSM value from fixed parts of the public inputs. In this scheme, the MSM is calculated once for a given set of already decided public inputs, and the result is then used in all subsequent verifications for which the inputs remain unchanged. This approach reduces the online cost of calculating the MSM: in online verification, the verifier only needs to compute the MSM from the undecided parts.

Remark

Similar functionality is implemented in arkworks via the prepare_inputs and verify_proof_with_prepared_inputs methods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions