Transaction:

f4f67d253627e33d788c5e7bf66a21c42638e3ee88b29f46e346eade2840a9a9
Status
Failed
Timestamp
1/11/2022, 9:40:55 PM
Result
AssertionError('You have exceeded the maximum write capacity per transaction!',)
Block Number
64065
SubBlock Number
0
Nonce
60
Processor
89f67bb871351a1629d66676e4bd92bbacb23bd0649b890542ef98f1b664a497
Stamps Used
680 ( 52.3 dTAU )
Contract Name
submission
Function Name
submit_contract
Signature
0010c2920b98478a48b3c29a71b7815e3a1cf1b4bc8ad22900838dcf13108983e7607cce6facbac1f438c3746662daf9afe006c4a87cff3fe3f415d084a1a902

Kwargs

code
pseudo_binary_encoding=[0,0,0,1,0,1,0,-1,0,0,1,-1,0,0,1,0,0,1,1,0,-1,0,0,1,0,-1,0,0,0,0,1,1,1,0,0,-1,0,0,1,0,0,0,0,0,-1,0,0,1,1,0,0,-1,0,0,0,1,1,0,-1,0,0,1,0,1,1] curve_order=0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001 p2=0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47 u=0x44e992b44a6909f1 xiToPMinus1Over6=[0x246996f3b4fae7e6a6327cfe12150b8e747992778eeec7e5ca5cf05f80f362ac,0x1284b71c2865a7dfe8b99fdd76e68b605c521e08292f2176d60b35dadcc9e470] xiToPMinus1Over3=[0x16c9e55061ebae204ba4cc8bd75a079432ae2a1d0b7c9dce1665d51c640fcba2,0x2fb347984f7911f74c0bec3cf559b143b78cc310c2c3330c99e39557176f553d] xiToPMinus1Over2=[0x7c03cbcac41049a0704b5a7ec796f2b21807dc98fa25bd282d37f632623b0e3,0x63cf305489af5dcdc5ec698b6e2f9b9dbaae0eda9c95998dc54014671a0135a] xiToPSquaredMinus1Over3=0x30644e72e131a0295e6dd9e7e0acccb0c28f069fbb966e3de4bd44e5607cfd48 xiTo2PSquaredMinus2Over3=0x59e26bcea0d48bacd4f263f1acdb5c4f5763473177fffffe xiToPSquaredMinus1Over6=0x30644e72e131a0295e6dd9e7e0acccb0c28f069fbb966e3de4bd44e5607cfd49 xiTo2PMinus2Over3=[0x2c145edbe7fd8aee9f3a80b03b0b1c923685d2ea1bdec763c13b4711cd2b8126,0x5b54f5e64eea80180f3c0b75a181e84d33365f7be94ec72848a1f55921ea762] twistB=[0x9713b03af0fed4cd2cafadeed8fdf4a74fa084e52d1852e4a2bd0685c315d2,0x2b149d40ceb8aaae81be18991be06ac3b5b4c5e559dbefa33267e6dc24a138e5] curveB=3 def FQ(n:int)->int: n=n%p2 if n<0:n+=p2 return n def fq_inv(a:int,n:int=p2)->int: if a==0:return 0 B,D=1,0;A,C=a%n,n while A>1:E=C//A;F,G=D-B*E,C-A*E;B,A,D,C=F,G,B,A return B%n def fa(self:int,other:int)->int:return FQ(self+other) def fm(self:int,other:int)->int:return FQ(self*other) def fs(self:int,other:int)->int:return FQ(self-other) def fq_eq(self:int,other:int)->bool:return self==other def fq_neg(self:int)->int: A=self;A=-A if A<0:A+=p2 return A def bits_of(k):return[int(A)for A in '{0:b}'.format(k)] def FQ2(coeffs:list)->list:A=coeffs;assert len(A)==2,f"FQ2 must have 2 coefficients but had {len(A)}";return A def FQ6(coeffs:list)->list:A=coeffs;assert len(A)==3 and len(A[0])==2,'FQ6 must have 3 FQ2s';return A def FQ12(coeffs:list)->list:A=coeffs;assert len(A)==2 and len(A[0])==3,'FQ12 must have 2 FQ6s';return A def fq2_one(n:int=0)->list:return[0,1] def fq2_zero(n:int=0)->list:return[0,0] def fq2_is_one(self:list)->bool:return self[0]==0 and self[1]==1 def fq2_is_zero(self:list)->bool:return self[0]==0 and self[1]==0 def fq2_conjugate(self:list)->list:return[fq_neg(self[0]),self[1]] def fq2_neg(self:list)->list:return[fq_neg(self[0]),fq_neg(self[1])] def f2a(self:list,other:list)->list:A=other;return[fa(self[0],A[0]),fa(self[1],A[1])] def f2s(self:list,other:list)->list:A=other;return[fs(self[0],A[0]),fs(self[1],A[1])] def f2m(self:list,other:list)->list:B=other;A=self;C=fm(A[0],B[1]);D=fm(B[0],A[1]);C=fa(C,D);E=fm(A[1],B[1]);D=fm(A[0],B[0]);E=fs(E,D);return[C,E] def f2m_scalar(self:list,other:int)->list:A=other;B=fm(self[0],A);C=fm(self[1],A);return[B,C] def f2m_xi(self:list)->list:C=self;A=fa(C[0],C[0]);A=fa(A,A);A=fa(A,A);A=fa(A,C[0]);A=fa(A,C[1]);B=fa(C[1],C[1]);B=fa(B,B);B=fa(B,B);B=fa(B,C[1]);B=fs(B,C[0]);return[A,B] def fq2_eq(self:list,other:list)->bool:A=other;return self[0]==A[0]and self[1]==A[1] def fq2_square(self:list)->list:A=self;B=fs(A[1],A[0]);C=fa(A[0],A[1]);C=fm(B,C);B=fm(A[0],A[1]);B=fa(B,B);return[B,C] def fq2_invert(self:list)->list:A=self;B=fm(A[0],A[0]);D=fm(A[1],A[1]);B=fa(B,D);C=fq_inv(B);B=fq_neg(A[0]);E=fm(B,C);F=fm(A[1],C);return[E,F] def fq6_one(n:int=0)->list:return[fq2_zero(),fq2_zero(),fq2_one()] def fq6_zero(n:int=0)->list:return[fq2_zero(),fq2_zero(),fq2_zero()] def fq6_is_zero(self:list)->bool:A=self;return fq2_is_zero(A[0])and fq2_is_zero(A[1])and fq2_is_zero(A[2]) def fq6_is_one(self:list)->bool:A=self;return fq2_is_zero(A[0])and fq2_is_zero(A[1])and fq2_is_one(A[2]) def fq6_neg(self:list)->list:A=self;return[fq2_neg(A[0]),fq2_neg(A[1]),fq2_neg(A[2])] def fq6_frobenius(self:list)->list:A=self;B=fq2_conjugate(A[0]);C=fq2_conjugate(A[1]);D=fq2_conjugate(A[2]);B=f2m(B,xiTo2PMinus2Over3);C=f2m(C,xiToPMinus1Over3);return[B,C,D] def fq6_frobenius_p2(self:list)->list:A=self;B=f2m_scalar(A[0],xiTo2PSquaredMinus2Over3);C=f2m_scalar(A[1],xiToPSquaredMinus1Over3);return[B,C,A[2]] def f6a(self:list,other:list)->list:B=other;A=self;return[f2a(A[0],B[0]),f2a(A[1],B[1]),f2a(A[2],B[2])] def f6s(self:list,other:list)->list:B=other;A=self;return[f2s(A[0],B[0]),f2s(A[1],B[1]),f2s(A[2],B[2])] def f6m(self:list,other:list)->list:B=other;A=self;H=f2m(A[2],B[2]);I=f2m(A[1],B[1]);J=f2m(A[0],B[0]);D=f2a(A[0],A[1]);G=f2a(B[0],B[1]);C=f2m(D,G);C=f2s(C,I);C=f2s(C,J);C=f2m_xi(C);C=f2a(C,H);D=f2a(A[1],A[2]);G=f2a(B[1],B[2]);E=f2m(D,G);D=f2m_xi(J);E=f2s(E,H);E=f2s(E,I);E=f2a(E,D);D=f2a(A[0],A[2]);G=f2a(B[0],B[2]);F=f2m(D,G);F=f2s(F,H);F=f2a(F,I);F=f2s(F,J);return[F,E,C] def f6m_scalar(self:list,other:list)->list:B=other;A=self;return[f2m(A[0],B),f2m(A[1],B),f2m(A[2],B)] def f6m_gfp(self:list,other:int)->list:B=other;A=self;return[f2m_scalar(A[0],B),f2m_scalar(A[1],B),f2m_scalar(A[2],B)] def f6m_tau(self:list)->list:A=self;B=f2m_xi(A[0]);C=A[1];return[C,A[2],B] def fq6_square(self:list)->list:B=self;E=fq2_square(B[2]);F=fq2_square(B[1]);G=fq2_square(B[0]);A=f2a(B[0],B[1]);A=fq2_square(A);A=f2s(A,F);A=f2s(A,G);A=f2m_xi(A);A=f2a(A,E);C=f2a(B[1],B[2]);C=fq2_square(C);C=f2s(C,E);C=f2s(C,F);H=f2m_xi(G);C=f2a(C,H);D=f2a(B[0],B[2]);D=fq2_square(D);D=f2s(D,E);D=f2a(D,F);D=f2s(D,G);return[D,C,A] def fq6_invert(self:list)->list:A=self;F=fq2_square(A[0]);G=fq2_square(A[1]);H=fq2_square(A[2]);I=f2m(A[0],A[1]);J=f2m(A[0],A[2]);K=f2m(A[1],A[2]);C=f2s(H,f2m_xi(I));D=f2s(f2m_xi(F),K);E=f2s(G,J);B=f2m_xi(f2m(E,A[1]));B=f2a(B,f2m(C,A[2]));B=f2a(B,f2m_xi(f2m(D,A[0])));B=fq2_invert(B);return[f2m(E,B),f2m(D,B),f2m(C,B)] def fq12_one(n:int=0)->list:return[fq6_zero(),fq6_one()] def fq12_is_one(self:list)->bool:return fq6_is_zero(self[0])and fq6_is_one(self[1]) def fq12_conjugate(self:list)->list:return[fq6_neg(self[0]),self[1]] def fq12_frobenius(self:list)->list:A=fq6_frobenius(self[0]);A=f6m_scalar(A,xiToPMinus1Over6);return[A,fq6_frobenius(self[1])] def fq12_frobenius_p2(self:list)->list:A=fq6_frobenius_p2(self[0]);A=f6m_gfp(A,xiToPSquaredMinus1Over6);return[A,fq6_frobenius_p2(self[1])] def f12a(self:list,other:list)->list:A=other;return[f6a(self[0],A[0]),f6a(self[1],A[1])] def f12s(self:list,other:list)->list:A=other;return[f6s(self[0],A[0]),f6s(self[1],A[1])] def f12m(self:list,other:list)->list:C=other;B=self;D=f6m(B[0],C[1]);A=f6m(B[1],C[0]);D=f6a(D,A);E=f6m(B[1],C[1]);A=f6m(B[0],C[0]);A=f6m_tau(A);return[D,f6a(E,A)] def f12m_scalar(self:list,other:list)->list:A=other;return[f6m(self[0],A),f6m(self[1],A)] def fq12_exp(self:list,other:int)->list: A=other;sum=fq12_one() for C in range(A.bit_length()-1,-1,-1): B=fq12_square(sum) if A>>C&1!=0:sum=f12m(B,self) else:sum=B return sum def fq12_square(self:list)->list:B=self;D=f6m(B[0],B[1]);C=f6m_tau(B[0]);C=f6a(B[1],C);A=f6a(B[0],B[1]);A=f6m(A,C);A=f6s(A,D);C=f6m_tau(D);A=f6s(A,C);return[f6a(D,D),A] def fq12_invert(self:list)->list:B=self;A=fq6_square(B[0]);C=fq6_square(B[1]);A=f6m_tau(A);A=f6s(C,A);C=fq6_invert(A);return f12m_scalar([fq6_neg(B[0]),B[1]],C) def line_function_add(r:list,p:list,q:list,r2:list)->tuple:O=f2m(p[0],r[3]);C=f2a(p[1],r[2]);C=fq2_square(C);C=f2s(C,r2);C=f2s(C,r[3]);C=f2m(C,r[3]);J=f2s(O,r[0]);K=fq2_square(J);H=f2a(K,K);H=f2a(H,H);M=f2m(J,H);E=f2s(C,r[1]);E=f2s(E,r[1]);L=f2m(r[0],H);F=fq2_square(E);F=f2s(F,M);F=f2s(F,f2a(L,L));B=f2a(r[2],J);B=fq2_square(B);B=f2s(B,r[3]);B=f2s(B,K);A=f2s(L,F);A=f2m(A,E);D=f2m(r[1],M);D=f2a(D,D);P=f2s(A,D);N=fq2_square(B);A=f2a(p[1],B);A=fq2_square(A);A=f2s(A,r2);A=f2s(A,N);D=f2m(E,p[0]);D=f2a(D,D);Q=f2s(D,A);I=f2m_scalar(B,q[1]);I=f2a(I,I);G=fq2_neg(E);G=f2m_scalar(G,q[0]);G=f2a(G,G);return Q,G,I,[F,P,B,N] def line_function_double(r:list,q:list)->tuple:E=fq2_square(r[0]);F=fq2_square(r[1]);K=fq2_square(F);A=f2a(r[0],F);A=fq2_square(A);A=f2s(A,E);A=f2s(A,K);A=f2a(A,A);H=f2a(f2a(E,E),E);N=fq2_square(H);C=f2a(K,K);C=f2a(C,C);C=f2a(C,C);O=f2s(N,f2a(A,A));L=f2m(H,f2s(A,O));L=f2s(L,C);B=f2a(r[1],r[2]);B=fq2_square(B);B=f2s(B,F);B=f2s(B,r[3]);G=f2a(r[0],H);G=fq2_square(G);I=f2a(F,F);I=f2a(I,I);G=f2s(G,f2a(E,f2a(N,I)));J=f2m(H,r[3]);J=f2a(J,J);M=fq2_neg(J);M=f2m_scalar(M,q[0]);D=f2m(B,r[3]);D=f2a(D,D);D=f2m_scalar(D,q[1]);P=fq2_square(B);return G,M,D,[O,L,B,P] def line_function_mul(ret:list,a:list,b:list,c:list)->list:C=ret;B=[fq2_zero(),a,b];B=f6m(B,C[0]);E=f6m_scalar(C[1],c);F=f2a(b,c);G=[fq2_zero(),a,F];A=f6a(C[0],C[1]);D=E;A=f6m(A,G);A=f6s(A,B);A=f6s(A,D);B=f6m_tau(B);D=f6a(D,B);return[A,D] def miller(q:list,p:list)->list: A=fq12_one();C=twist_make_affine(q);H=curve_make_affine(p);M=twist_neg(C);B=C;G=fq2_square(C[1]) for I in range(len(pseudo_binary_encoding)-1,0,-1): D,E,F,B=line_function_double(B,H) if I!=len(pseudo_binary_encoding)-1:A=fq12_square(A) A=line_function_mul(A,D,E,F);J=pseudo_binary_encoding[I-1] if J==1:D,E,F,B=line_function_add(B,C,H,G) elif J==-1:D,E,F,B=line_function_add(B,M,H,G) else:continue A=line_function_mul(A,D,E,F) K=[f2m(fq2_conjugate(C[0]),xiToPMinus1Over3),f2m(fq2_conjugate(C[1]),xiToPMinus1Over2),fq2_one(),fq2_one()];L=[f2m_scalar(C[0],xiToPSquaredMinus1Over3),C[1],fq2_one(),fq2_one()];G=fq2_square(K[1]);D,E,F,B=line_function_add(B,K,H,G);A=line_function_mul(A,D,E,F);G=fq2_square(L[1]);D,E,F,B=line_function_add(B,L,H,G);A=line_function_mul(A,D,E,F);return A def final_exponentiation(p:list)->list:A=fq12_conjugate(p);L=fq12_invert(p);A=f12m(A,L);M=fq12_frobenius_p2(A);A=f12m(A,M);N=fq12_frobenius(A);I=fq12_frobenius_p2(A);O=fq12_frobenius(I);D=fq12_exp(A,u);C=fq12_exp(D,u);J=fq12_exp(C,u);E=fq12_frobenius(D);P=fq12_frobenius(C);Q=fq12_frobenius(J);R=fq12_frobenius_p2(C);F=f12m(N,I);F=f12m(F,O);S=fq12_conjugate(A);K=fq12_conjugate(C);E=fq12_conjugate(E);G=f12m(D,P);G=fq12_conjugate(G);H=f12m(J,Q);H=fq12_conjugate(H);B=fq12_square(H);B=f12m(B,G);B=f12m(B,K);A=f12m(E,K);A=f12m(A,B);B=f12m(B,R);A=fq12_square(A);A=f12m(A,B);A=fq12_square(A);B=f12m(A,S);A=f12m(A,F);B=fq12_square(B);B=f12m(B,A);return B def twist_make_affine(c:list)->list: if fq2_is_one(c[2]):return c elif fq2_is_zero(c[2]):return[fq2_zero(),fq2_one(),fq2_zero(),fq2_zero()] else:A=fq2_invert(c[2]);B=fq2_square(A);C=f2m(B,A);return[f2m(c[0],B),f2m(c[1],C),fq2_one(),fq2_one()] def twist_add(a:list,b:list)->list: if twist_is_infinity(a):return b if twist_is_infinity(b):return a D=fq2_square(a[2]);E=fq2_square(b[2]);H=f2m(a[0],E);N=f2m(b[0],D);A=f2m(b[2],E);I=f2m(a[1],A);A=f2m(a[2],D);O=f2m(b[1],A);C=f2s(N,H);P=fq2_eq(C,fq2_zero());A=f2a(C,C);J=fq2_square(A);K=f2m(C,J);A=f2s(O,I);Q=fq2_eq(A,fq2_zero()) if P and Q:return twist_double(a) L=f2a(A,A);F=f2m(H,J);B=fq2_square(L);A=f2a(F,F);G=f2s(B,K);M=f2s(G,A);A=f2s(F,M);B=f2m(I,K);G=f2a(B,B);B=f2m(L,A);R=f2s(B,G);A=f2a(a[2],b[2]);B=fq2_square(A);A=f2s(B,D);B=f2s(A,E);S=f2m(B,C);return[M,R,S] def twist_double(a:list)->list:C=f2m(a[0],a[0]);E=f2m(a[1],a[1]);F=f2m(E,E);A=f2a(a[0],E);B=f2m(A,A);A=f2s(B,C);B=f2s(A,F);G=f2a(B,B);A=f2a(C,C);H=f2a(A,C);K=f2m(H,H);A=f2a(G,G);J=f2s(K,A);D=f2m(a[1],a[2]);D=f2a(D,D);A=f2a(F,F);B=f2a(A,A);A=f2a(B,B);I=f2s(G,J);B=f2m(H,I);I=f2s(B,A);return[J,I,D] def twist_mul(pt:list,k:int)->list: if int(k)==0:return[fq2_one(),fq2_one(),fq2_zero()] A=[[fq2_zero(),fq2_zero(),fq2_zero()],pt] for B in bits_of(k):A[B^1]=twist_add(A[B],A[B^1]);A[B]=twist_double(A[B]) return A[0] def twist_neg(c:list)->list:return[c[0],fq2_neg(c[1]),c[2],fq2_zero()] def twist_is_infinity(c:list)->bool:return fq2_is_zero(c[2]) def twist_is_on_curve(c:list)->bool: c=twist_make_affine(c) if twist_is_infinity(c):return True A=fq2_square(c[1]);B=fq2_square(c[0]);B=f2m(B,c[0]);A=f2s(A,B);A=f2s(A,twistB);return fq2_is_zero(A) def curve_add(a:list,b:list)->list: if curve_is_infinity(a):return b if curve_is_infinity(b):return a D=fm(a[2],a[2]);E=fm(b[2],b[2]);I=fm(a[0],E);N=fm(b[0],D);A=fm(b[2],E);J=fm(a[1],A);A=fm(a[2],D);O=fm(b[1],A);C=fs(N,I);P=fq_eq(C,0);A=fa(C,C);K=fm(A,A);L=fm(C,K);A=fs(O,J);Q=fq_eq(A,0) if P and Q:return curve_double(a) F=fa(A,A);G=fm(I,K);B=fm(F,F);A=fa(G,G);H=fs(B,L);M=fs(H,A);A=fs(G,M);B=fm(J,L);H=fa(B,B);B=fm(F,A);R=fs(B,H);A=fa(a[2],b[2]);B=fm(A,A);A=fs(B,D);B=fs(A,E);S=fm(B,C);return[M,R,S] def curve_double(a:list)->list:C=fm(a[0],a[0]);E=fm(a[1],a[1]);F=fm(E,E);A=fa(a[0],E);B=fm(A,A);A=fs(B,C);B=fs(A,F);G=fa(B,B);A=fa(C,C);H=fa(A,C);K=fm(H,H);A=fa(G,G);J=fs(K,A);D=fm(a[1],a[2]);D=fa(D,D);A=fa(F,F);B=fa(A,A);A=fa(B,B);I=fs(G,J);B=fm(H,I);I=fs(B,A);return[J,I,D] def curve_mul(pt:list,k:int)->list: if int(k)==0:return[1,1,0] A=[[0,0,0],pt] for B in bits_of(k):A[B^1]=curve_add(A[B],A[B^1]);A[B]=curve_double(A[B]) return A[0] def curve_is_infinity(c:list)->bool:return c[2]==0 def curve_neg(c:list)->list:return[c[0],fq_neg(c[1]),c[2],0] def curve_make_affine(c:list)->list: if fq_eq(c[2],1):return c elif fq_eq(c[2],0):return[0,1,0,0] else:A=fq_inv(c[2]);C=fm(c[1],A);B=fm(A,A);D=fm(c[0],B);E=fm(C,B);return[D,E,1,1] def curve_is_on_curve(c:list)->bool: c=curve_make_affine(c) if curve_is_infinity(c):return True B=fm(c[1],c[1]);A=fm(c[0],c[0]);A=fm(A,c[0]);A=fa(A,curveB);return fq_eq(B,A) def pairing(Q:list,P:list)->list: assert curve_is_on_curve(P),f"P is not on the curve.";assert twist_is_on_curve(Q),f"Q is not on the curve." if curve_is_infinity(P)or twist_is_infinity(Q):return fq12_one() A=miller(Q,P);return A vk={'IC':[[0x23df1bc9165e9c1c9b2bc036d8ebdd10e7aeae7e5e8019fde68aec7c818bb23e,0xb6c92080d37c5fb2ddf30892a33665e5478432ef3f71ac8768ecbbe62c77892,1,1],[0x1c7b2adf45e046caea000956b2ecb2d8617e710d2a7bb201a95ea276f92307b4,0x2b15f07536f45948cf4abe6596637d902ffabb18c8c2f5c151544c294ce4a672,1,1],[0x1cecfe92882a8c835a47bf01bfa655cf628cbba7f81cf4042179fd13edcd6a39,0x154bfbb2cb786ca247d4b69183d1751f267bbc7656be8d0f0e7a5a47e2c1101,1,1],[0x1584616a7423efcc72f69ea84fa0b2bc01433677297f4e8351bebfc15bcd0cda,0x623755b1488526daa9fecf0e11b110dd6df12c461579d792e1db65af523c8be,1,1],[0x12fbb5bfca9d61357ba2d641604cf4852e21ef54faa180fe539c18994dc1da5a,0x2f09dd9972a1af5f7bcfccf3d7ab600c9d898ea6d6933150ba0ae228ece17e5f,1,1],[0xadb513796fdf2103022c64151ce05f7c7a6d9200e8d819fa59e654fc4bfe83c,0x2d64f72ef4eddf9ca032058ed2bf691758387e913a77cf99d6a3cfb37c8ba7ee,1,1],[0x21e7c9bffda74bfd2c4393b6803d775545de6fa89145f4a23476241d9881b661,0xbbe41e52237ac13eb7b01f3cb999b7394d08734e71b1c3ada62713e17eb560c,1,1]],'vk_alfa_1':[0x2dbfc3ec62a3eee5a3b4b464bcf1f8527bbca12adea0f1f12033cd4f61b0e091,0x19e55bd0b72c126da18665039556776642ff82e2f347f24fcea2475f4db087df,1,1],'vk_beta_2':[[0x1ae724ab134e5a7c6bd8a116fa5505b259522c0f164a5e8126e3ec7d34465f6e,0x9f1bcdc853f8e3531756bb625b0d1dc014f4ab57c3f79f4f4e2e7ef7e0ead6],[0x23a8ca5760457e726365b92fd0ceb486665797cd68c35dcffd8e4ae8066691e9,0x13ec7182c9fd68331a10f8be0fe885d730de5c7f89aa7d0b7bafaa009bbc9e3e],[0,1],[0,1]],'vk_gamma_2':[[0x198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c2,0x1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed],[0x90689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b,0x12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa],[0,1],[0,1]],'vk_delta_2':[[0x2f0c63d0c53b3dfbca27b6b43ae7fbf55a38d78a21470996485b03128accc208,0x556502356e37ed150db2e36531b0f275fd6835c0fc1945922e270b48c48a86],[0x2644c27b5dbd793592a70b735e22c798a5e309fa17a992a7dc2a050e01b298f,0x194776b6a53439d7336f389d2a8f6651e40885f5ca2538b0dc9cb534fb23f7fa],[0,1],[0,1]]} def verify(inputs:list,proof:dict)->int: D=inputs;B=proof;E=vk['IC'];assert len(D)+1==len(E),'verifier-bad-input';F=E[0] for A in range(len(D)):assert D[A]<curve_order,'verifier-gte-snark-scalar-field';F=curve_add(F,curve_mul(E[A+1],D[A])) G=[curve_neg(B['A']),vk['vk_alfa_1'],F,B['C']];H=[(B['B'][0],B['B'][1],B['B'][2],B['B'][3]),vk['vk_beta_2'],vk['vk_gamma_2'],vk['vk_delta_2']];C=fq12_one() for A in range(4): if twist_is_infinity(H[A])or curve_is_infinity(G[A]):continue C=f12m(C,pairing(H[A],G[A])) C=final_exponentiation(C) if not fq12_is_one(C):return 1 return 0 @export def verify_proof(a:list,b:list,c:list,inputs:list)->bool: B=inputs;A={};A['A']=int(a[0]),int(a[1]),int(a[2]),1;A['B']=FQ2([int(b[0][1]),int(b[0][0])]),FQ2([int(b[1][1]),int(b[1][0])]),FQ2([int(b[2][1]),int(b[2][0])]),fq2_one();A['C']=int(c[0]),int(c[1]),int(c[2]),1;B=[int(A)for A in B] if verify(B,A)==0:return True else:return False
name
con_verifier_optimized_v1

State Changes

Contract
currency
Variable
balances
New Value
680