LogoLogo
LogoLogo
  • Introduction
    • About Us
    • Notations & Definitions
      • MPC
      • ZK
    • Contribute to this Site!
  • Primitives
    • Multiplication
      • Karatsuba Multiplication
      • Toom-Cook Multiplication
    • NAF (Non-adjacent form)
    • Chinese Remainder Theorem (CRT)
    • Euclidean Algorithm
      • Extended Euclidean Algorithm
      • Binary Euclidean Algorithm
      • Extended Binary Euclidean Algorithm
    • Coding Theory
      • Linear Code
    • Number Theoretic Transform
    • Abstract Algebra
      • Group
        • -Morphisms
        • Batch Inverse
      • Elliptic Curve
        • Weierstrass Curve
          • Coordinate Forms
          • Fast Elliptic Curve Arithmetic and Improved WEIL Pairing Evaluation
        • Edwards Curve
          • Coordinate Forms
          • Twisted Edwards ↔ Short Weierstrass Transformation
        • Batch Inverse for Batch Point Additions
        • Scalar Multiplication
          • Double-and-add
          • GLV Decomposition
        • MSM
          • Pippenger's Algorithm
          • Signed Bucket Index
          • CycloneMSM
          • EdMSM
          • cuZK
        • 2-Chain and 2-Cycle of Elliptic Curves
    • Encryption Scheme
      • ElGamal Encryption
    • Modular Arithmetic
      • Modular Reduction
        • Barrett Reduction
        • Montgomery Reduction
      • Modular Inverse
        • Bernstein-Yang's Inverse
    • Multiset Check
    • Sumcheck
    • Commitment Scheme
      • Fflonk
      • SHPlonk
      • Zeromorph
  • MPC
    • Yao's Garbled Circuits
    • GMW
    • BMR
  • ZK
    • Arithmetization
      • R1CS
      • PLONK
      • AIR
    • Folding
      • LatticeFold
      • Nova
        • Nova over Cycles of Curves
    • Lookup
      • Lasso
      • LogUp-GKR
    • SNARK
      • Groth16
      • HyperPlonk
      • Spartan
        • SPARK
    • STARK
      • Additive NTT
      • Basefold
      • Binius
      • Brakedown
      • CircleSTARK
      • FRI
        • FRI Security Features and Optimizations
      • DEEP FRI
      • STIR
      • WHIR
    • Distributed ZK
      • Ryan's Trick for Distributed Groth16
  • Application
    • zkLogin
    • zkHoldem
    • zkTLS
      • DECO
      • Proxying is enough
  • zkVM
Powered by GitBook
On this page
  • Introduction
  • Background
  • Protocol Explanation
  • Polynomial Combination and Decomposition
  • Finding from
  • Opening Multiple Polynomials at Multiple Points
  • Conclusion
  • References
Export as PDF
  1. Primitives
  2. Commitment Scheme

Fflonk

Presentation: https://www.youtube.com/watch?v=E5oLEqbx6F4

PreviousCommitment SchemeNextSHPlonk

Last updated 2 months ago

Introduction

When opening at a single point for nnn polynomials, the common technique is to use a random linear combination, which requires n−1n - 1n−1 scalar multiplications. Eliminating these operations could lead to more efficient verification. Meanwhile, in SHPlonk, when opening KZG in batch, the verifier randomly samples a point z←Fz \leftarrow \mathbb{F}z←F and constructs a vanishing polynomial L(X)L(X)L(X) for this point. This method allows an opening at ttt points to be converted into an opening at a single point. However, the verifier still needs to perform O(n)O(n)O(n) computations, and reducing this cost could improve verification efficiency.

A natural question arises: can "the problem of opening at a single point for multiple polynomials" be transformed into "the problem of opening at multiple points for a single polynomial"? If possible, then leveraging SHPlonk’s method could enable more efficient batch opening for the verifier.

Background

Please read beforehand!

Protocol Explanation

When performing Radix-2 FFT, P(X)P(X)P(X) is decomposed into even and odd parts:

P(X)=PE(X2)+X⋅PO(X2)P(X) = P_E(X^2) + X \cdot P_O(X^2)P(X)=PE​(X2)+X⋅PO​(X2)

Now, consider a simple problem of opening at a single point xxx for multiple polynomials P0(X),P1(X)P_0(X), P_1(X)P0​(X),P1​(X). We define P(X)P(X)P(X) as follows:

P(X)=P0(X2)+X⋅P1(X2)P(X) = P_0(X^2) + X \cdot P_1(X^2)P(X)=P0​(X2)+X⋅P1​(X2)

Let x=z2x = z^2x=z2, and open P(X)P(X)P(X) at S={z,−z}\bm{S} = \{z, -z\}S={z,−z}:

P(z)=P0(x)+z⋅P1(x)P(−z)=P0(x)−z⋅P1(x)P(z) = P_0(x) + z \cdot P_1(x) \\ P(-z) = P_0(x) - z \cdot P_1(x)P(z)=P0​(x)+z⋅P1​(x)P(−z)=P0​(x)−z⋅P1​(x)

