Skip to content

Partial accumulators

In the following, it will be useful to implement partial accumulators as a function of an upper bound index i, a given column number and its respective polynomial f , the permutation σ and the challenges β and γ.

Exercise 16

Compute accumulator functions for the numerator and the accumulator respectively as:

acc_numerator(i,column,f,σ,β,γ)=j=1i1numerator(j,column,f,σ,β,γ)acc_denominator(i,column,f,σ,β,γ)=j=1i1denominator(j,column,f,σ,β,γ)
python
def acc_numerator(i, column,f,sigma,beta, gamma):
    value = 1 
    #Solve here!
    return value    

def acc_denominator(i, column,f,sigma,beta, gamma):
    value = 1 
    #Solve here!
    return value

If implemented correctly, the following check should pass.

python
N_n = acc_numerator(n+1,1,a,sigma,42,42)*acc_numerator(n+1,2,b,sigma,42,42)*acc_numerator(n+1,3,c,sigma,42,42)
D_n = acc_denominator(n+1,1,a,sigma,42,42)*acc_denominator(n+1,2,b,sigma,42,42)*acc_denominator(n+1,3,c,sigma,42,42)
print("When multiplying z for each column with the corresponding upper and lower bounds one should obtain 1:", N_n//D_n==1)

𝒫𝔩𝔬𝔫𝒦 Tutorial by zkSecurity