Verifiable computing allows a computer to offload the computation of certain functions. For example, running transactions on the Ethereum EVM can be costly. With verifiable computing, one can outsource the computation away from the EVM—generating the proof that transactions were correctly executed elsewhere—leaving only the verification of the proof to the EVM.
A multilinear polynomial is a multivariate polynomial of degree at most one in each variable.
For example, the polynomial 3xy+4y−2z is multilinear, while 3x2+4y−2z is not.
Lemma (Multilinear Extension):
Given a function V:{0,1}n→F, there exists a unique multilinear
polynomial V~(x):Fn→F extending V, i.e.,
V~(x)=V(x) for all x∈{0,1}n. We call V~ the multilinear extension (mle)
of V over F.
The existence of multilinear extension V~ is guaranteed from the following
construction:
The Schwartz-Zippel lemma is a tool commonly used in probabilistic polynomial identity testing.
Suppose we have a polynomial f(x1,...,xn) with a degree of d.
Let’s assume that the field has S elements.
If r1,...,rn are chosen uniformly random and independently from the field F,
the probability that f(r1,...,rn)=0 is ≤Sd.
If S is much larger than d, this probability is very low.
Therefore, if we find f(r1,...,rn)=0, the probability that f is
identically equal to 0 is very high.
For intuition, let’s consider the case where n=1. Suppose we have
f(x)=a0+a1x+...+adxd.
There are at most d different values where f evaluates to 0.
Therefore, the probability f(r1)=0 is smaller than Sd.
Suppose we have two polynomials, f1(x1,...,xn) and
f2(x1,...,xn), with coefficients in the finite field F.
What is the probability that these two polynomials are identical?
This probability is the same as the probability that f1−f2 equals 0, which
is the case we had above.
If it holds f1(r1,...,rn)−f2(r1,...,rn)=0 for a random
r1,...,rn, the probability that f1 and f2 are the same is very high.
Sum-check protocol
Suppose there is a function f(x1,...,xn), and a subject wants to prove that
for some value H.
Let’s refer to this subject as a verifier.
Of course, the verifier could simply compute all the values f(0,0,...,0,0),
f(0,0,...,0,1), f(0,0,...,1,0), f(0,0,...,1,1), ..., f(1,1,...,1,1), and
then compute the sum of these values.
But it turns out this can be done more efficiently. Suppose there is another participant, called a prover, who can assist the verifier in checking the equation above. The prover will do some of the computations, allowing the verifier to quickly verify the statement. However, the protocol must also ensure that the prover has performed the computations correctly.
The prover sends f1 to the verifier. The verifier then checks whether
H=f1(0)+f1(1)
If this condition holds and if the function f1 has been generated correctly, the verifier can be sure
that H=∑(x1,x2,x3)∈{0,1}3f(x1,x2,x3).
And the verifier has performed only minimal computation in the process!
But wait! How can the verifier be certain that the function f1 has been generated correctly?
Yeah, the prover and verifier are not finished yet. The prover still needs to prove that
f1 has been generated correctly.
To do this, the verifier generates the challenge r1 and sends it to the prover (this can be made
non-interactive using the Fiat-Shamir transformation).
The prover then computes the following new univariate polynomial:
But wait again! Isn’t f defined only on the set {0,1}3?
How do we evaluate it at some random value r1?
This is where the multilinear extension comes into play.
We use the multilinear extension of f instead of f. However, I will abuse notation
a bit and simply continue writing f.
When the verifier checks that the equality
f1(r1)=f2(0)+f2(1)
holds, the verifier can be confident that f1 has been generated correctly.
Well, if f2 has been generated correctly.
The prover receives a new challenge r2 from the verifier and computes the following new univariate polynomial:
f3(x3)=f(r1,r2,x3)
The verifier checks whether the following equality holds:
f2(r2)=f3(0)+f3(1)
Finally, the verifier chooses the third challenge r3 and verifies:
f3(r3)=f(r1,r2,r3)
Where is the Schwartz-Zippel lemma used?
Suppose the prover chose a function g≠f3 such that:
f2(r2)=g(0)+g(1)
The prover knows f2(r2), so this is something the prover can compute.
However, will the following equality hold?
g(r3)=f(r1,r2,r3)
According to the Schwartz-Zippel lemma, the probability of this occurring is very low.
If it holds, it implies g=f3.
If we want to compute
V~(0,0,r3), we observe that all terms will be zero except for the first two.
From the first two terms, we get f(0,0,r1)=f(0,0,0)(1−r3)+f(0,0,1)r3.
To compute f(0,1,r1), we similarly use the third and fourth terms ...
Zero-check protocol
What if we want to prove that function f is equal to 0?
That is, we want to show that f(x1,...,xn)=0 for every x∈{0,1}n?