By performing the following computations, we can retrieve P0(x)P_0(x)P0​(x) and P1(x)P_1(x)P1​(x):

P0(x)=P(z)+P(−z)2P1(x)=P(z)−P(−z)2zP_0(x) = \frac{P(z) + P(-z)}{2} \\ P_1(x) = \frac{P(z) - P(-z)}{2z}P0​(x)=2P(z)+P(−z)​P1​(x)=2zP(z)−P(−z)​

Thus, the original problem is transformed into opening at multiple points S={z,−z}\bm{S} = \{z, -z\}S={z,−z} for a single polynomial P(X)P(X)P(X), allowing us to apply SHPlonk’s batch opening method.

To generalize this approach to nnn polynomials, we need a way to combine P0(X),…,Pn−1(X)P_0(X), \dots, P_{n-1}(X)P0​(X),…,Pn−1​(X) into a single polynomial and derive S\bm{S}S from xxx.

Polynomial Combination and Decomposition

To merge multiple polynomials into one, we define the following functions:

  • combinen(P):F[X]n→F[X]\mathsf{combine}_n(\bm{P}): \mathbb{F}[X]^n \to \mathbb{F}[X]combinen​(P):F[X]n→F[X]: This constructs P(X)P(X)P(X) from P0(X),…,Pn−1(X)P_0(X), \dots, P_{n-1}(X)P0​(X),…,Pn−1​(X):

P(X):=∑i<nXi⋅Pi(Xn)P(X) := \sum_{i < n} X^i \cdot P_i(X^n) P(X):=i<n∑​Xi⋅Pi​(Xn)
  • decomposen(P):F[X]→F[X]n\mathsf{decompose}_n(P): \mathbb{F}[X] \rightarrow \mathbb{F}[X]^ndecomposen​(P):F[X]→F[X]n: This extracts P0(X),…,Pn−1(X)P_0(X), \dots, P_{n-1}(X)P0​(X),…,Pn−1​(X) from P(X)P(X)P(X).

By definition, we have:

decomposen(combinen(P))=P\mathsf{decompose}_n(\mathsf{combine}_n(\bm{P})) = \bm{P}decomposen​(combinen​(P))=P

By the way, decomposen(P)\mathsf{decompose}_n(P)decomposen​(P) is just introduced, but not actually used in this protocol!

Finding S\bm{S}S from xxx

Next, we define a function to derive the set of opening points S\bm{S}S from xxx:

  • rootsn(x):F→Fn\mathsf{roots}_n(x): \mathbb{F} \to \mathbb{F}^nrootsn​(x):F→Fn: This determines the point set S\bm{S}S:

S:=(zωi)i<n\bm{S} := (z\omega^i)_{i < n}S:=(zωi)i<n​

where z∈Fz \in \mathbb{F}z∈F satisfies:

  • zn=xz^n = xzn=x

  • zi≠xz^i \neq xzi=x for i<ni < ni<n

nnn must be a divisor of p−1p - 1p−1, and ω\omegaω is the nnn-th root of unity.

For example, if n=4n = 4n=4, meaning P={P0(X),P1(X),P2(X),P3(X)}\bm{P} = \{P_0(X), P_1(X), P_2(X), P_3(X)\}P={P0​(X),P1​(X),P2​(X),P3​(X)}, and we want to open at xxx, we construct:

P(X)=P0(X4)+X⋅P1(X4)+X2⋅P2(X4)+X3⋅P3(X4)P(X) = P_0(X^4) + X \cdot P_1(X^4) + X^2 \cdot P_2(X^4) + X^3 \cdot P_3(X^4) P(X)=P0​(X4)+X⋅P1​(X4)+X2⋅P2​(X4)+X3⋅P3​(X4)

The corresponding root set is:

S={z,zω,−z,−zω}\bm{S} = \{z, z\omega, -z, -z\omega \}S={z,zω,−z,−zω}

This is because ω2=−1\omega^2 = -1ω2=−1 since ω4=1\omega^4 = 1ω4=1.

Opening at S\bm{S}S gives:

P(z)=P0(x)+z⋅P1(x)+z2⋅P2(x)+z3⋅P3(x)P(zω)=P0(x)+zω⋅P1(x)−z2⋅P2(x)−z3ω⋅P3(x)P(−z)=P0(x)−z⋅P1(x)+z2⋅P2(x)−z3⋅P3(x)P(−zω)=P0(x)−zω⋅P1(x)−z2⋅P2(x)+z3ω⋅P3(x)P(z) = P_0(x) + z \cdot P_1(x) + z^2 \cdot P_2(x) + z^3 \cdot P_3(x) \\P(z\omega) = P_0(x) + z\omega \cdot P_1(x) - z^2 \cdot P_2(x) - z^3\omega \cdot P_3(x) \\P(-z) = P_0(x) - z \cdot P_1(x) + z^2 \cdot P_2(x) - z^3 \cdot P_3(x) \\P(-z\omega) = P_0(x) - z\omega \cdot P_1(x) - z^2 \cdot P_2(x) + z^3\omega \cdot P_3(x) \\P(z)=P0​(x)+z⋅P1​(x)+z2⋅P2​(x)+z3⋅P3​(x)P(zω)=P0​(x)+zω⋅P1​(x)−z2⋅P2​(x)−z3ω⋅P3​(x)P(−z)=P0​(x)−z⋅P1​(x)+z2⋅P2​(x)−z3⋅P3​(x)P(−zω)=P0​(x)−zω⋅P1​(x)−z2⋅P2​(x)+z3ω⋅P3​(x)

