In this lecture we are going to construct a poly-IOP for circuit satisfiability. C is an arithmetic circuit with size S. The prover wants to prove that it knows the solution w to C(w)=y.
First, we label every gate of C with a bit string of length logS. Thus the computation of C(w)=y can be expressed in a form of function T:{0,1}logS↦F, which maps the label of some gate to the output of the gate with its output (notice that T(root)=y). Let h:FlogS↦F be the unique multilinear extension of T, satisfying h(x)=T(x) for all x∈{0,1}logS (the uniqueness is trivial by dynamic programming).
Why shall we extend the function T to a multilinear polynomial h? The necessity is shown in the part of the sum-check protocol.
Here V should have verified the h and T are the same on {0,1}logS. However V only has the commitment of h, so V verifies this by another approach shown below.
We use labels to denote gates, and define the polynomial gh:F3logS↦F as follows:
gh(a,b,c)=⎩⎨⎧h(a)+h(b)−h(c),h(a)h(b)−h(c),0,if c is an add gate with input a,b,if c is an mult gate with input a,b,otherwise.
which satisfies:
T is a correct assignment ⟺∀(a,b,c)∈{0,1}3logS,gh(a,b,c)=0(in F).
We shall modify a little in gh: we embed the result gh(a,b,c) into Z. So the condition above is equivalent to ∑x∈{0,1}3logSg~h(x)=0 where g~h:F3logS↦Z has the same values as gh on all inputs. Then P and V interact to let V believe that the sum is 0. If the sum is 0, V believes that P knows the correct T.
Here comes the usage of the sum-check protocol.
Sum-Check Protocol
The goal of the protocol is to check the answer C provided by prover satisfies:
C=x∈{0,1}n∑g(x)
where g is an n-variate polynomial over the field F and the sum is computed in Z (i.e. add them up without taking the modulo).
In setup phase, P sends the commitment of g to V. Then they interact for n rounds, and in the end V checks the final claim by querying the oracle of g for one time at a random point.
start:round 1:round 2:round n:Prover “I know s0=x∈{0,1}n∑g(x)” “Please verify the last step to compute s0”“I will proof s1(r1)=x∈{0,1}n−1∑g(r1,x), please verify...” “I will proof sn−1(rn−1)=x∈{0,1}∑g(r1,…,rn−1,x), please verify...” s0s1(X1)r1s2(X2)...sn(Xn)Verifier verify s1(0)+s1(1)=s0 and the next goal is to verify s1(X1)=x∈{0,1}n−1∑g(X1,x)“If indeed, then for most r∈F,s1(r)=x∈{0,1}n−1∑g(r,x). So I send a random r1.”... verify sn(0)+sn(1)=sn−1(rn−1) and the next goal is to verify sn(Xn)=g(r1,…,rn−1,Xn)rn$F, obtaining sn(rn). Then query the oracle of g at (ri)i=1n. Accept iff g(r1,…,rn)=sn(rn).
The probability that a cheating prover can make the verifier accept a false claim is at most ∣F∣ndeg(g) (by Schwartz-Zippel lemma, deg is the maximum degree in total, regardless of different variables). So we can make the soundness error negligible by choosing a large enough field.
Note that every polynomial from P is sent in its coefficients. Let d=deg(g) and it takes Tg time to verify/evaluate any g(x), we have
TV=O(nd+Tg),TP=O(2ndTg)
and the proof length is O(nd) .
For dense polynomial g , the time to evaluate its multilinear extension g~ on point x is at most O(2n) . Thus our prover has quadratic time. The [Libra] puts forwards a linear time sum-check prover.
This sum-check protocol is also used in the proof that IP=PSPACE. Define the decisional counting problem of 3CNF as:
so by translating the boolean formula into a multilinear polynomial, with the sum-check protocol we have (#SAT)D∈IP.
Suppose we have a TQBF formula ψ=∀x1∃x2…Qxn.φ(x1,x2,…,xn) , if we directly make ∀ into multiplication and ∃ into addition, the degree will skyrocket. Define for a p∈F[X1,…,Xn],
In analogy to the sum-check protocol, we can also define Xip:=pi←0+pi←1∈F[X1…Xi−1,Xi+1,…,Xn].
The idea is to linearize the polynomial after each multiplication. So the formula is described by the polynomial
A1L1E2L1L2A3L1L2L3…QnL1L2…Lnpφ=1
then the prover and verifier go through a O(n2) interaction to establish the protocol. Thus TQBF∈IP and IP=PSPACE.
PLONK IOP
Based on the lecture 4, we can encode a circuit problem into a polynomial. The sum-check protocol uses multi-variable polynomials with a large proof size (linear to n∼log∣C∣ even if we send commitments of polynomials instead of coefficients). PLONK is also used for circuit SAT with a different encoding, which uses univariate polynomials and has a proof size independent of n.
Small gadgets to build PLONK IOP
Let Ω=⟨ω⟩⊂Fp be a multiplicative subgroup of size k∣φ(p). And we want to provide protocols to prove that a committed polynomial f has some properties on Ω. The properties of given f,g∈Fp[X] include:
Zeroness: f(x)=0 for all x∈Ω
Sum/Product over Ω: ∑x∈Ω(f(x)−g(x))=0 or ∏x∈Ωg(x)f(x)=1
Permutation: (f(ωi))i=0k−1 is a permutation of (g(ωi))i=0k−1 . Warning: it is not enough to check ∏x∈Ωg(x)f(x)=1 ! The soundness relies on the random challenge by the verifier.
Prescribed permutation: f(y)=g(W(y)) for some known permutation W:Ω→Ω
Encoding a circuit into a polynomial
We again take C(x,w) as the circuit satisfiability problem. Let d=3∣C∣+∣x∣+∣w∣, and label each gate with a integer. And we have the d-th root ω, which satisfies ωd=1.
Setup phase outputs polynomial S and permutation W. The prover wants to prove that it knows w such that C(x,w)=0, so it interpolates a polynomial T∈Fp≤d[X] such that
T(ω−j)= the value of the j-th input
T(ω3i),T(ω3i+1),T(ω3i+2) are the left-input/right-input/output of the i-th gate, i=0,1,…,∣C∣−1
using FFT in time O(dlogd).
Then the prover proves the following:
The inputs are correct: T(ω−j)=xj for j=0,1,…,∣x∣−1
The math operations are correct: Use a public S(ω3i)=1 iff i-th gate is multiplicative; then, prove for all y∈{ω3i:i<∣C∣},
S(y)⋅T(y)⋅T(yω)+(1−S(y))⋅(T(y)+T(yω))−T(yω2)=0.
Wiring is correct: Use a public W to rotate the wires that share the same value; then, prove T(y)=T(W(y)) for all y∈{ωi:i<d}