Skip to content

Domains

Note that so far we have exploited a convenient structure to verify the correctness of a computation: that of evaluating polynomials on a set of points (or indexes) I and checking constraints by means of quotient polynomials. This way we could almost bring the computational time of the verifier to a constant. But there is a catch: computing the vanishing polynomials Z and Z1 as the multiplication of (xi) monomials, although not a very expensive operation is still dependent on the number of rows of the circuit (which corresponds to the maximum polynomial degree d). Also, the way we check constraints f1 and f2, by comparing values in a given row with the next row, and by considering a different index set I=I{3,4} is not very general. What if we want to evaluate a circuit where connections between gates are different, do we have to define a new polynomial for each constraint by hand and carefully think about which domain to evaluate?

To address this issues, and to improve efficiency even more, let us introduce a different type of indexing: using a multiplicative subgroup (also referred to commonly as a domain). A particularly interesting set of domains are the ones with size n=2k. Mathematically we want to find a set of points ΩFp such that:

Ω={ω,ω2,,ω2k1,1}

for some generator ωFp. This set will replace our previous set of indexes I. One immediate advantage of this choice is that computing the vanishing polynomial for the domain can be done in constant time, because Z=xn1, and we no longer need to multiply each monomial (xi) as we did with the additive indexes. This follows immediately from the definition of Ω given that each element is a so-called "n-root of unity", a field element of order n: for every ωiΩ, it holds (ωi)n=(ωn)i=1i=1.

Exercise 11

Find a generator ω of a domain of order 4 using the following algorithm. Consider r=(p1)/4. Find the smallest hFp such that ω=hr has multiplicative order 4. In other words, ω4=1 and ωi1 for i{1,2,3,4}.

python
n = pow(2,2)

#Solve here!
r = 
h = 
ω =

If computed correctly you should obtain:

ω=21888242871839275217838484774961031246007050428528088939761107053157389710902

Note that a further interesting property of working with multiplicative indexes is that they "wrap around", that is, whenever we go beyond the order of the multiplicative group, we cycle back to the beginning of the group: ω0=ωn=1. We will benefit from this property in the next section, were we generalize wiring constraints.

𝒫𝔩𝔬𝔫𝒦 Tutorial by zkSecurity