Remember that x=z4x = z^4x=z4 by definition!

By computing:

P0(x)=P(z)+P(zω)+P(−z)+P(−zω)4P1(x)=P(z)+P(zω)−P(−z)−P(−zω)4zP2(x)=P(z)−P(zω)+P(−z)−P(−zω)4z2P3(x)=P(z)−P(zω)−P(−z)+P(−zω)4z3P_0(x) = \frac{P(z) + P(z\omega) + P(-z) + P(-z\omega)}{4} \\ P_1(x) = \frac{P(z) + P(z\omega) - P(-z) - P(-z\omega)}{4z} \\ P_2(x) = \frac{P(z) - P(z\omega) + P(-z) - P(-z\omega)}{4z^2} \\ P_3(x) = \frac{P(z) - P(z\omega) - P(-z) + P(-z\omega)}{4z^3} \\ P0​(x)=4P(z)+P(zω)+P(−z)+P(−zω)​P1​(x)=4zP(z)+P(zω)−P(−z)−P(−zω)​P2​(x)=4z2P(z)−P(zω)+P(−z)−P(−zω)​P3​(x)=4z3P(z)−P(zω)−P(−z)+P(−zω)​

we can recover P0(x),P1(x),P2(x),P3(x)P_0(x), P_1(x), P_2(x), P_3(x)P0​(x),P1​(x),P2​(x),P3​(x).

Opening Multiple Polynomials at Multiple Points

Consider the same example from SHPlonk:

  • P0(X)P_0(X)P0​(X) is opened at x0x_0x0​ with value y0y_0y0​.

  • P1(X)P_1(X)P1​(X) is opened at x0,x1x_0, x_1x0​,x1​ with values y1,y2y_1, y_2y1​,y2​.

  • P2(X)P_2(X)P2​(X) is opened at x0,x1x_0, x_1x0​,x1​ with values y3,y4y_3, y_4y3​,y4​.

Let P={P0,P1,P2}\bm{P} = \{P_0, P_1, P_2\}P={P0​,P1​,P2​}, then we compute P(X)=combine4(P)P(X) = \mathsf{combine}_4(\bm{P})P(X)=combine4​(P), determine S0=roots4(x0)\bm{S}_0 = \mathsf{roots}_4(x_0)S0​=roots4​(x0​) and S1=roots4(x1)\bm{S}_1 = \mathsf{roots}_4(x_1)S1​=roots4​(x1​), and perform a batch opening with S0∪S1S_0 \cup S_1S0​∪S1​.

Let's set the maximum allowable number of polynomials as AAA. Then, if there are n<An < An<A polynomials of degree ddd, and each polynomial is opened at ttt points, the computational costs are as follows:

  • The number of opening sets sss: 1≤s≤n1 \le s \le n1≤s≤n

  • srs\mathsf{srs}srs size: A⋅(d+1)G1,2G2A \cdot (d + 1) \mathbb{G}_1, 2\mathbb{G}_2A⋅(d+1)G1​,2G2​

  • Prover work: O(d)G1,O(s⋅dlog⁡d)FO(d)\mathbb{G}_1, O(s \cdot d \log d) \mathbb{F}O(d)G1​,O(s⋅dlogd)F

  • Proof length: 2G12\mathbb{G}_12G1​

  • Verifier work: O(1)G1,O(n)F,2PO(1)\mathbb{G}_1, O(n)\mathbb{F}, 2\mathsf{P}O(1)G1​,O(n)F,2P

Here, Gi\mathbb{G}_iGi​ represents scalar multiplication in Gi\mathbb{G}_iGi​​, F\mathbb{F}F represents addition or multiplication in F\mathbb{F}F, and P\mathsf{P}P denotes a pairing operation.

Conclusion

TODO(chokobole): compare the prover performance between groth16 and fflonk.

References

Fflonk further optimizes batch opening protocols using a trick inspired by FFT, (that's why the name starts with ff, which denotes "fast fourier") reducing verifier work while maintaining prover efficiency and proof size. This makes it particularly well-suited for large-scale applications where minimizing verifier overhead is critical. In , it says verifying groth16 and fflonk proofs costs are almost identical.

SHPlonk
https://ethresear.ch/t/on-the-gas-efficiency-of-the-whir-polynomial-commitment-scheme/21301
https://eprint.iacr.org/2021/1167
https://ethresear.ch/t/on-the-gas-efficiency-of-the-whir-polynomial-commitment-scheme/21301