In this chapter, we will present the construction of GWC19, i.e., permutations over Lagrange-bases for Oecumenical Noninteractive arguments of Knowledge.
PlonK is a succinct non-interactive zero-knowledge argument (SNARK) system that proves the correct execution of a program, i.e., in this case, an arithmetic circuit with only addition (+) and multiplication (⋅) operations.
As an overview of the construction, we separate it into 2 parts. First, we transform the arithmetic circuit into a set of constraints, called arithmetization and represented under some form of polynomials. Then, by applying some proof technique, it compiles the arithmetization into the proof.
PlonK's arithmetization GWC19 breaks the circuit into a batch of gates, namely, multiplications, additions, multiplications with constants and additions with constants. For each gate, the operation is transformed into a unified form with respective selectors, uniquely determined by the gate without assigned inputs and output. On the other hand, since breaking circuit into gates introduces the inconsistencies among wires, we additionally apply copy constraints to wires to guarantee that such inconsistencies unavailable.
Let F be a finite field. In this section, we describe the arithmetic circuit whose operations are over F.
Let ℓin∈N be the number of input wires of the circuit C. Assume that C has exactly n gates. Each gate takes at most 2 wires as inputs and returns 1 output wires. In particular,
Addition and multiplications gates takes 2 inputs and return 1 output.
Gates of additions and multiplications with constants take 1 input and return 1 output.
Let's take a look at the following example.
Assume that f(u,v)=u2+3uv+v+5. Then the sequence are arranged in the following constraints, wrapped as below.
⎩⎨⎧z1=u⋅uz2=u⋅vz3=z2⋅3z4=z1+z3z5=z4+vz6=z5+5(multiplication),(multiplication),(multiplication with constant),(addition),(addition),(addition with constant).
The input size is ℓin=2 for variables u,v and the output is z6.
To break the circuit into gates with wires separated, namely, no wire involves to 2 or more gates, we use a set of labels I=a1,…,an,b1,…,bn,c1,…,cn to denote the wire label of each gate. Let x:I→F be the function mapping wires to their respective wire values. Hence, x(id) represents the value at wire id∈I For simplicity, we write xid, in place of x(id), for any id∈I.
Specifically, for each i∈1,…,n, we denote by
xci=xai∘xbi to denote the computation where ∘ is either addition or multiplication.
xci=xai∘c to denote the computation where ∘ is either addition or multiplication with constant and c is the constant.
At this point, we may be curious what value xbi takes if ∘ is operation with constant. In fact, in this case xbi can be seen as garbage and can take any value from F. This value will affect neither security nor correctness of the system since the constraints in PlonK's arithmetization guarantee that such a compromise will not happen.
We have f(u,v)=u2+3uv+v+5 and the constraints below.
⎩⎨⎧z1=u⋅uz2=u⋅vz3=z2⋅3z4=z1+z3z5=z4+vz6=z5+5(multiplication),(multiplication),(multiplication with constant),(addition),(addition),(addition with constant).
By breaking circuit, we have the following constraints with respect to the above format, namely, using I={a1,…,a6,b1,…,b6,c1,…,c6}, where n=6, and x:I→F.
⎩⎨⎧xc1=xa1⋅xb1,xc2=xa2⋅xb2,xc3=xa3⋅3,xc4=xa4+xb4,xc5=xa5+xb5,xc6=xa6+5 where ⎩⎨⎧u=xa1=xa2=xb1,v=xb2=xb5,z1=xa4=xc1,z2=xa3=xc2,z3=xb4=xc3,z4=xa5=xc4,z5=xa6=xc5,z6=xc6.
Notice that vb3 and vb6 are dismissed. These values can be any elements from F and do not have any effect to the arithmetization.
For equations in the system guaranteeing the correct computation of the operation, we call them gate constraints.
For equations in the system guaranteeing the equalities, or consistencies, among wires, we call them copy constraints.
We first discuss the transformation of gate constraints into a common unified form with publicly determined selectors in Gate Constraints. Then, we discuss the method for guaranteeing copy constraints in Copy Constraints.
At this stage, for each i∈1,…,n, we need to transform the computation of each gate to a unified form as follows:
qiO⋅xci+qiL⋅xai+qiR⋅xbi+qiM⋅(xai⋅xbi)+qiC=0
where qiO,qiL,qiR,qiM,qiC are selectors uniquely determined by the corresponding gate. In particular,
For addition gate, (qiO,qiL,qiR,qiM,qiC)=(−1,1,1,0,0) since (−1)⋅xci+1⋅xai+1⋅xbi+0⋅(xai⋅xbi)+0=0 is equivalent to xci=xai+xbi.
For multiplication gate, (qiO,qiL,qiR,qiM,qiC)=(−1,0,0,1,0) since (−1)⋅xci+0⋅xai+0⋅xbi+1⋅(xai⋅xbi)+0=0 is equivalent to xci=xai⋅xbi.
For gate of addition with constant, (qiO,qiL,qiR,qiM,qiC)=(−1,1,0,0,c) since (−1)⋅xci+1⋅xai+0⋅xbi+0⋅(xai⋅xbi)+c=0 is equivalent to xci=xai+c.
For gate of multiplication with constant, (qiO,qiL,qiR,qiM,qiC)=(−1,c,0,0,0) since (−1)⋅xci+c⋅xai+0⋅xbi+0⋅(xai⋅xbi)+0=0 is equivalent to xci=xai⋅c.
We now take a look at the example achieved above, i.e.,
Recall that gate constraints do not enforce the equalities of wire values making inconsistencies across the circuit. We generalize copy constraints to the following problem.
Let k∈{1,…,3n} and {i1,…,ik}⊆I satisfying i1<i2<⋯<ik. We would like to show that
xi1=xi2=⋯=xik.
The technique for proving this problem is tricky. We form the pairs of index-value and make them into a sequence
((i1,xi1),(i2,xi2),…,(ik,xik)).
It can be observed that if xi1=xi2=⋯=xik, then, if we rotate the indices among the pairs, we achieve a sequence
((ik,xi1),(i1,xi2),…,(ik−1,xik))
that is permutation of the previous sequence. Notice that we just rotated the indices 1 step to the left and this is the recommended rotation. This fact helps imply the other direction of the fact. For more details, we use the following observation
Observation.((i1,xi1),(i2,xi2),…,(ik,xik)) is a permutation of ((ik,xi1),(i1,xi2),…,(ik−1,xik)) if and only if xi1=xi2=⋯=xik.
Proof. The proof is as follows:
"⇐": This direction is straightforward.
"⇒": Since the two sequences are permutation of each other, for j∈1,…,k we consider (ij,xij) from the first sequence. It can be seen that (ij,xi(jmodk)+1) from the second sequence is the only one that is equal j∈1,…,k since they share the unique prefix ij. Hence, xij=xi(jmodk)+1. Following this argument, we see that xi1=xi2,xi2=xi3,…,xik−1=xik,xik=xi1. Thus, xi1=xi2=⋯=xik.
General paradigm for proving copy constraints of the entire circuit
Recall that x:I→F. We can deterministically determine a partition of I such that
I=j=1⋃ℓin+nIj
where ℓin+n is the number of wires of the original circuits, namely, ℓin input wires and n output wires of all gates. Hence each subset Ij is the set of wire labels whose value are all equal to the same wire value of the original circuit. We hence obtain a rotation of indices for each subset Ij. By unifying all those rotations, we achieve a permutation σ:I→I such that