PLONK
Last updated
Last updated
The PLONK arithmetization is done by representing the target computation as a circuit with logic gates for addition and multiplication, and converting it into a system of equations where the variables are the values on all the wires.
On the gates and wires, we have two types of constraints:
Gate constraints - equations between wires attached to the same gate, e.g.
Copy constraints - claims about equality of different wires anywhere in the circuit, eg. or . We will need to create a structured system of equations, which will ultimately reduce to a very small number of polynomial equations, to represent both constraints.
In PLONK, each gate equation is of the following form (Note: = left, = right, = output, = multiplication, = constant, and is the left and right input to the gate):
So for an addition gate, we set:
Meanwhile, for a multiplication gate, we set:
As you can probably see, there's nothing so far forcing the output of one gate to be the same as the input of another gate (what we call "copy constraints").
With this, we can check gate constraints.
Let us define to be input and output wires of -th gate (i.e. is the left input, is the right input, is the output). Now we want to make sure the gates are wired correctly. As an example, let's try to check if .
The key idea is we introduce an accumulator of the values and show that even if we switch the value at , the accumulation result is the same.
First, consider a polynomial with the evaluation form:
And a simple accumulator . With this construction, if the values of are ,
Now, if we define another polynomial with the evaluation form: , then for a similarly defined , the value of would be also since . Conversely, if , does it mean that ? Yes. But I think this is not necessarily true for more complex checks.
Now, suppose we want to prove a copy constraint that spans different columns (i.e. ). In this case, we construct . Then, one possible evaluations of the over can be:
With this, it suffices to check if .
NOTE: The actual accumulator polynomial is defined as where and are randomly sampled. TODO: Elaborate on the reasons behind this construction.
Now, if we make these equations for each gate, we have a system of many equations which we can reduce to 1 big polynomial using :
Written by from