Halo2 is a Rust library that enables zk-SNARK protocol. From this article, I'd like to explain how the halo2 works and how we can efficiently apply our proof. The main source of this summary is the halo2 Book and this.
To prove a general arithmetic relation, we first want to represent the relation as a set of polynomials(or a table). To compare, I will explain how the original PLONK does arithmetization briefly.
PLONK
Given a polynomial, for example, , we can split this into a set of equations that contain only one addition or multiplication, which is called a gate. In the example, we may set
Then, express these equations of the form
where are selector polynomials and are witness polynomials. The selectors are chosen by the form of the equation. In the example, the first equation determines and the second determines (here, is a primitive 2nd root of unity). That is,
Then, we can uniquely determine degree 1(the number of gates minus one) polynomials by Lagrange interpolation. As the prover knows the witnesses, the prover can determine with some permutation check technique. In the example, we should provide information that the output of the first gate equals the left input of the second gate. I will explain this in detail later. The point is that the PLONK requires each gate to be the exact form.
PLONKish
The PLONKish arithmetization has a more flexible structure than PLONK. We do not restrict the gate to have only one operation. To express , we may make a first gate to have addition and multiplication both. To visualize we make a table for a circuit, each row corresponds to a gate.
Because we don't fix any exact form, we should specify what the gates represent. For this, we introduce constraint polynomial
Here, each polynomial corresponds to each column, is a rotated polynomial where is a primitive th root of unity in (which exists if the number of rows divides ). The rotated polynomial represents the relatively next row. is called a selector polynomial which enables turn on/off constraint for each row. In the example, we want to turn on the constraint for only the first row.
We want to choose proper and such that the circuit is satisfied only if for each . Such polynomials can be found by Lagrange interpolation. That is, we choose and which interpolates the -th value for each column.
In the next post, I will explain how the proof protocol works.
댓글
댓글 쓰기