Post · 6 min read· pp. 113–116

SUMCHECK Quickie

The SUMCHECK protocol

I won’t delve deeply into its introduction here, but the SUMCHECK protocol (Carsten Lund, Lance Fortnow, Howard J. Karloff, and Noam Nisan. “Algebraic Methods for Interactive Proof Systems”, 1992) serves as a foundation for many “verifiable computation” primitives. If you’re reading this, you likely already know its significance.

Let F\mathbb{F} be a finite field and f(X1,X2,…,Xn)f(X_1, X_2, \ldots, X_n) be a multivariate polynomial of degree dd over F\mathbb{F}. Consider the sum SS defined as:

S=∑x1∈{0,1}∑x2∈{0,1}⋯∑xn∈{0,1}f(x1,x2,…,xn)=∑(x1,x2,…,xn)∈{0,1}nf(x1,x2,…,xn)S = \sum_{x_1\in\{0, 1\}} \sum_{x_2\in\{0, 1\}} \cdots \sum_{x_n\in\{0, 1\}} f(x_1, x_2, \ldots, x_n) = \sum_{(x_1, x_2, \ldots, x_n) \in \{0,1\}^n} f(x_1, x_2, \ldots, x_n)

The SUMCHECK protocol provides an nn round interactive protocol to verify the correctness of SS, using only a single evaluation of ff (i.e. the verifier only has to evaluate f(X)f(X) once, rather than 2n2^n times).

The protocol advances through nn rounds. In each round, the prover sends a univariate polynomial to the verifier. In response, the verifier conducts a check and responds by sending a single field element challenge.

Round 1

The prover computes and shares the univariate polynomial:

f1(X)=∑(x2,…,xn)∈{0,1}n−1f(X,x2,x3,…,xn)f_1(X) = \sum_{(x_2, \ldots, x_n) \in \{0,1\}^{n-1}} f(X, x_2, x_3, \ldots, x_n)

The verifier ensures that the degree of f1f_1 is less than dd, checks if f1(0)+f1(1)=Sf_1(0) + f_1(1) = S, and issues the challenge r1∈Fr_1 \in \mathbb{F}.

Round 2

The prover computes and shares the univariate polynomial:

f2(X)=∑(x3,…,xn)∈{0,1}n−2f(r1,X,x3,x4,…,xn)f_2(X) = \sum_{(x_3, \ldots, x_n) \in \{0,1\}^{n-2}} f(r_1, X, x_3, x_4, \ldots, x_n)

The verifier ensures that the degree of f2f_2 is less than dd, checks if f2(0)+f2(1)=f1(r1)f_2(0) + f_2(1) = f_1(r_1), and issues the challenge r2∈Fr_2 \in \mathbb{F}.

Round ii

The prover computes and shares the univariate polynomial:

fi(X)=∑(xi+1,…,xn)∈{0,1}n−if(r1,…,ri−1,X,xi+1,xi+2,…,xn)f_i(X) = \sum_{(x_{i+1}, \ldots, x_n) \in \{0,1\}^{n-i}} f(r_1, \ldots, r_{i-1}, X, x_{i+1}, x_{i+2}, \ldots, x_n)

The verifier ensures that the degree of fif_i is less than dd, checks if fi(0)+fi(1)=fi−1(ri−1)f_i(0) + f_i(1) = f_{i-1}(r_{i-1}), and issues the challenge ri∈Fr_i \in \mathbb{F}.

Round nn

The prover computes and shares the univariate polynomial:

fn(X)=f(r1,…,rn−1,X)f_n(X) = f(r_1, \ldots, r_{n-1}, X)

The verifier ensures that the degree of fnf_n is less than dd, checks if fn(0)+fn(1)=fn−1(rn−1)f_n(0) + f_n(1) = f_{n-1}(r_{n-1}), and issues the challenge rn∈Fr_n \in \mathbb{F}.

Final check

The verifier evaluates f(r1,…,rn)f(r_1, \ldots, r_n) and confirms that it equals fn(rn)f_n(r_n).

Why does it work

Below, I present an intuitive proof for the efficacy of the SUMCHECK protocol, assuming a large field F\mathbb{F}. For this explanation, the Schwartz-Zippel lemma is essential.

The Schwartz-Zippel Lemma

The Schwartz-Zippel lemma states: For a non-zero multivariate polynomial P(X1,…,Xn)P(X_1, \ldots, X_n) with a total degree of at most dd over the field F\mathbb{F}, when evaluating PP at random points r1,…,rnr_1, \ldots, r_n from F\mathbb{F}, the likelihood of P(r1,…,rn)P(r_1, \ldots, r_n) being zero is less than d∣F∣\frac{d}{\lvert\mathbb{F}\rvert}.

In large fields (like the scalar fields of elliptic curves often, which are cryptographically secure with field sizes around 22562^{256}), this probability is minuscule. This is because a polynomial can only have a limited number of zeros. For a univariate polynomial, this is immediately evident from the “factor theorem”: Every zero of the polynomial corresponds to a linear factor, so a degree dd polynomial can have up to dd zeros.

