Maximizing Efficiency in Ethereum ZKPs: A Look at Groth16 and FFLONK Gas Costs

Orbiter_Finance
1 min readMay 21, 2024

--

Author: Kiwi from @OrbiterResearch

Introduction:

As Ethereum’s zero-knowledge proof (ZKP) ecosystem evolves, optimizing gas efficiency for ZKP verification has become a crucial concern. Our analysis focuses on comparing the gas costs of Groth16 and FFLONK proving systems and exploring best practices to minimize these costs effectively. For those interested in the practical aspects, the code used for gas testing and the implementation of the best practices can be found at here.

Key Takeaways:

  1. Gas Cost Analysis:
  • Groth16 and FFLONK have similar cost structures but differ in constants. This distinction arises because public signals in Groth16 participate in the Multi-Scalar Multiplication (MSM), while in FFLONK, public signals are involved in various preprocessing steps.
  • Groth16 Gas Cost: Approx. 207k + 7.16k per public signal.
  • FFLONK Gas Cost: Approx. 200k + 0.9k per public signal.

2. Best Practices for Minimizing Gas Costs:

  • By integrating multiple public signals using Num2Bits and Bits2Num techniques, and applying SHA-256 hashing to use the hash result as the sole public signal, substantial reductions in gas costs are achieved while maintaining data integrity.

For a detailed analysis, complete with step-by-step breakdowns and testing, visit our comprehensive guide on HackMD here.

--

--

Orbiter_Finance

Orbiter Finance is a decentralized cross-rollup Layer 2 bridge with a contract only on the destination side.