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
  • Opening Multiple Polynomials at a Single Point
  • Opening a Single Polynomial at Multiple Points
  • Opening Multiple Polynomials at Multiple Points
  • Protocol Explanation
  • Version 1
  • Version 2
  • Conclusion
  • References
Export as PDF
  1. Primitives
  2. Commitment Scheme

SHPlonk

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

PreviousFflonkNextZeromorph

Last updated 2 months ago

Introduction

The KZG commitment was introduced in . The time required for commitment is proportional to the degree of the polynomial, and the commitment consists of a single G1\mathbb{G}_1G1​ element, which is C=[P(s)]1C = [P(s)]_1C=[P(s)]1​ for given P(X)P(X) P(X).

The opening proof WWW for a point xxx is defined as:

W=[P(s)−ys−x]1W = \left[\frac{P(s) - y}{s - x} \right]_1W=[s−xP(s)−y​]1​

Verification is performed using the following equation:

e(W,[s]2−[x]2)⋅e(C−[y]1,[1]2)=?1e(W, [s]_2 -[x]_2) \cdot e(C - [y]_1,[1]_2) \stackrel{?}= 1e(W,[s]2​−[x]2​)⋅e(C−[y]1​,[1]2​)=?1

However, when proving over AIR, multiple polynomials need to be opened at xxx and ω⋅x\omega \cdot xω⋅x. In PLONK-based schemes that support custom gates, such as Halo2, polynomials must be opened at various opening points in different combinations. One of the efficient methods for proving in batch settings is SHPlonk, which was introduced in .

Background

We'll now see how opens multiple polynomials at multiple points. Let's start with simple cases.

Opening Multiple Polynomials at a Single Point

Suppose two polynomials, P0(X)P_0(X)P0​(X) and P1(X)P_1(X)P1​(X), are opened at xxx with corresponding values y0y_0y0​ and y1y_1y1​.

  1. The verifier provides α←F\alpha \leftarrow \mathbb{F}α←F to the prover.

  2. The prover generates the following opening proof WWW:

W=[P(s)−ys−x]1W = \left[ \frac{P(s) - y}{s- x} \right]_1W=[s−xP(s)−y​]1​

Where P(X):=P0(X)+α⋅P1(X)P(X) := P_0(X) + \alpha \cdot P_1(X)P(X):=P0​(X)+α⋅P1​(X) and y:=y0+α⋅y1y := y_0 + \alpha \cdot y_1y:=y0​+α⋅y1​.

Verification is performed using the following equation:

e(W,[s]2−[x]2)⋅e(C−[y]1,[−1]2)=?1e(W, [s]_2 - [x]_2) \cdot e(C- [y]_1, [-1]_2)\stackrel{?}=1e(W,[s]2​−[x]2​)⋅e(C−[y]1​,[−1]2​)=?1

Where C:=C0+α⋅C1C := C_0 + \alpha \cdot C_1C:=C0​+α⋅C1​ and C0,C1C_0, C_1C0​,C1​ are commitments of P0(X),P1(X)P_0(X), P_1(X)P0​(X),P1​(X) respectively.

This approach is almost identical to opening a single polynomial at a single point, with the only difference being the random linear combination applied to the polynomials before constructing the proof.

Opening a Single Polynomial at Multiple Points

Suppose a polynomial P(X)P(X)P(X) is opened at two points, x0x_0x0​ and x1x_1x1​, with corresponding values y0y_0y0​ and y1y_1y1​.

The prover generates the following opening proof WWW:

W=[P(s)−r(s)(s−x0)(s−x1)]1W = \left[ \frac{P(s) - r(s)}{(s- x_0)(s - x_1)} \right]_1W=[(s−x0​)(s−x1​)P(s)−r(s)​]1​

Where r(X)r(X)r(X) is defined as:

r(X):={P(x0) if X=x0P(x1) if X=x1r(X) := \begin{cases} P(x_0) & \text{ if } X = x_0 \\ P(x_1) & \text{ if } X = x_1 \end{cases}r(X):={P(x0​)P(x1​)​ if X=x0​ if X=x1​​

Verification is performed using the following equation:

e(W,[(s−x0)(s−x1)]2)⋅e(C−[r(s)]1,[−1]2)=?1e(W, [(s- x_0)(s - x_1)]_2) \cdot e(C - [r(s)]_1, [-1]_2) \stackrel{?}= 1e(W,[(s−x0​)(s−x1​)]2​)⋅e(C−[r(s)]1​,[−1]2​)=?1

Where CCC is the commitment of P(X)P(X)P(X).

There are two key issues with this naive approach:

  1. Increasing G2\mathbb{G}_2G2​ ​ parameters: As the number of opening points increases, the required G2\mathbb{G}_2G2​ parameters also increase. For instance, in this case, [s2]2[s^2]_2[s2]2​ is required.

  2. Expensive group operation in G2\mathbb{G}_2G2​: Operations in G2\mathbb{G}_2G2​ are computationally expensive, leading to higher gas consumption in on-chain, and inefficient in recursive proof generation.

To solve these issues, we modify the protocol as follows:

The prover generates 2 opening proofs, W0W_0W0​ and W1W_1W1​:

W0=[Q0(s)s−x0],W1=[Q1(s)s−x1]W_0 = \left[ \frac{Q_0(s)}{s - x_0} \right], \quad W_1 = \left[ \frac{Q_1(s)}{s - x_1} \right]W0​=[s−x0​Q0​(s)​],W1​=[s−x1​Q1​(s)​]

Where Q0(X):=P(X)−y0Q_0(X) := P(X) - y_0Q0​(X):=P(X)−y0​ and Q1(X):=P(X)−y1Q_1(X) := P(X) - y_1Q1​(X):=P(X)−y1​.

The verifier uses α←F\alpha \leftarrow \mathbb{F}α←F to verify the following equation:

e([Q0(s)]1+α⋅[Q1(s)]1+x0⋅W0+α⋅x1⋅W1,[1]2)⋅e(−W0−α⋅W1,[s]2)=?1e([Q_0(s)]_1 + \alpha \cdot [Q_1(s)]_1 + x_0 \cdot W_0 + \alpha \cdot x_1 \cdot W_1, [1]_2) \cdot e(-W_0 - \alpha \cdot W_1, [s]_2) \stackrel{?}= 1e([Q0​(s)]1​+α⋅[Q1​(s)]1​+x0​⋅W0​+α⋅x1​⋅W1​,[1]2​)⋅e(−W0​−α⋅W1​,[s]2​)=?1

The verifier can obtain [Q0(s)]1,[Q1(s)]1[Q_0(s)]_1, [Q_1(s)]_1[Q0​(s)]1​,[Q1​(s)]1​ by computing C−[y0]1C - [y_0]_1C−[y0​]1​ and C−[y1]1C - [y_1]_1C−[y1​]1​ respectively.

Proof.

By extracting the exponent components, it can be confirmed that the verification equation holds.

Q0(s)+α⋅Q1(s)+(x0−s)⋅Q0(s)s−x0+α⋅(x1−s)⋅Q1(s)s−x1=Q0(s)+α⋅Q1(s)−Q0(s)−α⋅Q1(s)=0\begin{align*} &Q_0(s) + \alpha \cdot Q_1(s) + (x_0 - s) \cdot \frac{Q_0(s)}{s - x_0} + \alpha \cdot (x_1 - s) \cdot \frac{Q_1(s)}{s - x_1} \\ = &Q_0(s) + \alpha \cdot Q_1(s) - Q_0(s) - \alpha \cdot Q_1(s) \\ = &0 \end{align*}==​Q0​(s)+α⋅Q1​(s)+(x0​−s)⋅s−x0​Q0​(s)​+α⋅(x1​−s)⋅s−x1​Q1​(s)​Q0​(s)+α⋅Q1​(s)−Q0​(s)−α⋅Q1​(s)0​

Now the number of required G2\mathbb{G}_2G2​ parameters is now constant, and the group operations in G2\mathbb{G}_2G2​ are eliminated.

Opening Multiple Polynomials at Multiple Points

  • 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​.

  1. The verifier provides α←F\alpha \leftarrow \mathbb{F}α←F to the prover.

  2. The prover generates 2 opening proofs, W0W_0W0​ and W1W_1W1​:

W0=[Q0(s)s−x0]1,W1=[Q1(s)s−x1]1W_0 = \left[\frac{Q_0(s)}{s - x_0} \right]_1, \quad W_1 = \left[ \frac{Q_1(s)}{s - x_1} \right]_1W0​=[s−x0​Q0​(s)​]1​,W1​=[s−x1​Q1​(s)​]1​

Where Q0(X):=P0(X)−y0+α(P1(X)−y1)+α2(P2(X)−y3)Q_0(X) := P_0(X) - y_0 + \alpha(P_1(X) - y_1) + \alpha^2(P_2(X) - y_3)Q0​(X):=P0​(X)−y0​+α(P1​(X)−y1​)+α2(P2​(X)−y3​) and Q1(X):=P1(X)−y2+α(P2(X)−y4)Q_1(X) := P_1(X) - y_2 + \alpha(P_2(X) - y_4) Q1​(X):=P1​(X)−y2​+α(P2​(X)−y4​).

Verification is performed with β←F\beta \leftarrow \mathbb{F}β←F using the following equation:

e([Q0(s)]1+β⋅[Q1(s)]1+x0⋅W0+β⋅x1⋅W1,[1]2)⋅e(−W0−β⋅W1,[s]2)=?1e([Q_0(s)]_1 + \beta \cdot [Q_1(s)]_1 + x_0 \cdot W_0 + \beta \cdot x_1 \cdot W_1, [1]_2) \cdot e(-W_0 - \beta \cdot W_1, [s]_2) \stackrel{?}= 1e([Q0​(s)]1​+β⋅[Q1​(s)]1​+x0​⋅W0​+β⋅x1​⋅W1​,[1]2​)⋅e(−W0​−β⋅W1​,[s]2​)=?1

The verifier can obtain [Q0(s)]1,[Q1(s)]1[Q_0(s)]_1, [Q_1(s)]_1[Q0​(s)]1​,[Q1​(s)]1​ by computing α(α(C2−[y3]1)+C1−[y1]1)+C0−[y0]1\alpha(\alpha(C_2 - [y_3]_1) + C_1 - [y_1]_1) + C_0 - [y_0]_1α(α(C2​−[y3​]1​)+C1​−[y1​]1​)+C0​−[y0​]1​ and α(C2−[y4]1)+C1−[y2]1\alpha(C_2 - [y_4]_1) + C_1 - [y_2]_1α(C2​−[y4​]1​)+C1​−[y2​]1​ respectively, where C0,C1,C2C_0, C_1, C_2C0​,C1​,C2​ are the commitments of P0(X),P1(X),P2(X)P_0(X), P_1(X), P_2(X)P0​(X),P1​(X),P2​(X).

If there are nnn polynomials of degree ddd, and each polynomial is opened at ttt points, the following holds:

  • srs\mathsf{srs}srs size: (d+1)G1,2G2(d + 1) \mathbb{G}_1, 2\mathbb{G}_2(d+1)G1​,2G2​

    • srs\mathsf{srs}srs stands for "structure reference string".

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

    • To compute each division in Qi(X)X−xi\frac{Q_i(X)}{X - x_i}X−xi​Qi​(X)​, it takes O(dlog⁡d)FO(d \log d) \mathbb{F}O(dlogd)F operations.

    • To compute each proof WiW_iWi​, it takes O(d)G1O(d) \mathbb{G}_1O(d)G1​ operations.

  • Proof length: tG1t\mathbb{G}_1tG1​

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

    • To compute all of [Qi(s)]1[Q_i(s)]_1[Qi​(s)]1​, it takes O(n⋅t)G1O(n \cdot t) \mathbb{G}_1O(n⋅t)G1​ operations.

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.

SHPlonk enables a smaller proof length and faster verifier work for this case.

Protocol Explanation

Version 1

To illustrate this scheme, let's use the same example as before. If we group the opening points, we can form two sets: S0={x0}S_0 = \{x_0\}S0​={x0​} and S1={x0,x1}S_1 = \{x_0, x_1\}S1​={x0​,x1​}. The complete set of opening points is then T={x0,x1}T = \{x_0, x_1\}T={x0​,x1​}.

The zero polynomial ZS(X)Z_{S}(X)ZS​(X) on S={x0,…,xn−1}S = \{x_0, \dots, x_{n-1}\}S={x0​,…,xn−1​} is defined as:

ZS(X):=(X−x0)⋯(X−xn−1)Z_S(X) := (X - x_0) \cdots (X - x_{n-1})ZS​(X):=(X−x0​)⋯(X−xn−1​)

The opening proof WW W is constructed as follows:

  1. The verifier provides α,β←F\alpha, \beta \leftarrow \mathbb{F}α,β←F to the prover.

  2. The prover computes W=[h(s)]1W = [h(s)]_1W=[h(s)]1​ as follows:

h(X):=Q0(X)ZS0(X)+β⋅Q1(X)ZS1(X)h(X) := \frac{Q_0(X)}{Z_{S_0}(X)} + \beta \cdot \frac{Q_1(X)}{Z_{S_1}(X)}h(X):=ZS0​​(X)Q0​(X)​+β⋅ZS1​​(X)Q1​(X)​

Where Q0(X):=P0(X)−y0,Q1(X):=P1(X)−r0(X)+α(P2(X)−r1(X)),r0(X),Q_0(X) := P_0(X) - y_0, Q_1(X) := P_1(X) - r_0(X) + \alpha(P_2(X) - r_1(X)), r_0(X),Q0​(X):=P0​(X)−y0​,Q1​(X):=P1​(X)−r0​(X)+α(P2​(X)−r1​(X)),r0​(X),r0(X)r_0(X)r0​(X) and r1(X)r_1(X)r1​(X) are defined as follows:

r0(X):={P1(x0) if X=x0P1(x1) if X=x1,r1(X):={P2(x0) if X=x0P2(x1) if X=x1r_0(X) := \begin{cases} P_1(x_0) & \text{ if } X = x_0 \\ P_1(x_1) & \text{ if } X = x_1 \end{cases}, \quad r_1(X) := \begin{cases} P_2(x_0) & \text{ if } X = x_0 \\ P_2(x_1) & \text{ if } X = x_1 \end{cases}r0​(X):={P1​(x0​)P1​(x1​)​ if X=x0​ if X=x1​​,r1​(X):={P2​(x0​)P2​(x1​)​ if X=x0​ if X=x1​​

To verify the opening proof WWW, the following steps are performed:

  1. Compute Z0Z_0Z0​ and Z1Z_1Z1​ using Zi:=[ZT∖Si(s)]2Z_i := [Z_{T \setminus S_i}(s)]_2Zi​:=[ZT∖Si​​(s)]2​:

Z0=[s]2−[x1]2,Z1=[1]2Z_0 = [s]_2 - [x_1]_2, \quad Z_1 =[1]_2Z0​=[s]2​−[x1​]2​,Z1​=[1]2​
  1. Verify using the following equation:

e([Q0(s)]1,Z0)⋅e(β⋅[Q1(s)]1,Z1)=?e(W,[ZT(s)]2)e([Q_0(s)]_1, Z_0)\cdot e(\beta \cdot [Q_1(s)]_1, Z_1) \stackrel{?}= e(W, [Z_T(s)]_2)e([Q0​(s)]1​,Z0​)⋅e(β⋅[Q1​(s)]1​,Z1​)=?e(W,[ZT​(s)]2​)

The verifier can obtain [Q0(s)]1,[Q1(s)]1[Q_0(s)]_1, [Q_1(s)]_1[Q0​(s)]1​,[Q1​(s)]1​ by computing C0−[y0]1C_0 - [y_0]_1C0​−[y0​]1​ and α(C2−[r1(s)]1)+C1−[r0(s)]1\alpha(C_2 - [r_1(s)]_1) + C_1 - [r_0(s)]_1α(C2​−[r1​(s)]1​)+C1​−[r0​(s)]1​ respectively, where C0,C1,C2C_0, C_1, C_2C0​,C1​,C2​ are commitments of P0(X),P1(X),P2(X)P_0(X), P_1(X), P_2(X)P0​(X),P1​(X),P2​(X).

Proof.

Extracting the exponent components from the above equation, we obtain:

Q0(s)⋅ZT∖S0(s)+β⋅Q1(s)⋅ZT∖S1(s)=(Q0(s)ZS0(s)+β⋅Q1(s)ZS1(s))⋅ZT(s)=h(s)⋅ZT(s)\begin{align*} &Q_0(s) \cdot Z_{T \setminus S_0}(s) + \beta \cdot Q_1(s) \cdot Z_{T \setminus S_1}(s) \\ =&\left(\frac{Q_0(s)}{Z_{S_0}(s)} + \beta \cdot \frac{Q_1(s)}{Z_{S_1}(s)}\right) \cdot Z_T(s) \\ =&h(s) \cdot Z_T(s) \end{align*}==​Q0​(s)⋅ZT∖S0​​(s)+β⋅Q1​(s)⋅ZT∖S1​​(s)(ZS0​​(s)Q0​(s)​+β⋅ZS1​​(s)Q1​(s)​)⋅ZT​(s)h(s)⋅ZT​(s)​

Thus, the verification equation holds.

If there are nnn 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: (d+1)G1,(t+1)G2(d + 1) \mathbb{G}_1, (t + 1)\mathbb{G}_2(d+1)G1​,(t+1)G2​

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

    • This doesn't account for computation of each ri(X)r_i(X)ri​(X), since they are normally small operations.

    • To compute all of Qi(X)Q_i(X)Qi​(X), it takes O(d⋅n)FO(d \cdot n) \mathbb{F}O(d⋅n)F operations.

    • To compute each Qi(X)ZSi(X)\frac{Q_i(X)}{Z_{S_i}(X)}ZSi​​(X)Qi​(X)​, it takes O(dlog⁡d)FO(d \log d) \mathbb{F}O(dlogd)F operations.

    • To compute a proof WWW, it takes O(d)G1O(d) \mathbb{G}_1O(d)G1​ operations.

  • Proof length: 1G11\mathbb{G}_11G1​

  • Verifier work: O(n)G1,O(s⋅t)G2,(s+1)PO(n ) \mathbb{G}_1, O(s \cdot t) \mathbb{G}_2, (s+1 )\mathsf{P}O(n)G1​,O(s⋅t)G2​,(s+1)P

    • To compute all of [Qi(s)]1[Q_i(s)]_1[Qi​(s)]1​, it takes O(n)G1O(n)\mathbb{G}_1O(n)G1​ operations.

    • To compute [ZT(s)]2[Z_T(s)]_2[ZT​(s)]2​, it takes O(t)G2O(t)\mathbb{G}_2O(t)G2​ operations.

    • To compute each ZiZ_iZi​, it takes O(t)G2O(t)\mathbb{G}_2O(t)G2​ operations.

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.

  1. Prover Complexity: The prover must evaluate the polynomials at every point in TTT, which increases the number of opening points to n⋅tn \cdot tn⋅t.

  2. ZK Proof Size: The ZK proof size increases because it must include all the opened values.

It's important to distinguish between two types of proofs here. The Proof mentioned earlier refers specifically to proving polynomial openings. However, in this context, the ZK Proof not only includes the opening proof but also contains commitments and the opened values themselves.

Version 2

Version 2 addresses the issues from the previous approach by introducing one additional proof.

The opening proofs W,W′W , W'W,W′ are constructed as follows:

  1. The verifier provides α,β←F\alpha, \beta \leftarrow \mathbb{F}α,β←F to the prover.

  2. The prover computes W=[h(s)]1W = [h(s)]_1W=[h(s)]1​ as follows:

h(X):=f(X)ZT(X)h(X) := \frac{f(X)}{Z_T(X)}h(X):=ZT​(X)f(X)​

Where f(X)f(X)f(X) is defined as:

f(X):=ZT∖S0(X)⋅Q0(X)+β⋅ZT∖S1(X)⋅Q1(X)f(X) := Z_{T \setminus S_0}(X) \cdot Q_0(X) + \beta \cdot Z_{T \setminus S_1}(X) \cdot Q_1(X)f(X):=ZT∖S0​​(X)⋅Q0​(X)+β⋅ZT∖S1​​(X)⋅Q1​(X)

where Q0(X):=P0(X)−y0,Q1(X):=P1(X)−r0(X)+α(P2(X)−r1(X)),r0(X),Q_0(X) := P_0(X) - y_0, Q_1(X) := P_1(X) - r_0(X) + \alpha(P_2(X) - r_1(X)), r_0(X),Q0​(X):=P0​(X)−y0​,Q1​(X):=P1​(X)−r0​(X)+α(P2​(X)−r1​(X)),r0​(X),r0(X)r_0(X)r0​(X) and r1(X)r_1(X)r1​(X) are defined as follows:

r0(X):={P1(x0) if X=x0P1(x1) if X=x1,r1(X):={P2(x0) if X=x0P2(x1) if X=x1r_0(X) := \begin{cases} P_1(x_0) & \text{ if } X = x_0 \\ P_1(x_1) & \text{ if } X = x_1 \end{cases}, \quad r_1(X) := \begin{cases} P_2(x_0) & \text{ if } X = x_0 \\ P_2(x_1) & \text{ if } X = x_1 \end{cases}r0​(X):={P1​(x0​)P1​(x1​)​ if X=x0​ if X=x1​​,r1​(X):={P2​(x0​)P2​(x1​)​ if X=x0​ if X=x1​​
  1. The verifier provides z←Fz \leftarrow \mathbb{F}z←F to the prover.

  2. The prover computes W′W'W′ as follows:

W′=[L(s)s−z]1W' = \left[ \frac{L(s)}{s- z} \right]_1W′=[s−zL(s)​]1​

Where L(X)L(X)L(X) is defined as:

L(X):=fz(X)−ZT(z)⋅h(X)L(X) := f_z(X) - Z_T(z) \cdot h(X)L(X):=fz​(X)−ZT​(z)⋅h(X)

Here, fz(X)f_z(X)fz​(X) is defined as:

fz(X):=ZT∖S0(z)(P0(X)−y0)+β⋅ZT∖S1(z)(P1(X)−r0(z)+α(P2(X)−r1(z)))f_z(X) := Z_{T \setminus S_0}(z)(P_0(X) - y_0) + \beta \cdot Z_{T \setminus S_1}(z) (P_1(X) - r_0(z) + \alpha(P_2(X) - r_1(z)))fz​(X):=ZT∖S0​​(z)(P0​(X)−y0​)+β⋅ZT∖S1​​(z)(P1​(X)−r0​(z)+α(P2​(X)−r1​(z)))

The polynomial L(X)L(X)L(X) is crucial in solving the issues from the previous approach. Unlike Qi(X)Q_i(X)Qi​(X), which vanishes at multiple points, this L(X)L(X)L(X) now vanishes at single point at zzz because:

L(z)=f(z)−ZT(z)⋅h(z)=0L(z) = f(z) - Z_T(z) \cdot h(z) = 0L(z)=f(z)−ZT​(z)⋅h(z)=0

To verify the opening proofs, the verifier checks the following equation:

e([fz(s)]1−ZT(z)⋅W,[1]2)=?e(W′,[s]2−[z]2)e([f_z(s)]_1 - Z_T(z) \cdot W, [1]_2) \stackrel{?}= e(W', [s]_2 - [z]_2)e([fz​(s)]1​−ZT​(z)⋅W,[1]2​)=?e(W′,[s]2​−[z]2​)

The verifier can obtain [fz(s)]1[f_z(s)]_1[fz​(s)]1​ as follows:

[fz(s)]1=β⋅ZT∖S1(z)(α(C2−[r1(z)]1)+C1−[r0(z)]1)+ZT∖S0(z)(C0−[y0]1)[f_z(s)]_1 = \beta \cdot Z_{T \setminus S_1}(z) (\alpha(C_2 - [r_1(z)]_1) + C_1 - [r_0(z)]_1) + Z_{T \setminus S_0}(z)(C_0 - [y_0]_1) [fz​(s)]1​=β⋅ZT∖S1​​(z)(α(C2​−[r1​(z)]1​)+C1​−[r0​(z)]1​)+ZT∖S0​​(z)(C0​−[y0​]1​)

Where C0,C1,C2C_0, C_1, C_2C0​,C1​,C2​ are commitments of P0(X),P1(X),P2(X)P_0(X), P_1(X), P_2(X)P0​(X),P1​(X),P2​(X).

Proof.

Extracting the exponent terms from the above equation, we obtain:

fz(s)−ZT(z)⋅h(s)=L(s)=L(s)s−z⋅(s−z)\begin{align*} &f_z(s) - Z_T(z) \cdot h(s) \\ =& L(s) \\ =&\frac{L(s)}{s-z} \cdot (s - z) \end{align*}==​fz​(s)−ZT​(z)⋅h(s)L(s)s−zL(s)​⋅(s−z)​

Thus, the verification equation holds.

If there are nnn polynomials of degree ddd, and each polynomial is opened at most 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: (d+1)G1,2G2(d+1) \mathbb{G}_1, 2\mathbb{G}_2(d+1)G1​,2G2​

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

    • To compute all of Qi(X)Q_i(X)Qi​(X), it takes O(d⋅n)FO(d \cdot n) \mathbb{F}O(d⋅n)F operations.

    • To compute each ZT∖Si⋅Qi(X)Z_{T\setminus S_{i}} \cdot Q_i(X)ZT∖Si​​⋅Qi​(X), it takes O(dlog⁡d)FO(d \log d)\mathbb{F}O(dlogd)F operations.

    • To compute f(X)ZT(X)\frac{f(X)}{Z_T(X)}ZT​(X)f(X)​ and L(X)X−z\frac{L(X)}{X - z}X−zL(X)​, it takes O(dlog⁡d)FO(d \log d) \mathbb{F}O(dlogd)F operations.

    • To compute L(X)L(X)L(X), it takes O(d⋅n)O(d \cdot n)O(d⋅n) operations.

    • To compute a proof W,W′W, W'W,W′, it takes O(d)G1O(d) \mathbb{G}_1O(d)G1​ operations.

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

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

    • To compute all of [f(z)]1[f(z)]_1[f(z)]1​, it takes O(n)G1O(n)\mathbb{G}_1O(n)G1​ operations.

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.

Optimization on Version 2.

When constructing W′W'W′, it can be "normalized", to save one of the scalar multiplications like below.

W′=[L(s)ZT∖S0(z)⋅(s−z)]1W' = \left[ \frac{L(s)}{Z_{T \setminus S_0}(z) \cdot (s- z)} \right]_1W′=[ZT∖S0​​(z)⋅(s−z)L(s)​]1​

Then, the verification logic is changed accordingly:

e([fz(s)ZT∖S0(z)]1−ZT(z)ZT∖S0(z)⋅W,[1]2)=?e(W′,[s]2−[z]2)e([\frac{f_z(s)}{Z_{T \setminus S_0}(z)}]_1 - \frac{Z_T(z)}{Z_{T \setminus S_0}(z)} \cdot W, [1]_2) \stackrel{?}= e(W', [s]_2 - [z]_2)e([ZT∖S0​​(z)fz​(s)​]1​−ZT∖S0​​(z)ZT​(z)​⋅W,[1]2​)=?e(W′,[s]2​−[z]2​)

The verifier can obtain [fz(s)]1ZT∖S0(z)\frac{[f_z(s)]_1}{Z_{T \setminus S_0}(z)}ZT∖S0​​(z)[fz​(s)]1​​ as follows:

[fz(s)]1ZT∖S0(z)=β⋅ZT∖S1(z)ZT∖S0(z)(α(C2−[r1(z)]1)+C1−[r0(z)]1)+(C0−[y0]1)\frac{[f_z(s)]_1}{Z_{T \setminus S_0}(z)} = \beta \cdot \frac{Z_{T \setminus S_1}(z)}{Z_{T \setminus S_0}(z)} (\alpha(C_2 - [r_1(z)]_1) + C_1 - [r_0(z)]_1) +(C_0 - [y_0]_1) ZT∖S0​​(z)[fz​(s)]1​​=β⋅ZT∖S0​​(z)ZT∖S1​​(z)​(α(C2​−[r1​(z)]1​)+C1​−[r0​(z)]1​)+(C0​−[y0​]1​)

Notice that the rightmost part of the equation doesn't have scalar multiplication any more.

Conclusion

By summarizing the key metrics in the following table, we can see that SHPlonk demonstrates superior efficiency compared to GWC19.

SRS size
Prover work
Prover length
Verifier work

GWC19

SHPlonk version 1.

SHPlonk version 2.

SHPlonk offers a more efficient proof system, balancing prover and verifier costs while keeping proof sizes minimal. Depending on the use case, Version 1 is preferable for minimizing proof length, whereas Version 2 provides a more scalable solution with constant G2\mathbb{G}_2G2​ parameters and a fixed number of pairing operations while removing scalar multiplications in G2\mathbb{G}_2G2​.

References

In , a method that combines the previous techniques is proposed. Consider the following scenario:

Now the same issues mentioned in arise again. Since [ZT(s)]2[Z_T(s)]_2[ZT​(s)]2​ is the primary cause of these issues, we need to devise a more efficient approach—one that treats the opening as if it were occurring at a single point rather than ttt points.

During the presentation, asked a great question: "What happens if all polynomials are opened at TTT?" Since this simplifies sss to 1, both prover and verifier work can be reduced. However, there are two main issues:

Written by from

(d+1)G1,2G2(d + 1) \mathbb{G}_1, 2\mathbb{G}_2(d+1)G1​,2G2​
O(d⋅t)G1,O(t⋅dlog⁡d)FO(d \cdot t)\mathbb{G}_1, O(t \cdot d \log d) \mathbb{F}O(d⋅t)G1​,O(t⋅dlogd)F
tG1t\mathbb{G}_1tG1​
O(n⋅t)G1,2PO(n \cdot t) \mathbb{G}_1, 2 \mathsf{P}O(n⋅t)G1​,2P
(d+1)G1,(t+1)G2(d + 1) \mathbb{G}_1,(t + 1)\mathbb{G}_2(d+1)G1​,(t+1)G2​
O(d)G1,O(d⋅n+s⋅dlog⁡d)FO( d )\mathbb{G}_1, O(d \cdot n + s \cdot d \log d) \mathbb{F}O(d)G1​,O(d⋅n+s⋅dlogd)F
1G11\mathbb{G}_11G1​
O(n)G1,O(s⋅t)G2,(s+1)PO(n ) \mathbb{G}_1, O(s \cdot t) \mathbb{G}_2, (s+1) \mathsf{P}O(n)G1​,O(s⋅t)G2​,(s+1)P
(d+1)G1,2G2(d+1) \mathbb{G}_1, 2\mathbb{G}_2(d+1)G1​,2G2​
O(d)G1,O(d⋅n+s⋅dlog⁡d)FO( d )\mathbb{G}_1, O(d \cdot n + s \cdot d \log d) \mathbb{F}O(d)G1​,O(d⋅n+s⋅dlogd)F
2G12\mathbb{G}_12G1​
O(n)G1,O(1)G2,2PO(n ) \mathbb{G}_1, O(1)\mathbb{G}_2, \\2 \mathsf{P}O(n)G1​,O(1)G2​,2P
KZG10
BDFG20
GWC19
GWC19
https://eprint.iacr.org/2020/081.pdf
Opening a Single Polynomial at Multiple Points
BATZORIG ZORIGOO
A41
ryan Kim