A common application of the Schwartz-Zippel lemma is comparing two univariate polynomials, f(X)f(X) and g(X)g(X), to determine their identity. By generating a random number r∈Fr \in \mathbb{F} and checking if f(r)=g(r)f(r) = g(r), we can determine if they are the same. This method is correct, but is it also sound? What’s the likelihood of erroneously claiming f(X)f(X) and g(X)g(X) are identical when they aren’t?

Claim: If f(X)≠g(X)f(X) \not= g(X), then the probability of the check being successful is at most d∣F∣\frac{d}{\lvert\mathbb{F}\rvert}.

Proof: Let’s set P(X)=f(X)−g(X)P(X) = f(X) - g(X). Given that f(X)≠g(X)f(X) \not= g(X), P(X)P(X) isn’t the zero polynomial. As per Schwartz-Zippel, the chance of P(r)=f(r)−g(r)=0P(r) = f(r) - g(r) = 0 is at most d∣F∣\frac{d}{\lvert\mathbb{F}\rvert}.

A succinct takeaway from Schwartz-Zippel is: Over large fields, two “low-degree” polynomials are either identical or different almost everywhere.

SUMCHECK protocol proof

The SUMCHECK protocol harnesses this property to convert a sum with a potentially large number of terms into a singular evaluation. Let’s see why it works, by trying to create a prover that attempts to cheat the protocol, attempting to prove a sum S~≠S\tilde S \not= S.

Round 1

The prover needs to send a polynomial f~1(X)\tilde f_1(X) with the property f~1(0)+f~1(1)=S~\tilde f_1(0) + \tilde f_1(1) = \tilde S. Any other choice would make the first check fail immediately, so there would be no point.

Since S~≠S\tilde S \not= S, the prover cannot send the honest polynomial f1(X)f_1(X). Recall that this means that the polynomial they will be sending is different almost everywhere from f1(X)f_1(X); more precisely, it is the same as f1f_1 on at most dd points.

The verifier then sends the challenge r1r_1.

Round 2

In round 2, the prover needs to send a polynomial f~2(X)\tilde f_2(X) with the property that f~2(0)+f~2(1)=f~1(r1)\tilde f_2(0) + \tilde f_2(1) = \tilde f_1(r_1).

Now there are two possibilities:

  • f~1(r1)=f1(r1)\tilde f_1(r_1)= f_1(r_1). In this case the prover has hit the jackpot: He can simply send f2(X)f_2(X) (the “honest” answer) and continue the protocol honestly to the end. He will succeed at cheating. However, the probability for this happening is only d∣F∣\frac{d}{\lvert\mathbb{F}\rvert}.
  • f~1(r1)≠f1(r1)\tilde f_1(r_1) \not= f_1(r_1) (which is overwhelmingly likely). In this case, the prover is in the same situation as before: He cannot send the honest f2(X)f_2(X), but only a malicious f~2(X)\tilde f_2(X) with f~2(0)+f~2(1)=f~1(r1)\tilde f_2(0) + \tilde f_2(1) = \tilde f_1(r_1), which can coincide with the honest answer on at most dd points.

This repeats every round:

Round ii

In round ii, the prover needs to send a polynomial f~i(X)\tilde f_i(X) with the property that f~i(0)+f~i(1)=f~i−1(ri−1)\tilde f_i(0) + \tilde f_i(1) = \tilde f_{i-1}(r_{i-1}).

Again, two possibilities:

  • f~i−1(ri−1)=fi−1(ri−1)\tilde f_{i-1}(r_{i-1}) = f_{i-1}(r_{i-1}). Prover wins (probability of this happening d∣F∣\frac{d}{\lvert\mathbb{F}\rvert}).
  • f~i−1(ri−1)≠fi−1(ri−1)\tilde f_{i-1}(r_{i-1}) \not= f_{i-1}(r_{i-1}). Prover needs to send f~i(X)\tilde f_i(X) with f~i(0)+f~i(1)=f~i−1(ri−1)\tilde f_i(0) + \tilde f_i(1) = \tilde f_{i-1}(r_{i-1})

Final check

Finally, in the last round, the verifier checks if f(r1,…,rn)=fn(rn)f(r_1, \ldots, r_n)=f_n(r_n). Assuming the prover didn’t “win” in one of the rounds before, he sends a malicious f~n(X)\tilde f_n(X) which coincides with the honest fn(rn)f_n(r_n) on at most dd points, so the probability that the final check will pass is d∣F∣\frac{d}{\lvert\mathbb{F}\rvert}.

As you can see from the above analysis, the prover has a small probability of “winning” and cheating the verifier in each round: If his polynomial happens to have the same evaluation on the challenge field element as the honest version, the prover can continue the protocol like an honest prover and the verification will succeed.

However, assuming that the field F\mathbb{F} is large, the probability for this is small. Since there are nn rounds, at best, the prover can succeed with probability nd∣F∣\frac{nd}{\lvert\mathbb{F}\rvert}.