Degree Adjustment in SNARKs

On adjusting the degree of SNARK-related polynomials to fit our needs

Table of Contents

Notation

We will denote by F to a finite field and F to its respective multiplicative group. We will also denote as H to a subgroup of F. Finally, we will denote by ZH to the polynomial over F that vanishes on Ha and call it the vanishing polynomial.

Given a polynomial pF[X] and an evaluation domain H, we will denote by p~ to the polynomial resulting from the interpolation of the set of points (h,p(h)), for hH.

Statement

Let d,DN such that D>d and let fF[X]. Let gF[X] be the polynomial defined as: g(X)=f(X)+XDdf(X).

Then, if f~ has degree lower than d then we have that g~ has degree lower than D (Prove it! Hint: Divide f by ZH).

In our context, it is always the case that D is a power of two and d is not. What we intend with this “degree adjustment” is to form a polynomial lower than a power of two from a polynomial for which this is not the case.

One can imagine D=8 and d=5 so that we adjust the degree to the “next” power of two.

To achieve the converse, we need to involve random coefficients α and β and define g(X) in the following way: g(X)=αf(X)+βXDdf(X).

Now, we can claim that f~ has degree lower than d if and only if g~ has degree lower than D.

Example: Randomness is Necessary

Let’s see why the converse is not true in the first definition of g.

Let F=Z97 (notably, 96=253), let ω=8 be a primitive 16-th root of unity and let: H=ω={1,8,64,27,22,79,50,12,96,89,33,70,75,18,47,85} be the subset of F, generated by ω, containing all the 16-th roots of unity. We therefore have that ZH(X)=X161 is the vanishing polynomial on H.

Assume that D=8 and d=5.

Now, let f(X)=ZH(X)+X14X11+X8X5. We therefore have that: f(X)X14X11+X8X5(modZH(X)), so that f(X) behaves identical to X14X11+X8X5 when evaluated on H, implying that the interpolated polynomial f~ will be of degree 14.

In this case, we have that: g(X)= (ZH(X)+X14X11+X8X5)+X3(ZH(X)+X14X11+X8X5)=(X3+1)ZH(X)+X17X5= (X3+X+1)ZH(X)X5+X, so that g behaves identical to X5+X when evaluated on H, implying that the interpolated polynomial g~ is of degree 5.

Hence, g~ is a polynomial of degree 5<D even that f~ is of degree 14>d.

Randomness comes to the rescue!

Say that α=3 and β=13.

In this case we have: g(X)= 3(ZH(X)+X14X11+X8X5)+13X3(ZH(X)+X14X11+X8X5)=(13X3+13X+3)ZH(X)10X14+10X1110X83X5+13X,

As it can be seen, thanks to the random values, now the high-degree terms do not cancel out and we find that g~ is a polynomial of degree 14.

Alternatives

The following alternatives also work! We should assume however that the Prover cannot predict the randomness in advance.

β=α2 (or in general β=f(α))

g(X)=αf(X)+α2XDdf(X). As far as αα2 this alternative will also work and therefore we would save one random value in the process. However, notice that the probability of g~ being a low degree polynomial is of 12/|F|, since both α=0 and α=1 would make it fail.

In general, all α’s that make α=β=f(α) would make it fail.

Only α is used

g(X)=αf(X)+XDdf(X). This should work as far α1. The probability here is of 11/|F|.

Only β is used

g(X)=f(X)+βXDdf(X). This should work as far β1. The probability here is of 11/|F|.

When Both Random Values are Needed?

Say that we have f1,f2F[X] and we define: g(X)=(α1f1(X)+β1XDd1f1(X))+(α2f2(X)+β2XDd2f2(X)). Here we have that g~ is of degree lower than D if and only if the degree of f1~<d1 and the degree of f2~<d2.

When we include in the definition of g more than one f polynomial, then both randomness are necessary to achieve the highest probability.

Conclusion

We arrive to the following conclusions:

  1. If only one f polynomial is included in the definition of g, then simply sample a random value α and define: g(X)=f(X)+αXDdf(X).
  2. If more than one f polynomial is needed, then sample two random values αi,βi per f polynomial and define: g(X)=i=1k(αifi(X)+βiXDdifi(X)). In such case, the αi’s and βi’s must be sampled uniformly and independently (of each other) from F. This guarantees that g~ will be of low degree with probability 11/|F|, assuming that the f~’s are of low degree.
Héctor Masip Ardevol
Héctor Masip Ardevol
Research Engineer | PhD Student