Gas Cost Analysis

Aggregation Cost

The cost of verifying aggregated user proofs in a Gnark Groth16 super-proof system can be broken down as follows:

  1. Base cost: 354,241 Gas for verifying the super-proof on-chain.

  2. Per-proof cost: ~6,200 Gas for processing and state updates per individual proof aggregated.

The gas cost formula for aggregation per proof turns out to be:

Verification Access Cost

Users can verify that a certain zk-proof, corresponding to specific public inputs, is included in the superproof. This verification is done through a cross-contract call, as described in the integration docs. The gas cost for this verification process is approximately 7,300 Gas per call.

Total Cost Per Proof

The total cost of verifying each proof in an aggregated system consists of two components:

  1. Fixed Cost: 13,500(6200+7300) Gas This cost remains constant per proof, regardless of the number of proofs aggregated.

  2. Diminishing Cost: (354,241 / n) Gas Where n is the number of proofs aggregated in a single superproof. This cost decreases as the number of aggregated proofs increases.

Key Point: The Diminishing Cost represents an economy of scale – the more proofs aggregated into a single superproof, the lower the per-proof cost for this component.

Last updated