The Elegant Foundation: Plonkish Arithmetization
/ 12 min read
This work is supported by a grant from the Mina Foundation
Introduction
One of the biggest drivers of the current ZK revolution is the evolution of arithmetization and constraint systems. This evolution enables more complex computation to be encoded in zero-knowledge. Over the past decade, almost every major leap forward in ZK is directly tracable to advances in arithmetization. One of the biggest jumps forward came from the introduction of the Plonk proof system in 2018, which introduced many novel techniques for build highly efficient ad scalable zkSNARKS. Plonk is the backbone for many modern protocols, specifically for our use case Mina.
1. PLONK-Specific Gate and Constraint Mechanisms
Plonkish arithmetization introduces a significant advancement in representing computational circuits for zero-knowledge proofs. Unlike R1CS, which relies on fixed constraint types, PLONK uses selector polynomials to define customizable gates, providing a flexible and efficient way to encode complex operations tailored to specific computational needs.
Key features of Plonkish arithmetization include:
-
Generalized and Flexible Constraint System: By utilizing selector polynomials, PLONK allows for the creation of customizable gates, enabling a unified approach to representing arbitrary computational circuits within a single, coherent framework.
-
Scalability and Efficiency: Transforming computational constraints into polynomial equations over the Lagrange basis and using the vanishing polynomial leverages efficient algebraic operations and Fast Fourier Transforms (FFTs), enhancing scalability.
-
Succinctness and Universality: PLONK enables the creation of succinct proofs that are independent of circuit size through polynomial commitment schemes and permutation arguments.
General Form
Given two integers , we denote the number of wires with and the number of gates with . We define the constraint system as .
- where are the left, right and output sequences.
- where each can be thought of a selector vector.
A given witness value satisfies if the following equation holds true:
When we instantiate this system for the -gate:
-
Addition Gates: If the th gate is an addition gate we set the following , , , and .
-
Multiplication Gates: And for multiplication we set the following , , , and
-
And we always set
The selector vectors can be confusing the first time you see them, especially if you are coming from pure R1CS. However, they are actually really simple. Just remember that there main function is to enable gates to containt either addition or multiplication. Which makes the entire protocol much more flexible.
2. Plonkish Arithmetization
Selector Vectors and Gate Equations
PLONK uses selector vectors to define gates in the arithmetic circuit:
Each is a vector of length over a finite field , representing the selectors for the left input, right input, output, multiplication term, and constant term, respectively.
The general gate equation is:
- are the witness values (assignments) for the left input, right input, and output wires.
- The selectors determine the operation performed by the gate.
Polynomial Formulation Using Lagrange Basis
To enable efficient computation and proof generation, vectors and operations are represented as polynomials over a finite field.
The Lagrange basis is a set of polynomials used for interpolating a polynomial given its values at distinct points. Given distinct points in a field , the Lagrange basis polynomials are constructed such that each satisfies , where is the Kronecker delta function.
Definition and Properties
Each lagrange basis polynomial is defined as:
Interpolating Vectors into Polynomials
Given a vector , we interpolate it into a polynomial using the Lagrange basis:
Leveraging the Vanishing Polynomial
The vanishing polynomial over is defined as:
This polynomial satisfies for all . When we perform polynomial arithmetic modulo , we are essentially working within the space of polynomials that agree on the evaluations over . This modulus ensures that any polynomial equivalent to modulo will satisfy .
Gate Equation in Polynomial Form
By interpolating the selector vectors and witness vectors into polynomials, the gate equation becomes:
This congruence ensures that the polynomial equation holds at all points in .
3. Interpolation of Rows and Columns in PLONK
Mapping Rows to the Evaluation Domain
In the PLONK protocol, the arithmetic circuit is represented in a tabular form, where each row corresponds to a gate, and the columns represent different wires (inputs and outputs) and selector values (which define the gate operations). To efficiently work with this tabular representation in the polynomial domain, we associate each row with a unique element from a finite field, forming the evaluation domain.
Let:
- be the number of gates (rows) in the circuit.
- be a primitive -th root of unity in the finite field .
- The set represents all the -th roots of unity, forming our evaluation domain.
Each row is associated with the point in . This mapping ensures that every row corresponds to a unique point in the field, allowing us to interpolate the columns into polynomials over .
Interpolating Columns into Polynomials
Each column in the circuit’s table contains values assigned to either the witness wires (, , ) or the selector values (, , , , ). To transform these discrete column values into polynomials, we perform Lagrange interpolation using the evaluation domain .
Constructing Evaluation Forms
For a given column , we create a set of pairs by zipping the evaluation domain with the column values:
Here, is the value from column at row . This set represents the evaluation form of the polynomial we wish to construct.
Lagrange Interpolation
Using the evaluation form, we interpolate a polynomial such that:
This polynomial captures all the values in the column, mapped over the evaluation domain . Since the points in are roots of unity, and the number of points equals the degree of the polynomial, Lagrange interpolation guarantees a unique polynomial of degree less than that fits these points.
Connecting Rows, Columns, and Polynomials
Imagine the circuit’s table as follows:
- Columns: Each vertical column is interpolated into a polynomial.
- Rows: Each horizontal row corresponds to evaluations of these polynomials at .
Row | ||||||||
---|---|---|---|---|---|---|---|---|
0 | ||||||||
1 | ||||||||
By associating each row with a unique point in and interpolating each column into a polynomial, we establish a direct correspondence between the circuit’s tabular representation and its polynomial form.
This connection allows us to:
- Express Gate Constraints: The gate equations can be expressed as polynomial identities that must hold at all points in .
- Apply the Permutation Argument: The permutation polynomials , , and map wire positions in the domain, enforcing copy constraints via polynomial relationships.
- Utilize the Vanishing Polynomial: Working modulo the vanishing polynomial ensures that polynomial equations are considered only at the points in , aligning with the circuit’s rows.
Mathematical Illustration
Lagrange Basis Polynomials
Recall that the Lagrange basis polynomials are defined as:
These polynomials satisfy:
where is the Kronecker delta function.
Interpolating a Column
Given a column of values , we interpolate it into a polynomial using the Lagrange basis:
This polynomial satisfies for all .
Example with Selector Polynomials
Suppose the selector polynomial is associated with the multiplication operation in gates. Given selector values , we interpolate:
This polynomial is then used in the gate equation:
In PLONK arithmetization, each of the selector vectors and witness vectors is interpolated into its own polynomial. Thus, each column in the circuit’s tabular representation corresponds to a polynomial.
Columns as Polynomials
- Selector Polynomials: Each selector vector is interpolated into a selector polynomial .
- Witness Polynomials: Similarly, the witness vectors are interpolated into witness polynomials .
These polynomials are constructed so that at each point in the evaluation domain , the polynomial evaluates to the value in the corresponding row and column of the circuit:
Rows as Evaluation Points
Each row corresponds to an evaluation point in the domain :
- Rows: Represent individual gates or constraints in the circuit.
- Evaluation Points: The points at which the polynomials are evaluated to obtain the values for each row.
When you evaluate all the polynomials at a specific , you retrieve all the values (witnesses, selectors, etc.) for row of the circuit.
Putting It All Together
By mapping columns to polynomials and rows to evaluation points, we can:
-
Express Gate Constraints: By evaluating the gate equations at each , we ensure that the constraints are satisfied at every gate (row) in the circuit.
For example, the general gate equation in polynomial form is:
At each point , this becomes:
-
Enforce Copy Constraints: Through the permutation argument, we ensure that variables shared across different rows have consistent values by comparing polynomial evaluations at specific points.
-
Utilize Polynomial Identities: By working in the polynomial domain, we can perform efficient computations and leverage algebraic techniques to verify the correctness of the circuit globally.
4. Step-by-Step Example
Let’s illustrate the arithmetization process with an example.
Setup
Constraints:
- We have gates.
Witness values:
Selector values:
- (enabling multiplication)
- (moving to the left-hand side)
Our goal is to verify that at each gate.
Step 1: Verify Gate Equations at Evaluation Points
For each gate ( and ), we check:
-
At :
-
At :
The gate equations hold at both points.
Step 2: Construct Lagrange Basis Polynomials
For , with evaluation points and :
Step 3: Interpolate Witness and Selector Polynomials
Witness Polynomials:
Selector Polynomials:
Step 4: Formulate the Polynomial Gate Equation
Substitute the polynomials into the gate equation:
Simplify:
Compute the product :
Compute the left-hand side polynomial:
So, the left-hand side polynomial is:
Step 5: Compute the Vanishing Polynomial
For :
Step 6: Verify the Congruence Modulo
We have:
Since , the left-hand side polynomial is exactly , so the congruence holds.
This confirms that the polynomial gate equation holds modulo the vanishing polynomial.
By correctly formulating the gate equation and including all relevant selector polynomials, the arithmetization process accurately captures the computational constraints. The polynomial congruence modulo the vanishing polynomial ensures that the gate equations hold at all points in .
Conclusion
In this deep dive, we’ve explored the core components of the PLONK proof system used in Mina by examining the Lagrange basis, polynomial representation, and arithmetization process. We discussed how the Lagrange basis allows interpolation of polynomials through given data points, transforming vectors into polynomials.
The arithmetization section provided a mathematical framework for encoding computational constraints into polynomial equations. We examined how selector vectors and unified multiplication/addition gates are used to formulate these constraints, ensuring they hold modulo the vanishing polynomial.
With a solid understanding of these foundational concepts, we are now prepared to explore more advanced components of PLONK and Kimchi, specifically lookups and customizable gates.