Halo: Recursive Proof Composition without a Trusted Setup 学习笔记

1. 引言

Bowe等人2019年论文《Halo: Recursive Proof Composition without a Trusted Setup》。

代码实现参见:

  • https://github.com/zcash/halo2
  • https://github.com/mir-protocol/plonky
  • https://github.com/ebfull/halo

要点:
1)基于inner product argument (其中 b ⃗ = ( 1 , x , x 2 , ⋯   , x d − 1 ) \vec{b}=(1,x,x^2,\cdots,x^{d-1}) b =(1,x,x2,,xd1)) 来构建polynomial commitment scheme,其在最后一轮的proof size比Hyrax的实现少一个 G \mathbb{G} G group element。基于Bulletproofs的二分思路实现了without trusted setup。
2)指出Hyrax的方案中的“U”存在Prover作弊问题,应该类似Bulletproofs中那样基于verifier challenge来构建新的“U”值。
3)采用了一些摊销策略,减少了Verifier的计算压力。
如Verifier需计算的 b ′ = < s ⃗ , b ⃗ > b'=<\vec{s},\vec{b}> b=<s ,b >可看成是对多项式 g ( X , u 1 , u 2 , ⋯   , u k ) = ∏ i = 1 k ( u i − 1 + u i X 2 i − 1 ) g(X,u_1,u_2,\cdots,u_k)=\prod_{i=1}^{k}(u_i^{-1}+u_iX^{2^{i-1}}) g(X,u1,u2,,uk)=i=1k(ui1+uiX2i1) x x x point的evaluation值,也可由Prover来计算并提供相应证明。
如将Verifier需计算的 G ′ = < s ⃗ , G ⃗ > G'=<\vec{s},\vec{G}> G=<s ,G >的计算看成是对多项式 g ( X , u 1 , u 2 , ⋯   , u k ) = ∏ i = 1 k ( u i − 1 + u i X 2 i − 1 ) g(X,u_1,u_2,\cdots,u_k)=\prod_{i=1}^{k}(u_i^{-1}+u_iX^{2^{i-1}}) g(X,u1,u2,,uk)=i=1k(ui1+uiX2i1)的commitment,改由Prover来完成,使得Verifier只需验证该polynomial commitment是否正确即可。
4)借鉴了Sonic的helper模式,实现了双变量polynomial commitment的延迟验证,从而可将a stream of arguments的验证工作延迟到最后一个argument,将verification工作量降为几乎为logarithmic。
5)借鉴Sonic思路,将arithmetic circuit转换为证明Laurent polynomial P ( X ) P(X) P(X) X 0 X^0 X0 constant term的系数为0。
6)构建了Tweedledum和Tweedledee的非pairing-friendly的2-cycle curve,具有endomorphism属性,可用于优化verifier challenge值,提升计算效率。


Non-interactive arguments of knowledge可用于demonstrate the faithful execution of arbitrary computations with publicly verifiable proofs。
借助recursive proof composition,可对large computational effort进行incrementally verify。
之前实现的recursive proof composition 都需要trusted setup和cycles of expensive pairing-friendly elliptic curves。
本文实现的Halo算法:

  • 是第一个实用的recursive proof composition without a trusted setup;
  • 基于discrete log assumption over normal cycles of elliptic curves。

zk-SNARKs全称为:zero-knowledge succinct non-interactive arguments of knowledge。
当前效率最高的zk-SNARKs都需要pairing-friendly elliptic curves和trusted setup,但是具有small, constant-size proofs with constant-time verification。如Groth 2016年论文《On the size of pairing-based non-interactive arguments》。

  • Gennaro 等人2010年论文《Non-interactive verifiable computing: Outsourcing computation to untrusted workers》中提出,将zk-SNARKs用于verifiable computation,将computation委托给不可信第三方,第三方在返回结果的同时提供cryptographic proof来证明结果是正确的。理论上,要求该proof要更小,且相比于直接计算更易于验证,即要求zk-SNARKs具有succinctness属性。
  • Valiant 2008年论文《Incrementally verifiable computation or proofs of knowledge imply time/space efficiency》中引入了incrementally verifiable computation的概念,其proof不仅证明the correct execution of a computation,还保证the validity of a previous proof。这样,a large and virtually unbounded amount of computation can be verified with a single proof, and with this proof alone we may extend the computation with further proofs。

受incrementally verifiable computation启发,可将区块链看成是需要所有参与方下载区块链上的所有历史记录,仅仅是为了validate each individual state transition (transaction) merely in order to validate and process new state changes。SNARKs allow us to partially address this scalability problem by outsourcing some of these verification steps to a third party,但是参与方仍然需要下载并验证每一个proof。Incrementally verifiable computation可解决该问题,使用a single proof来证明the correctness of many previous proofs,参与方仅需要下载当前状态和证明该状态是正确的proof,further proofs of state changes can be constructed with the latest proof alone, allowing active participants to prune old state changes。

本文借助recursive proof composition来实现incremental verifiable computation。这些proofs可用于保证the satisfaction of compliance predicates between old and new states,从而可引出proof-carrying data 概念(参见 2010年Chiesa等人论文《Proof-Carrying Data and hearsay arguments from signature cards》)。proof-carrying data概念可用于实现verifiable distributed computations(参见Bitansky等人2013年论文《Recursive composition and bootstrapping for SNARKs and Proof-Carrying Data》)。

  • Ben-Sasson等人2014年论文《Scalable Zero Knowledge via cycles of elliptic curve》中,第一次实现了实用的recursive proof composition,其依赖于SNARKs built over pairing-friendly elliptic curves。
    Elliptic curve groups通常instantiated over a base field F p \mathbb{F}_p Fp,但是这些groups具有的prime order q q q通常不等于 p p p,因此用于demonstrate satisfiability of an arithmetic circuit over the scalar field F q \mathbb{F}_q Fq 所构建的SNARK 无法efficiently encode the F p \mathbb{F}_p Fp arithmetic needed to verify its own proofs。
    在该论文中,Ben-Sasson等人通过构建2-cycle of pairing-friendly elliptic curves such that the base field of either curve is the scalar field of the other 来规避该问题。但是,Chiesa等人2018年论文《On cycles of pairing-friendly elliptic curves》中指出,目前仅有一个pairing-friendly curves family满足该要求,而该curves family的embedding degree很低,需要基于large (780-bit) field才能构建足够安全的curve,field太大会影响pairing计算性能。而且更重要的是,现有的所有pairing-based SNARKs,均需要trusted setup。

1.1 主要贡献

  • 理论上,可用任意的zk-SNARK来实现recursive proof composition。Ben-Sasson等人在2018年论文《Scalable, transparent, and post-quantum secure computational integrity》中提出的STARKs算法,不需要trusted setup。目前暂无对recursive proof composition的实用实现,如STARKs对相对简单computation的proof size都在几百kB。
    本文提出的Halo算法,是第一个实用的recursive proof composition without a trusted setup。与Ben-Sasson等人2014年论文《Scalable Zero Knowledge via cycles of elliptic curve》中的思路类似,本文使用了cycle of elliptic curves,使得proofs constructed with one curve can efficiently verify proofs constructed over the other。但是,对任一曲线均不要求为pairing-friendly,包含了normal 255-bit prime-order curves的cycle,其具有的security level 接近128-bit。且Halo中的proof size和verification time并不会随着recursion depth的增加而增加。

  • 提出了基于inner product argument具有amortized succinctness的polynomial commitment scheme。
    (参见博客 Hyrax: Doubly-efficient zkSNARKs without trusted setup学习笔记
    受Wahby等人2018年论文《Doubly-efficient zkSNARKs without trusted setup》中的dot-product proof protocol启发,发现利用the smooth structure of vectors that the verifier must work with, we can amortize away (across many proofs) the linear-time verification operation for commitment openings with the assistance of an untrusted third party “helper”。特别地,与perform a linear-time operation for each commitment opening proof不同,“helper”会提供the claimed output of these linear-time operations for each proof,然后用 a new argument来demonstrate that every claimed output was correct。该new argument仍然需要Verifier做linear-time操作,但是此时,仅需要对整个proofs batch做一次linear-time operation即可。这种策略使得我们可以build proofs for arithmetic circuit satisfiability,其边界verification time为logarithmic in the size of the circuit——相比于Bulletproofs的linear verification time有了改进。“help”的作用类似于Maller等人2019年《Sonic: Zero-Knowledge SNARKs from linear-size universal and updatable Structured Reference Strings》中第8节的helped variant的作用,但是,本文的“helper”无需trusted setup。

  • Nested Amortization嵌套摊销
    之前实现recursive proof composition的思路均为:
    – 首先build a fully succinct, non-interactive argument system;
    – 然后构建 a verification circuit for this system。
    由于succinctness属性的要求,at some threshold the verification circuit will be smaller than the size of the circuit being checked, allowing arbitrary-depth recursion to be achieved。
    基于elliptic curve groups构建的argument systems具有smallest communication complexity known in the literature,但是这些argument systems 要么需要trusted setup (如所有的pairing-based SNARKs),要么需要linear-time verifiers且not fully succinct (如Bulletproofs)。
    本文主要贡献是通过采用amortization strategy来reduce verification circuit size。本文 verification circuit 从来不自己做linear-time operations,而仅take the input and (claimed) output of the linear-time operation to be public inputs to the circuit,i.e. they are encoded in the statement being proven。The circuit proceeds on the assumption that the claimed output is correct and so the circuit is sublinear in size. This effectively defers the full verification of the “inner” proof to the verifier, who must also perform a similar linear-time operation to check the “outer” proof. 借助“helper”,Verifier可将这2种计算压缩为一种。

  • 2-cycle of elliptic curves:
    本文所使用的2-cycle elliptic curves分别称为Tweedledum和Tweedledee,具有attractive performance和security。其cyclic nature可高效express 类似 Ben-Sasson等人2014年论文《Scalable Zero Knowledge via cycles of elliptic curve》中的 verification circuits。本文所选择的这两种曲线支持特定的endomorphisms,可用于reduce the size of the verification circuit。

1.2 同期研究成果

  • Chiesa等人2019年论文《Fractal: Post-quantum and transparent recursive proofs from holography》中基于高效的low-degree testing技术,构建了recursive zero-knowledge protocol,具有plausible post-quantum security和full succinctness。
    本文的Verifier’s work is linear in the circuit size,不具有fully succinct,但是128-bit security level 情况下,本文的fully-recursive proofs size为3.5KB,而Fractal的size 超过120KB。
    另外,Halo的recursion threshold为小于 2 17 2^{17} 217个multiplication gates,比Fractal的小一个数量级,Halo has the potential for substantially reducing proving time/memory requirements。

  • Bu¨nz等人2019年论文《Supersonic: Transparent SNARKs from DARK compilers》中基于unknown order groups 构建了zk-SNARK,无需trusted setup。不清楚与本文的竞争对比。

2. 基于的安全假设

  • Discrete Log Relation Assumption:
    即已知 G ⃗ ∈ G n \vec{G}\in\mathbb{G}^n G Gn,查找 a ⃗ \vec{a} a ,其中至少有一个 a i ≠ 0 a_i\neq 0 ai=0,使得 < a ⃗ , G ⃗ > = O <\vec{a},\vec{G}>=\mathcal{O} <a ,G >=O
    在这里插入图片描述

3. Polynomial commitments

Kate等人2010年论文《Constant-size commitments to polynomials and their applications》中首次提出了Polynomial commitment scheme。
目前polynomial commitment被广泛用于现代知识证明算法中,如:

本文基于Wahby等人2018年论文《Hyrax: Doubly-efficient zkSNARKs without trusted setup》中的多变量polynomial commitment(其本质为基于Bulletproofs进行调整的inner product argument)提出了单变量polynomial commitment scheme,包含的算法有 ( S e t u p , C o m m i t , O p e n , V e r i f y O p e n ) (Setup, Commit, Open, VerifyOpen) (Setup,Commit,Open,VerifyOpen)

假设polynomial p ( X ) p(X) p(X) 的degree bound为 d − 1 d-1 d1,则:

  • S e t u p ( 1 λ , d ) Setup(1^{\lambda}, d) Setup(1λ,d):输出为common reference string σ = ( G , F p , G ⃗ , H ) \sigma=(\mathbb{G},\mathbb{F}_p,\vec{G},H) σ=(G,Fp,G ,H) for group G \mathbb{G} G of prime order p p p, with random G ⃗ ∈ G d \vec{G}\in\mathbb{G}^d G Gd and H ∈ G H\in\mathbb{G} HG
  • C o m m i t ( σ , p ( X ) ; r ) = < a ⃗ , G ⃗ > + [ r ] H Commit(\sigma,p(X);r)=<\vec{a},\vec{G}>+[r]H Commit(σ,p(X);r)=<a ,G >+[r]H,其中 r r r为blinding factor, a i ∈ F a_i\in\mathbb{F} aiF为多项式 p ( X ) p(X) p(X) i i ith degree term 系数, p ( X ) ∈ F p [ X ] p(X)\in\mathbb{F}_p[X] p(X)Fp[X]为maximal degree d − 1 d-1 d1。可将其看成是对多项式系数的Pedersen vector commitment,具有很好的hiding和加法同态属性——对于 ∀ a , b , r , s ∈ F p , p ( X ) , q ( X ) ∈ F p [ X ] \forall a,b,r,s\in\mathbb{F}_p, p(X),q(X)\in\mathbb{F}_p[X] a,b,r,sFp,p(X),q(X)Fp[X],有:
    [ a ] C o m m i t ( σ , p ( X ) ; r ) + [ b ] C o m m i t ( σ , q ( X ) ; s ) = C o m m i t ( σ , a ⋅ p ( X ) + b ⋅ q ( X ) ; a r + b s ) [a]Commit(\sigma,p(X);r)+[b]Commit(\sigma,q(X);s)=Commit(\sigma,a\cdot p(X)+b\cdot q(X); ar+bs) [a]Commit(σ,p(X);r)+[b]Commit(σ,q(X);s)=Commit(σ,ap(X)+bq(X);ar+bs)
  • O p e n ( p ( X ) , x ) Open(p(X),x) Open(p(X),x):输出为 v ∈ F p v\in\mathbb{F}_p vFp
  • V e r i f y O p e n ( P , x , v ) VerifyOpen(P,x,v) VerifyOpen(P,x,v):判断the polynomial contained “inside” the commitment P P P evaluates to v v v at x x x。输出为1表示接受,0表示拒绝。

然后可将 ( S e t u p , O p e n , V e r i f y O p e n ) (Setup,Open,VerifyOpen) (Setup,Open,VerifyOpen)看成是a PSHVZK (perfect special honest-verifier zero knowledge) argument of knowledge for the relation:
{ ( ( P , x , v ) : ( a ⃗ , r ) ) : P = < a ⃗ , G ⃗ > + [ r ] H ∧ v = < a ⃗ , ( 1 , x , x 2 , ⋯   , x d − 1 ) > } \{((P,x,v):(\vec{a},r)): P=<\vec{a},\vec{G}>+[r]H\wedge v=<\vec{a},(1,x,x^2,\cdots,x^{d-1})>\} {((P,x,v):(a ,r)):P=<a ,G >+[r]Hv=<a ,(1,x,x2,,xd1)>}
以上relation 可用于证明 the polynomial contained “inside” the commitment P P P evaluates to v v v at x x x,甚至 the committed polynomial has maximum degree d − 1 d-1 d1

基本信息展开为:

  • public info: P ∈ G , x , v ∈ F p P\in\mathbb{G},x,v\in\mathbb{F}_p PG,x,vFp
  • private info: a ⃗ ∈ F p n , r ∈ F p \vec{a}\in\mathbb{F}_p^n,r\in\mathbb{F}_p a Fpn,rFp
  • relation: P = < a ⃗ , G ⃗ > + [ r ] H ∧ v = < a ⃗ , ( 1 , x , x 2 , ⋯   , x d − 1 ) > P=<\vec{a},\vec{G}>+[r]H\wedge v=<\vec{a},(1,x,x^2,\cdots,x^{d-1})> P=<a ,G >+[r]Hv=<a ,(1,x,x2,,xd1)>

详细的思路为:

  • Verifier:生成随机group element U ∈ G U\in\mathbb{G} UG,将 U ∈ G U\in\mathbb{G} UG发送给Prover。
  • Prover和Verifier:都计算 P ′ = P + [ v ] U P'=P+[v]U P=P+[v]U
  • Prover:转为证明Prover知道 a ⃗ ∈ F p d , r , v ′ ∈ F p \vec{a}\in\mathbb{F}_p^d,r,v'\in\mathbb{F}_p a Fpd,r,vFp,使得 P ′ = < a ⃗ , G ⃗ > + [ r ] H + [ v ′ ] U P'=<\vec{a},\vec{G}>+[r]H+[v']U P=<a ,G >+[r]H+[v]U成立,其中 v ′ = < a ⃗ , ( 1 , x , x 2 , ⋯   , x d − 1 ) > v'=<\vec{a},(1,x,x^2,\cdots,x^{d-1})> v=<a ,(1,x,x2,,xd1)>。若Prover无法提前知道 U U U,则 v = v ′ v=v' v=v成立。【注意,本文的“U”由Verifier在收到commitment P P P之后才提供,Bulletproofs中的也类似,而Hyrax中的dot-product proof protocol中没有做相应约定,存在prover在 P P P中包含 U U U信息,进而伪造证明的情况——a prover with malicious control of P P P would then be able to interfere with the argument by including terms involving U U U in P P P。】(参见博客 Hyrax: Doubly-efficient zkSNARKs without trusted setup学习笔记 第4.2节“dot-product proof with Bulletproofs”)

Bulletproofs中实现的基本信息为:(此处的 U U U由Verifier先知道 P = < a ⃗ , G ⃗ > + < b ⃗ , H ⃗ > P=<\vec{a},\vec{G}>+<\vec{b},\vec{H}> P=<a ,G >+<b ,H >后,发送challenge x ∈ F x\in\mathbb{F} xF,然后Prover和Verifier重新计算的 U = x U ∈ G U=xU\in\mathbb{G} U=xUG。)【非zero-knowledge的inner product argument】

  • public info:commitment P ′ P' P,generators G ⃗ , H ⃗ ∈ G d , U ∈ G \vec{G},\vec{H}\in\mathbb{G}^d,U\in\mathbb{G} G ,H Gd,UG
  • private info: a ⃗ , b ⃗ ∈ F d \vec{a},\vec{b}\in\mathbb{F}^d a ,b Fd
  • relation: P ′ = < a ⃗ , G ⃗ > + < b ⃗ , H ⃗ > + [ < a ⃗ , b ⃗ > ] U P'=<\vec{a},\vec{G}>+<\vec{b},\vec{H}>+[<\vec{a},\vec{b}>]U P=<a ,G >+<b ,H >+[<a ,b >]U

本文针对的情况是,其中 b ⃗ = ( 1 , x , x 2 , ⋯   , x n − 1 ) \vec{b}=(1,x,x^2,\cdots,x^{n-1}) b =(1,x,x2,,xn1) 为public info,对Prover和Verifier均已知,所以,此时不再需要 H ⃗ ∈ G d \vec{H}\in\mathbb{G}^d H Gd。根据需要,可额外再引入generator H ∈ G H\in\mathbb{G} HG来实现blinding both prover messages and the commitment P ′ P' P。最终基本信息为:

  • public info:commitment P ′ P' P,generators G ⃗ ∈ G d , H , U ∈ G \vec{G}\in\mathbb{G}^d, H, U\in\mathbb{G} G Gd,H,UG b ⃗ ∈ F d \vec{b}\in\mathbb{F}^d b Fd
  • private info: a ⃗ ∈ F d \vec{a}\in\mathbb{F}^d a Fd和blinding r ∈ F r\in\mathbb{F} rF
  • relation: P ′ = < a ⃗ , G ⃗ > + r H + [ < a ⃗ , b ⃗ > ] U P'=<\vec{a},\vec{G}>+rH+[<\vec{a},\vec{b}>]U P=<a ,G >+rH+[<a ,b >]U

假设 d = 2 k , k > 0 d=2^k,k>0 d=2k,k>0,Prover初始化 G ⃗ ′ = G ⃗ , a ⃗ ′ = a ⃗ , b ⃗ ′ = b ⃗ , P = P ′ \vec{G}'=\vec{G},\vec{a}'=\vec{a},\vec{b}'=\vec{b},P=P' G =G ,a =a ,b =b ,P=P,然后进行 k k k轮交互,其中 in the j j jth round (starting with j = k j=k j=k and finishing with j = 1 j=1 j=1):
1)若 d = 1 d=1 d=1,则:【目前有2种实现思路。】
1.1)Hyrax中的思路为:【此时有 P = a ′ G ′ + r H + a ′ b ′ U P=a'G'+rH+a'b'U P=aG+rH+abU,其中 a ′ , r ∈ F a',r\in\mathbb{F} a,rF为private info, b ′ ∈ F , G ′ , H , U , P ∈ G b'\in\mathbb{F}, G',H,U,P\in\mathbb{G} bF,G,H,U,PG均为public info。】

  • Prover:引入Prover私有blinding随机数 d , r δ , r β ← F d,r_{\delta},r_{\beta}\leftarrow\mathbb{F} d,rδ,rβF,计算 δ = d G ′ + r δ H , β = d U + r δ H \delta=dG'+r_{\delta}H, \beta=dU+r_{\delta}H δ=dG+rδH,β=dU+rδH,将 δ , β ∈ G \delta,\beta\in\mathbb{G} δ,βG发送给Verifier。
  • Verifier:发送challenge c ← F c\leftarrow \mathbb{F} cF 给Prover。
  • Prover:计算 z 1 = d + c ⋅ a ′ b ′ , z 2 = b ′ ( c ⋅ r + r β ) + r δ z_1=d+c\cdot a'b', z_2=b'(c\cdot r+r_{\beta})+r_{\delta} z1=d+cab,z2=b(cr+rβ)+rδ,将 z 1 , z 2 ∈ F z_1,z_2\in\mathbb{F} z1,z2F发送给Verifier。
  • Verifier:验证 b ′ ( c P + β ) + δ = z 1 ( G ′ + b ′ U ) + z 2 H b'(cP+\beta)+\delta=z_1(G'+b'U)+z_2H b(cP+β)+δ=z1(G+bU)+z2H是否成立即可。

1.2)本文的思路为(相比于Hyrax方案,proof size少了一个group element G \mathbb{G} G):【此时有 P = [ a ′ ] G ′ + [ r ] H + [ a ′ b ′ ] U = [ a ′ ] ( G + [ b ′ ] U ) + [ r ] H P=[a']G'+[r]H+[a'b']U=[a'](G+[b']U)+[r]H P=[a]G+[r]H+[ab]U=[a](G+[b]U)+[r]H,其中 a ′ , r ∈ F a',r\in\mathbb{F} a,rF为private info, b ′ ∈ F , G ′ , H , U , P ∈ G b'\in\mathbb{F}, G',H,U,P\in\mathbb{G} bF,G,H,U,PG均为public info。】(其中 ( G + [ b ′ ] U ) (G+[b']U) (G+[b]U)为public info,可直接用 博客 基于Sigma protocol实现的零知识证明protocol集锦 第2.4节 “2.4 Protocol 4. Knowledge of the opening of Pedersen commitment”来计算。)

  • Prover:引入Prover私有blinding随机数 d , r δ ← F d,r_{\delta}\leftarrow\mathbb{F} d,rδF,计算 δ = d ( G ′ + b ′ U ) + r δ H \delta=d(G'+b'U)+r_{\delta}H δ=d(G+bU)+rδH,将 δ ∈ G \delta \in\mathbb{G} δG发送给Verifier。
  • Verifier:发送challenge c ← F c\leftarrow \mathbb{F} cF 给Prover。
  • Prover:计算 z 1 = d + a ′ c , z 2 = r δ + r c z_1=d+a'c, z_2=r_{\delta}+rc z1=d+ac,z2=rδ+rc,将 z 1 , z 2 ∈ F z_1,z_2\in\mathbb{F} z1,z2F发送给Verifier。
  • Verifier:验证 c P + δ = z 1 ( G ′ + b ′ U ) + z 2 H cP+\delta=z_1(G'+b'U)+z_2H cP+δ=z1(G+bU)+z2H是否成立即可。

2)若 d > 1 d>1 d>1,则 j = log ⁡ 2 d , d ′ = d 2 j=\log_2{d}, d'=\frac{d}{2} j=log2d,d=2d,有:

  • Prover:计算:
    d ′ = d / 2 d'=d/2 d=d/2
    引入Prover私有blinding随机数 l j , r j ← F l_j,r_j\leftarrow\mathbb{F} lj,rjF,计算 L j = < a ⃗ l o ′ , G ⃗ h i ′ > + [ l j ] H + [ < a ⃗ l o ′ , b ⃗ h i ′ > ] U L_j=<\vec{a}'_{lo},\vec{G}'_{hi}>+[l_j]H+[<\vec{a}'_{lo},\vec{b}'_{hi}>]U Lj=<a lo,G hi>+[lj]H+[<a lo,b hi>]U R j = < a ⃗ h i ′ , G ⃗ l o ′ > + [ r j ] H + [ < a ⃗ h i ′ , b ⃗ l o ′ > ] U R_j=<\vec{a}'_{hi},\vec{G}'_{lo}>+[r_j]H+[<\vec{a}'_{hi},\vec{b}'_{lo}>]U Rj=<a hi,G lo>+[rj]H+[<a hi,b lo>]U
    L j , R j ∈ G L_j,R_j\in\mathbb{G} Lj,RjG发送给Verifier。

  • Verifier:发送random challenge u j ∈ F u_j\in\mathbb{F} ujF 给Prover。

  • Prover:计算:
    a ⃗ ′ = a ⃗ h i ′ ⋅ u j − 1 + a ⃗ l o ′ ⋅ u j \vec{a}'=\vec{a}'_{hi}\cdot u_j^{-1}+\vec{a}'_{lo}\cdot u_j a =a hiuj1+a louj
    r ′ = l j u j 2 + r + r j u j − 2 r'=l_ju_j^2+r+r_ju_j^{-2} r=ljuj2+r+rjuj2

  • Prover和Verifier:计算:
    b ⃗ ′ = b ⃗ l o ′ ⋅ u j − 1 + b ⃗ h i ′ ⋅ u j \vec{b}'=\vec{b}'_{lo}\cdot u_j^{-1}+\vec{b}'_{hi}\cdot u_j b =b louj1+b hiuj
    G ⃗ ′ = G ⃗ l o ′ ⋅ u j − 1 + G ⃗ h i ′ ⋅ u j \vec{G}'=\vec{G}'_{lo}\cdot u_j^{-1}+\vec{G}'_{hi}\cdot u_j G =G louj1+G hiuj
    P ′ = [ u j 2 ] L j + P + [ u j − 2 ] R j P'= [u_j^2]L_j+P+ [u_j^{-2}]R_j P=[uj2]Lj+P+[uj2]Rj

  • 设置 d = d ′ , P = P ′ , r = r ′ d=d',P=P',r=r' d=d,P=P,r=r,继续从步骤1)开始执行。

在以上证明过程中,关注Prover在每轮递归调用时计算的内容:
a ⃗ ′ = a ⃗ h i ′ ⋅ u j − 1 + a ⃗ l o ′ ⋅ u j \vec{a}'=\vec{a}'_{hi}\cdot u_j^{-1}+\vec{a}'_{lo}\cdot u_j a =a hiuj1+a louj
b ⃗ ′ = b ⃗ l o ′ ⋅ u j − 1 + b ⃗ h i ′ ⋅ u j \vec{b}'=\vec{b}'_{lo}\cdot u_j^{-1}+\vec{b}'_{hi}\cdot u_j b =b louj1+b hiuj
G ⃗ ′ = G ⃗ l o ′ ⋅ u j − 1 + G ⃗ h i ′ ⋅ u j \vec{G}'=\vec{G}'_{lo}\cdot u_j^{-1}+\vec{G}'_{hi}\cdot u_j G =G louj1+G hiuj

  • 与最后一轮 d = 1 d=1 d=1时的 G ′ ∈ G , b ′ ∈ F G'\in\mathbb{G},b'\in\mathbb{F} GG,bF之间的关系为 G ′ = < s ⃗ , G ⃗ > , b ′ = < s ⃗ , b ⃗ > G'=<\vec{s},\vec{G}>,b'=<\vec{s},\vec{b}> G=<s ,G >,b=<s ,b >,其中 s ⃗ \vec{s} s 为:
    s ⃗ = ( u 1 − 1 u 2 − 1 ⋯ u k − 1 , u 1 u 2 − 1 ⋯ u k − 1 , u 1 − 1 u 2 ⋯ u k − 1 , u 1 u 2 ⋯ u k − 1 , ⋮ u 1 u 2 ⋯ u k ) \vec{s}=(u_1^{-1}u_2^{-1}\cdots u_k^{-1}, \\ u_1 u_2^{-1}\cdots u_k^{-1}, \\ u_1^{-1}u_2\cdots u_k^{-1},\\ u_1u_2\cdots u_k^{-1},\\ \vdots \\ u_1u_2\cdots u_k) s =(u11u21uk1,u1u21uk1,u11u2uk1,u1u2uk1,u1u2uk)
  • Verifier在最后一轮收到的commitment P ′ P' P,满足以下公式:
    P ′ = ∑ j = 1 k ( [ u j 2 ] L j ) + P + ∑ j = 1 k ( [ u j − 2 ] R j ) P'= \sum_{j=1}^{k}([u_j^2]L_j)+P+ \sum_{j=1}^{k}([u_j^{-2}]R_j) P=j=1k([uj2]Lj)+P+j=1k([uj2]Rj)
  • Prover在最后一轮的blinding值 r ′ r' r满足如下公式:
    r ′ = ∑ j = 1 k ( l j u j 2 ) + r + ∑ j = 1 k ( r j u j − 2 ) r'=\sum_{j=1}^{k}(l_ju_j^2)+r+\sum_{j=1}^{k}(r_ju_j^{-2}) r=j=1k(ljuj2)+r+j=1k(rjuj2)

3.1 Amortization Strategy摊销策略

以上polynomial commitment,尽管其communication complexity为 O ( log ⁡ 2 ( d ) ) O(\log_2(d)) O(log2(d)),其中 d − 1 d-1 d1为多项式的degree bound,但是Verifier必须在验证时计算 G ′ = < s ⃗ , G ⃗ > , b ′ = < s ⃗ , b ⃗ > G'=<\vec{s},\vec{G}>,b'=<\vec{s},\vec{b}> G=<s ,G >,b=<s ,b >,其中 s ⃗ = ( u 1 − 1 u 2 − 1 ⋯ u k − 1 , u 1 u 2 − 1 ⋯ u k − 1 , u 1 − 1 u 2 ⋯ u k − 1 , u 1 u 2 ⋯ u k − 1 , ⋮ u 1 u 2 ⋯ u k ) \vec{s}=(u_1^{-1}u_2^{-1}\cdots u_k^{-1}, \\ u_1 u_2^{-1}\cdots u_k^{-1}, \\ u_1^{-1}u_2\cdots u_k^{-1},\\ u_1u_2\cdots u_k^{-1},\\ \vdots \\ u_1u_2\cdots u_k) s =(u11u21uk1,u1u21uk1,u11u2uk1,u1u2uk1,u1u2uk)

注意,本文针对的情况是 b ⃗ = ( 1 , x , x 2 , ⋯   , x n − 1 ) \vec{b}=(1,x,x^2,\cdots,x^{n-1}) b =(1,x,x2,,xn1)为public info的情况,其中的 < s ⃗ , b ⃗ > <\vec{s},\vec{b}> <s ,b >可看成对多项式:【注意,感觉论文的 g ( X , u 1 , u 2 , ⋯   , u k ) g(X,u_1,u_2,\cdots,u_k) g(X,u1,u2,,uk)公式有点问题,但是作者说木问题。。。
g ( X , u 1 , u 2 , ⋯   , u k ) = ∏ i = 1 k ( u i − 1 + u i X 2 i − 1 ) g(X,u_1,u_2,\cdots,u_k)=\prod_{i=1}^{k}(u_i^{-1}+u_iX^{2^{i-1}}) g(X,u1,u2,,uk)=i=1k(ui1+uiX2i1)
在point x x x的evaluation值,即 b ′ = < s ⃗ , b ⃗ > = g ( x , u 1 , u 2 , ⋯   , u k ) b'=<\vec{s},\vec{b}>=g(x,u_1,u_2,\cdots,u_k) b=<s ,b >=g(x,u1,u2,,uk)。Verifier可计算该evaluation值in logarithmic time。
但是,对于 G ′ = < s ⃗ , G ⃗ > G'=<\vec{s},\vec{G}> G=<s ,G >计算,仍然需要a linear-time multiscalar multiplication。但是仔细观察,可将 G ′ G' G看成是对多项式 g ( X , u 1 , u 2 , ⋯   , u k ) g(X,u_1,u_2,\cdots,u_k) g(X,u1,u2,,uk)系数的commitment值:
G ′ = C o m m i t ( σ , g ( X , u 1 , u 2 , ⋯   , u k ) ) G'=Commit(\sigma, g(X,u_1,u_2,\cdots,u_k)) G=Commit(σ,g(X,u1,u2,,uk))
所以 与其让Verifier为 m m m个(independent)arguments 自己计算 G i ′ G'_i Gi,不如将该计算外包给不可信的第三方“helper“ ,”helper”在提供 G 1 ′ , G 2 ′ , ⋯   , G m ′ G_1',G_2',\cdots,G_m' G1,G2,,Gm (for m m m separate arguments) 计算结果的同时提供相应的argument that each are correct by demonstrating that a random linear combination of the commitments opens at a random point to a value the verifier can compute in time O ( m log ⁡ ( d ) ) O(m\log(d)) O(mlog(d))。基于Schwartz-Zippel Lemma,”helper“可让Verifier信服其结果是正确计算的(其伪造成功的概率不高于 d − 1 p − 1 \frac{d-1}{p-1} p1d1)。
也就是说,此时,Verifier需调用“helper“运行对 g ( X , u 1 , u 2 , ⋯   , u k ) g(X,u_1,u_2,\cdots,u_k) g(X,u1,u2,,uk)的polynomial commitment opening protocol,最终Verifier仍需要进行一次linear-time operation,但是通过此操作,the verifier has traded m m m linear-time operations for one, with a marginal cost that is logarithmic in the degree bound。

3.2 Nested Amortization嵌套摊销

通常,实现recursive proof composition需要:

  • 首先获得a non-interactive argument of knowledge for arithmetic circuit satisfiability,如 C ( x , w ) = 1 C(x,w)=1 C(x,w)=1 for auxiliary input w w w and public input x x x
  • 然后encode the verification algorithm for this argument into such an arithmetic circuit。

假设a proof的verification circuit is sublinear in the size of the circuit,则存在某个阈值,使得recursively verify proofs 成为可能。本文并未实现a protocol which can be fully verified in sublinear time,因此如果只是naively apply this strategy并不能yield results beyond fixed-depth composition。通过里利用论文第五章的sublinear marginal verification time and logarithmic proof size protocol,本文提出了一种可避免在每一层recursion中都需要fully verifying proofs的技术。

Arithmetic circuits通常可以constraint system形式表示:已知a satisfying assignment of variables (the prover’s witness), the satisfaction of the constraint system implies the satisfiability of the circuit。在该过程中,the inherent non-determinism是some expensive operations可由Prover来协助完成。举个例子:在circuits中,当需要对field variable u u u求倒数,直观的做法是利用 u p − 1 ≡ 1   m o d   p u^{p-1}\equiv 1\ mod\ p up11 mod p,求解其倒数 u − 1 = u p − 2   m o d   p u^{-1}=u^{p-2}\ mod\ p u1=up2 mod p需要 log ⁡ ( p ) \log(p) log(p)个multiplication constraints,改为:由Prover来提供witness v = u − 1 v=u^{-1} v=u1,为证明其倒数关系只需引入一个multiplication constraint u v = 1 uv=1 uv=1
本文利用了该non-determinism进行优化:当circuit中包含了an expensive fixed operation f f f that is invoked with some input x x x,就改为由Prover来witness y = f ( x ) y=f(x) y=f(x),然后将 ( x , y ) (x,y) (x,y)作为circuit的public inputs。在假设 y y y是正确的情况下,circuit将继续运行,将验证 y y y的正确性的责任转给Verifier的proof (delegating the responsibility of checking the correctness of y y y to the verifier of the proof)。

本文的proof composition中,Verifier不执行任何linear-time (or otherwise expensive) operation f f f,而是将 x x x和Prover所声称的 y = f ( x ) y=f(x) y=f(x)作为public inputs 并入到verification circuit中。注意,当proofs are continually composed时,increasing instances of ( x , y ) (x,y) (x,y) accumulate because the verification circuit will not check them but rather continually delegate these checks to its verifier。为了避免这种runaway cost,引入了如下摊销策略:
已知instances ( x , y ) (x,y) (x,y) ( x ′ , y ′ ) (x',y') (x,y),Prover将提供a non-interactive proof that y = f ( x ) y=f(x) y=f(x) and y ′ = f ′ ( x ′ ) y'=f'(x') y=f(x) as a witness to the verification circuit,and the verification circuit will check this proof。
为了fully check this amortization proof,the verification circuit可能需要perform a linear-time (or otherwise expensive) operation。但是,若该operation是类似inovking f f f,则Verifier相当于将2个instances ( x , y ) (x,y) (x,y) ( x ′ , y ′ ) (x',y') (x,y)压缩为了1个新的instance ( x ′ ′ , y ′ ′ ) (x'', y'') (x,y),从而允许随着proofs的生成,摊销掉invoking f f f的成本。 f f f仅在circuit的“outside” 由 the ultimate verifier 仅invoke一次,从而可证明整个underlying tree of proofs的正确性。

在论文第五章介绍的PSHVZK argument就是利用了该嵌套摊销策略,利用本博文3.1节提到的polynomial commitment amortization技术。可描述为:

  • P r o v e r → V e r i f i e r Prover\rightarrow Verifier ProverVerifier: a stream of arguments。
  • Verifie:maintain logarithmic-size state 和 perform logarithmic-time operations to partially verify each proof in sequence。最终,at the end of a stream of proofs, the verifier will choose to accept or reject all of them simultaneously in linear time。

借助Fia-Shamir heuristic,可将以上argument转为non-interactive zero-knowledge argument of knowledge。最终实现的就是nested amortization嵌套摊销技术的雏形,其中由Verifier maintain的”state”都是the deferred values that are shepherded(带领/护送) through public inputs。从而可实现任意depth 的recursive proof,而the verifier outside the circuit 仅需对the verifier state验证一次即可,在circuit里面不存在任何linear-time operation。

4. Main Argument

本文是在Sonic main argument的基础上引入了polynomial commitment scheme进行改进。

首先考虑一种简单的场景,即:
对固定的circuit C C C,Prover重复多次与Verifier交互来生成multiple arguments in sequence。

而本文的目的是,Verifier仅需要perform logarithmic marginal work来决定accept or reject all of the arguments simultaneously。

接下来,假设 N , Q , k N,Q,k N,Q,k为整数,且 d = 4 N = 2 k , 3 Q < d d=4N=2^k, 3Q<d d=4N=2k,3Q<d,common reference string σ ← S e t u p ( 1 λ , d ) \sigma\leftarrow Setup(1^{\lambda},d) σSetup(1λ,d) 是Prover和Verifier的共享信息。

Prover为了证明 C ( x , w ) = 1 C(x,w)=1 C(x,w)=1 without reveal w w w,其中 x x x为 public input, w w w为witness,可将circuit C C C表示为arithmetic constraints system——包含 N N N个multiplication constraints和 Q Q Q个linear constraints,即转为Prover知道witness a ⃗ , b ⃗ , c ⃗ ∈ F N \vec{a},\vec{b},\vec{c}\in\mathbb{F}^N a ,b ,c FN,使得:
a i ⋅ b i = c i a_i\cdot b_i=c_i aibi=ci
以及 Q Q Q个linear constraints,对其中的第 q q qth constraint可表示为:(其中 k ⃗ ∈ F Q \vec{k}\in\mathbb{F}^Q k FQ
( ∑ i = 1 N a i ⋅ ( u ⃗ q ) i ) + ( ∑ i = 1 N b i ⋅ ( v ⃗ q ) i ) + ( ∑ i = 1 N c i ⋅ ( w ⃗ q ) i ) = k q (\sum_{i=1}^{N}a_i\cdot (\vec{u}_q)_i)+ (\sum_{i=1}^{N}b_i\cdot (\vec{v}_q)_i)+ (\sum_{i=1}^{N}c_i\cdot (\vec{w}_q)_i)=k_q (i=1Nai(u q)i)+(i=1Nbi(v q)i)+(i=1Nci(w q)i)=kq

接下来,采用与Maller等人2019年《Sonic: Zero-Knowledge SNARKs from linear-size universal and updatable Structured Reference Strings》论文第5章中类似的方法:(详情参见博客 Arithmetic circuit 中第3节“3. Arithmetic circuit的constraint system表示”)
1)引入变量 Y Y Y将multiplication constraints和linear constraints合并为一个方程式:
∑ i = 1 N a i ⋅ Y N u i ( Y ) + ∑ i = 1 N b i ⋅ Y N v i ( Y ) + ∑ i = 1 N c i ⋅ ( Y N w i ( Y ) − Y i − Y − i ) + ∑ i = 1 N a i b i ⋅ ( Y i + Y − i ) − Y N k ( Y ) = 0 \sum_{i=1}^{N}a_i\cdot Y^Nu_i(Y)+\sum_{i=1}^{N}b_i\cdot Y^Nv_i(Y)+\sum_{i=1}^{N}c_i\cdot (Y^Nw_i(Y)-Y^i-Y^{-i})+\sum_{i=1}^{N}a_ib_i\cdot(Y^i+Y^{-i})-Y^Nk(Y)=0 i=1NaiYNui(Y)+i=1NbiYNvi(Y)+i=1Nci(YNwi(Y)YiYi)+i=1Naibi(Yi+Yi)YNk(Y)=0……(4)
其中:
u i ( Y ) = ∑ q = 1 Q Y q ( u ⃗ q ) i u_i(Y)=\sum_{q=1}^{Q}Y^q(\vec{u}_q)_i ui(Y)=q=1QYq(u q)i
v i ( Y ) = ∑ q = 1 Q Y q ( v ⃗ q ) i v_i(Y)=\sum_{q=1}^{Q}Y^q(\vec{v}_q)_i vi(Y)=q=1QYq(v q)i
w i ( Y ) = ∑ q = 1 Q Y q ( w ⃗ q ) i w_i(Y)=\sum_{q=1}^{Q}Y^q(\vec{w}_q)_i wi(Y)=q=1QYq(w q)i
k ( Y ) = ∑ q = 1 Q Y q k q k(Y)=\sum_{q=1}^{Q}Y^qk_q k(Y)=q=1QYqkq

所以,若given a choice of a ⃗ , b ⃗ , c ⃗ , k ⃗ \vec{a},\vec{b},\vec{c},\vec{k} a ,b ,c ,k 使得方程式(4)都成立,则可认为该constraint system is satisfied。基于Schwartz-Zippel Lemma,若field足够大,则该方程式成立而不是正确解的概率不高于 Q + N p − 1 \frac{Q+N}{p-1} p1Q+N

2)再引入变量 X X X,构建Laurent polynomial t ( X , Y ) t(X,Y) t(X,Y),使得其 X 0 X^0 X0 constant term 项的系数为方程式(4)的左侧值:【注意,除 r ( X , Y ) r(X,Y) r(X,Y)外, s ( X , Y ) , s ′ ( X , Y ) s(X,Y),s'(X,Y) s(X,Y),s(X,Y)均与witness a ⃗ , b ⃗ , c ⃗ \vec{a},\vec{b},\vec{c} a ,b ,c 无关。】
r ( X , Y ) = ∑ i = 1 N a i X i Y i + ∑ i = 1 N b i X − i Y − i + ∑ i = 1 N c i X − i − N Y − i − N r(X,Y)=\sum_{i=1}^{N}a_iX^iY^i+\sum_{i=1}^{N}b_iX^{-i}Y^{-i}+\sum_{i=1}^{N}c_iX^{-i-N}Y^{-i-N} r(X,Y)=i=1NaiXiYi+i=1NbiXiYi+i=1NciXiNYiN
s ( X , Y ) = ∑ i = 1 N u i ( Y ) X − i + ∑ i = 1 N v i ( Y ) X i + ∑ i = 1 N w i ( Y ) X i + N s(X,Y)=\sum_{i=1}^{N}u_i(Y)X^{-i}+\sum_{i=1}^{N}v_i(Y)X^i+\sum_{i=1}^{N}w_i(Y)X^{i+N} s(X,Y)=i=1Nui(Y)Xi+i=1Nvi(Y)Xi+i=1Nwi(Y)Xi+N
s ′ ( X , Y ) = Y N s ( X , Y ) − ∑ i = 1 N ( Y i + Y − i ) X i + N s'(X,Y)=Y^Ns(X,Y)-\sum_{i=1}^{N}(Y^i+Y^{-i})X^{i+N} s(X,Y)=YNs(X,Y)i=1N(Yi+Yi)Xi+N
t ( X , Y ) = r ( X , 1 ) ( r ( X , Y ) + s ′ ( X , Y ) ) − Y N k ( Y ) t(X,Y)=r(X,1)(r(X,Y)+s'(X,Y))-Y^Nk(Y) t(X,Y)=r(X,1)(r(X,Y)+s(X,Y))YNk(Y)

注意观察,其中 r ( X , Y ) = r ( X Y , 1 ) r(X,Y)=r(XY,1) r(X,Y)=r(XY,1),Prover可使用单变量polynomial commitment scheme 对 r ( X , Y ) r(X,Y) r(X,Y)进行commit,如 C o m m i t ( σ , r ( X , 1 ) ) Commit(\sigma,r(X,1)) Commit(σ,r(X,1))
剩下的多项式 s ( X , Y ) , s ′ ( X , Y ) s(X,Y),s'(X,Y) s(X,Y),s(X,Y)均与witness a ⃗ , b ⃗ , c ⃗ \vec{a},\vec{b},\vec{c} a ,b ,c 无关,为了使 t ( X , Y ) t(X,Y) t(X,Y)的constant term系数为0, s ( X , Y ) s(X,Y) s(X,Y) s ′ ( X , Y ) s'(X,Y) s(X,Y)会跟随 r ( X , Y ) r(X,Y) r(X,Y)的选择不同而变动。

3)至此,总的策略就变为了:

  • Prover发送对 r ( X , Y ) r(X,Y) r(X,Y)的commitment,然后证明 t ( X , Y ) t(X,Y) t(X,Y)的constant term为zero polynomial。
  • Verifier发送random challenge y ∈ I y\in\mathbb{I} yI
  • Prover发送对 t ( X , y ) t(X,y) t(X,y)的commitment。
  • Verifier发送random challenge x ∈ I x\in\mathbb{I} xI
  • Prover 发送openings a = r ( x , 1 ) , b = r ( x , y ) , t = t ( x , y ) a=r(x,1),b=r(x,y),t=t(x,y) a=r(x,1),b=r(x,y),t=t(x,y)
  • Verifier 验证 t = a ( b + s ′ ( x , y ) ) − k ( y ) t=a(b+s'(x,y))-k(y) t=a(b+s(x,y))k(y)是否成立,即可证明the commitment to t ( X , y ) t(X,y) t(X,y) is correct with high probability。
  • Prover 若能证明其commitment to r ( X , Y ) r(X,Y) r(X,Y) is bounded at degree N N N,则可说明 t ( X , Y ) t(X,Y) t(X,Y)的constant term is exactly the left-hand side of Equation 4;若 t ( X , Y ) t(X,Y) t(X,Y)的commitment的constant term能证明为0值,则可证明the Prover has knowledge of a satisfying witness with high probability。

3.1)为了证明 r ( X , Y ) r(X,Y) r(X,Y)的degree bound为 N N N,Prover需要改为发送commitment R = C o m m i t ( σ , r ( X , 1 ) X 3 N − 1 ; δ R ) R=Commit(\sigma,r(X,1)X^{3N-1};\delta_{R}) R=Commit(σ,r(X,1)X3N1;δR),其中 δ R \delta_R δR为blinding factor,commitment R R R对应的多项式的degree bound为 d − 1 = 4 N − 1 d-1=4N-1 d1=4N1。Verifier仅需rescale openings of this commitment by X − 3 N + 1 X^{-3N+1} X3N+1 to obtain the desired value。
3.2)观察多项式 t ( X , y ) t(X,y) t(X,y)中,基于 X X X的幂乘范围为 X − 4 N X^{-4N} X4N X 3 N X^{3N} X3N,其中constant term值为0。
t l o ( X , y ) , t h i ( X , y ) t_{lo}(X,y),t_{hi}(X,y) tlo(X,y),thi(X,y)多项式的degree为 d − 1 d-1 d1【此时 d = 4 N d=4N d=4N】,使得 t ( X , y ) = t l o ( X , y ) X − d + t h i ( X , y ) X t(X,y)=t_{lo}(X,y)X^{-d}+t_{hi}(X,y)X t(X,y)=tlo(X,y)Xd+thi(X,y)X,与其直接对 t ( X , y ) t(X,y) t(X,y)直接进行commit,可通过分别对 t l o ( X , y ) t_{lo}(X,y) tlo(X,y) t h i ( X , y ) t_{hi}(X,y) thi(X,y)进行commit T l o = C o m m i t ( σ , t l o ( X , y ) , δ l o ) , T h i = C o m m i t ( σ , t h i ( X , y ) , δ h i ) T_{lo}=Commit(\sigma,t_{lo}(X,y),\delta_{lo}),T_{hi}=Commit(\sigma,t_{hi}(X,y),\delta_{hi}) Tlo=Commit(σ,tlo(X,y),δlo),Thi=Commit(σ,thi(X,y),δhi),将 ( T l o , T h i ) (T_{lo}, T_{hi}) (Tlo,Thi)可看成是对 “constant term为0的Laurent polynomial” 的commitment,Verifier此时仍可rescale commitment openings as appropriate。
3.3)为了减轻Verifier的计算压力,Verifier不直接计算 k ( y ) k(y) k(y)值,改为:由Prover计算 k ( Y ) k(Y) k(Y)的commitment值 K = C o m m i t ( σ , k ( Y ) ) K=Commit(\sigma,k(Y)) K=Commit(σ,k(Y)),然后open 该commitment at y y y
3.4)为了evaluate s ′ ( x , y ) s'(x,y) s(x,y),借助了Maller等人2019年《Sonic: Zero-Knowledge SNARKs from linear-size universal and updatable Structured Reference Strings》中的策略:

  • Prover:发送commitment S = C o m m i t ( σ , s ( X , y ) X N ) S=Commit(\sigma,s(X,y)X^N) S=Commit(σ,s(X,y)XN)
  • Verifier:发送random challenge x x x
  • Prover:发送opening for commitment S S S at x x x s a s_a sa
  • Verifier:验证opening正确,然后计算 s ( x , y ) = s a ⋅ x − N s(x,y)=s_a\cdot x^{-N} s(x,y)=saxN。(注意此处验证opening正确需要linear work in ∣ C ∣ |C| C,而本论文的目标是Verifier仅在最后进行一次linear-time operation at the end of a sequence of arguments,且the marginal cost of checking an argument must be logarithmic in ∣ C ∣ |C| C)。

注意,别忘了此时针对的场景是:
对固定的circuit C C C,Prover重复多次与Verifier交互来生成multiple arguments in sequence。
也就是说,在每个argument中都包含了 y n e w y_{new} ynew值和commitment S n e w = C o m m i t ( σ , s ( X , y n e w ) X N ) S_{new}=Commit(\sigma,s(X,y_{new})X^N) Snew=Commit(σ,s(X,ynew)XN)。假设 ( y o l d , S o l d ) (y_{old}, S_{old}) (yold,Sold) ( y n e w , S n e w ) (y_{new},S_{new}) (ynew,Snew)前一个argument的值。则Prover可通过如下方式来验证 S n e w S_{new} Snew S o l d S_{old} Sold是否正确:
【看后续的完整协议实现,实际协议中是默认Verifier验证成立,从而减少communication cost和Verification work。借助了Sonic论文第8章的思路。即认为若:open C = C o m m i t ( σ , s ( x , Y ) X N ) C=Commit(\sigma,s(x,Y)X^N) C=Commit(σ,s(x,Y)XN) at y o l d y_{old} yold的值等于open S o l d = C o m m i t ( σ , s ( X , y o l d ) ) S_{old}=Commit(\sigma,s(X,y_{old})) Sold=Commit(σ,s(X,yold))的值;且, open C = C o m m i t ( σ , s ( x , Y ) X N ) C=Commit(\sigma,s(x,Y)X^N) C=Commit(σ,s(x,Y)XN) at y y y的值等于open S = C o m m i t ( σ , s ( X , y ) ) S=Commit(\sigma,s(X,y)) S=Commit(σ,s(X,y))的值,则可说明 “若 C C C is a commitment to the correct polynomial,则大概率 S o l d , S S_{old}, S Sold,S 每个commitment is to the correct polynomial”。
此时,Verifier不直接验证commitment C C C的正确性,而改为sample random y n e w ∈ I y_{new}\in\mathbb{I} ynewI,要求Prover提供 S n e w = C o m m i t ( σ , s ( X , y n e w ) X N ) S_{new}=Commit(\sigma,s(X,y_{new})X^N) Snew=Commit(σ,s(X,ynew)XN),然后要求Prover证明 S n e w S_{new} Snew open at x x x的值与 C C C open at y n e w y_{new} ynew的值相同,这就说明 “大概率 the correctness of S n e w S_{new} Snew 可代表 the correctness of C C C”。Verifier take this ( y n e w , S n e w ) (y_{new},S_{new}) (ynew,Snew) for the next argument。
为了accept a sequence of arguments, Verifier仅需验证 S n e w = C o m m i t ( σ , s ( X , y n e w ) X N ) S_{new}=Commit(\sigma,s(X,y_{new})X^N) Snew=Commit(σ,s(X,ynew)XN) for the final argument,而不需要perform linear-time marginal work with respect to evaluating s(X,Y)。

  • Verifier:发送random challenge x x x
  • Prover:发送Commitment C = C o m m i t ( σ , s ( x , Y ) x N ) C=Commit(\sigma,s(x,Y)x^N) C=Commit(σ,s(x,Y)xN);发送openings for commitment S o l d S_{old} Sold S n e w S_{new} Snew at x x x s a o l d , s a n e w s_{aold}, s_{anew} saold,sanew
  • Verifier:发送 random challenge y o l d , y n e w y_{old},y_{new} yold,ynew
  • Prover:发送openings for commitment C C C at y o l d , y n e w y_{old},y_{new} yold,ynew c a o l d , c a n e w c_{aold},c_{anew} caold,canew
  • Verifier:验证openings for commitment S o l d S_{old} Sold S n e w S_{new} Snew at x x x是否正确;验证openings for commitment C C C at y o l d , y n e w y_{old},y_{new} yold,ynew是否正确;最后验证 s a o l d = c a o l d , s a n e w = c a n e w s_{aold}= c_{aold}, s_{anew}= c_{anew} saold=caold,sanew=canew是否成立即可。

至此,Verifier可认为自 ( y n e w , S n e w ) (y_{new},S_{new}) (ynew,Snew)之前的sequence arguments 都是正确的。In order to accept a sequence of arguments the verifier will need to check that S n e w = C o m m i t ( σ , s ( X , y n e w ) X N ) S_{new}=Commit(\sigma,s(X,y_{new})X^N) Snew=Commit(σ,s(X,ynew)XN) for the final argument but otherwise does not perform linear-time marginal work with respect to evaluating s ( X , Y ) s(X,Y) s(X,Y)

4.1 合并多个polynomial commitment opening arguments

至此,Prover和Verifier进行了多个单独的polynomial commitment opening arguments。
(1)以下为均需open at x x x的polynomial commitments:

  • R = C o m m i t ( σ , r ( X , 1 ) X 3 N − 1 ; δ R ) R=Commit(\sigma,r(X,1)X^{3N-1};\delta_{R}) R=Commit(σ,r(X,1)X3N1;δR) 【即相当于计算 r ( x , 1 ) r(x,1) r(x,1)
  • S o l d = C o m m i t ( σ , s ( X , y o l d ) X N ) S_{old}=Commit(\sigma,s(X,y_{old})X^N) Sold=Commit(σ,s(X,yold)XN)
  • S = C o m m i t ( σ , s ( X , y ) X N ) S=Commit(\sigma,s(X,y)X^N) S=Commit(σ,s(X,y)XN)
  • S n e w = C o m m i t ( σ , s ( X , y n e w ) X N ) S_{new}=Commit(\sigma,s(X,y_{new})X^N) Snew=Commit(σ,s(X,ynew)XN)
  • T l o = C o m m i t ( σ , t l o ( X , y ) , δ l o ) T_{lo}=Commit(\sigma,t_{lo}(X,y),\delta_{lo}) Tlo=Commit(σ,tlo(X,y),δlo)
  • T h i = C o m m i t ( σ , t h i ( X , y ) , δ h i ) T_{hi}=Commit(\sigma,t_{hi}(X,y),\delta_{hi}) Thi=Commit(σ,thi(X,y),δhi)
    (在收到对相同的点 x x x的openings之后,Verifier发送challenge z 1 z_1 z1,借助 Kate等人2010年论文《Constant-size commitments to polynomials and their applications》中的batch opening 策略,构建 P = R + [ z 1 ] S o l d + [ z 1 2 ] S + [ z 1 3 ] S n e w + [ z 1 4 ] T l o + [ z 1 5 ] T h i = C o m m i t ( σ , p ( Z ) ) P=R+[z_1]S_{old}+[z_1^2]S+[z_1^3]S_{new}+[z_1^4]T_{lo}+[z_1^5]T_{hi}=Commit(\sigma,p(Z)) P=R+[z1]Sold+[z12]S+[z13]Snew+[z14]Tlo+[z15]Thi=Commit(σ,p(Z)),其中多项式 p ( Z ) ∈ F [ Z ] p(Z)\in\mathbb{F}[Z] p(Z)F[Z]。)

(2)以下为均需open at y y y的polynomial commitments:

  • K = C o m m i t ( σ , k ( Y ) ) K=Commit(\sigma,k(Y)) K=Commit(σ,k(Y)) 【即相当于计算 k ( y ) k(y) k(y)
  • C = C o m m i t ( σ , s ( x , Y ) x N ) C=Commit(\sigma,s(x,Y)x^N) C=Commit(σ,s(x,Y)xN)
    (在收到对相同的点 y y y的openings之后,Verifier发送challenge z 1 z_1 z1,借助 Kate等人2010年论文《Constant-size commitments to polynomials and their applications》中的batch opening 策略,构建 Q = K + [ z 1 ] C = C o m m i t ( σ , q ( Z ) ) Q=K+[z_1]C=Commit(\sigma,q(Z)) Q=K+[z1]C=Commit(σ,q(Z)),其中多项式 q ( Z ) ∈ F [ Z ] q(Z)\in\mathbb{F}[Z] q(Z)F[Z]。)

(3)以下为需open at x y xy xy的polynomial commitments:

  • R = C o m m i t ( σ , r ( X , 1 ) X 3 N − 1 ; δ R ) R=Commit(\sigma,r(X,1)X^{3N-1};\delta_{R}) R=Commit(σ,r(X,1)X3N1;δR) 【即相当于计算 r ( x y , 1 ) = r ( x , y ) r(xy,1)=r(x,y) r(xy,1)=r(x,y)

(4)以下为需open at y o l d y_{old} yold的polynomial commitments:

  • C = C o m m i t ( σ , s ( x , Y ) x N ) C=Commit(\sigma,s(x,Y)x^N) C=Commit(σ,s(x,Y)xN)

(5)以下为需open at y n e w y_{new} ynew的polynomial commitments:

  • C = C o m m i t ( σ , s ( x , Y ) x N ) C=Commit(\sigma,s(x,Y)x^N) C=Commit(σ,s(x,Y)xN)

借鉴Boneh等人2020年论文《Efficient polynomial commitment schemes for multiple points and polynomials》中的思路,将以上(1)~(5)的5个separate opening arguments reduce为1个:
对于 m m m个不同的evaluation points x 0 , x 1 , ⋯   , x m − 1 x_0,x_1,\cdots,x_{m-1} x0,x1,,xm1,可定义多项式:
h ( X , Z ) = ∑ i = 0 m − 1 Z i e i ( X ) − v i X − x i h(X,Z)=\sum_{i=0}^{m-1}Z^i\frac{e_i(X)-v_i}{X-x_i} h(X,Z)=i=0m1ZiXxiei(X)vi
其中, m m m个commitments E 0 , E 1 , ⋯   , E m − 1 E_0,E_1,\cdots,E_{m-1} E0,E1,,Em1 满足 E i = C o m m i t ( σ , e i ( X ) ) E_i=Commit(\sigma,e_i(X)) Ei=Commit(σ,ei(X)),在point x i x_i xi 的evaluation 值为 v i v_i vi。【针对本文情况,此时 E 0 = P , E 1 = Q , E 2 = R , E 3 = C , E 4 = C E_0=P,E_1=Q,E_2=R,E_3=C,E_4=C E0=P,E1=Q,E2=R,E3=C,E4=C。】

  • Prover:发送openings v i = e i ( x i ) v_i=e_i(x_i) vi=ei(xi) for all i i i
  • Verifier:发送 random challenge z 2 z_2 z2
  • Prover:发送commitment H = C o m m i t ( σ , h ( X , z 2 ) ; δ H ) H=Commit(\sigma,h(X,z_2);\delta_H) H=Commit(σ,h(X,z2);δH),其中 δ H ∈ F \delta_H\in\mathbb{F} δHF为blinding factor。
    (为了证明 H H H是正确构建的,需要再引入Verifier challenge z 3 z_3 z3,Prover提供 P , Q , R , C P,Q,R,C P,Q,R,C的openings,然后Verifier可计算 h ( z 3 , z 2 ) h(z_3,z_2) h(z3,z2)值,并验证 h ( z 3 , z 2 ) h(z_3,z_2) h(z3,z2)为commitment H H H 在point z 3 z_3 z3的opening值。)
  • Verifier:发送random challenge z 3 z_3 z3
  • Prover:发送 P , Q , R , C P,Q,R,C P,Q,R,C的openings at z 3 z_3 z3 p ( z 3 ) , q ( z 3 ) , r ( z 3 , 1 ) , s ( x , z 3 ) p(z_3),q(z_3),r(z_3,1),s(x,z_3) p(z3),q(z3),r(z3,1),s(x,z3)
  • Verifier:根据 p ( z 3 ) , q ( z 3 ) , r ( z 3 , 1 ) , s ( x , z 3 ) p(z_3),q(z_3),r(z_3,1),s(x,z_3) p(z3),q(z3),r(z3,1),s(x,z3)计算 h ( z 3 , z 2 ) = p ( z 3 ) − v 0 z 3 − x 0 + z 2 ⋅ q ( z 3 ) − v 1 z 3 − x 1 + z 2 2 ⋅ r ( z 3 , 1 ) − v 2 z 3 − x 2 + z 2 3 ⋅ s ( x , z 3 ) − v 3 z 3 − x 3 + z 2 4 ⋅ s ( x , z 3 ) − v 4 z 3 − x 4 h(z_3,z_2)=\frac{p(z_3)-v_0}{z_3-x_0}+z_2\cdot \frac{q(z_3)-v_1}{z_3-x_1}+z_2^2\cdot \frac{r(z_3,1)-v_2}{z_3-x_2}+z_2^3\cdot \frac{s(x,z_3)-v_3}{z_3-x_3}+z_2^4\cdot \frac{s(x,z_3)-v_4}{z_3-x_4} h(z3,z2)=z3x0p(z3)v0+z2z3x1q(z3)v1+z22z3x2r(z3,1)v2+z23z3x3s(x,z3)v3+z24z3x4s(x,z3)v4。Verifier验证 h ( z 3 , z 2 ) h(z_3,z_2) h(z3,z2) 是否为commitment H H H at z 3 z_3 z3的evaluation值即可。
    (至此,可认为 H H H的构建正确,且 P , Q , R , C P,Q,R,C P,Q,R,C的openings 也是正确的。)
    (接下来需要引入Verifier challenge z 4 z_4 z4,将 P , Q , R , C , H P,Q,R,C,H P,Q,R,C,H combine为一个多项式 t ( Z ) = p ( z 3 ) + Z ⋅ q ( z 3 ) + Z 2 ⋅ r ( z 3 , 1 ) + Z 3 ⋅ s ( x , z 3 ) + Z 4 ⋅ h ( z 3 , z 2 ) t(Z)=p(z_3)+Z\cdot q(z_3)+Z^2\cdot r(z_3,1)+Z^3\cdot s(x,z_3)+Z^4\cdot h(z_3,z_2) t(Z)=p(z3)+Zq(z3)+Z2r(z3,1)+Z3s(x,z3)+Z4h(z3,z2),the prover will open ( P + [ z 4 ] Q + [ z 4 2 ] R + [ z 4 3 ] C + [ z 4 4 ] H P+[z_4]Q+[z_4^2]R+[z_4^3]C+[z_4^4]H P+[z4]Q+[z42]R+[z43]C+[z44]H) to the value the verifier can compute itself using the prover’s claimed openings。)
  • Prover:发送对多项式 t ( Z ) t(Z) t(Z)的commitment T = C o m m i t ( σ , t ( Z ) ) T=Commit(\sigma,t(Z)) T=Commit(σ,t(Z))
  • Verifier:选择random challenge z 4 z_4 z4,由于Verifier此时已知openings p ( z 3 ) 、 q ( z 3 ) 、 r ( z 3 , 1 ) 、 s ( x , z 3 ) 、 h ( z 3 , z 2 ) p(z_3)、q(z_3)、r(z_3,1)、s(x,z_3)、h(z_3,z_2) p(z3)q(z3)r(z3,1)s(x,z3)h(z3,z2),Verifier计算opening t ( z 4 ) = p ( z 3 ) + z 4 ⋅ q ( z 3 ) + z 4 2 ⋅ r ( z 3 , 1 ) + z 4 3 ⋅ s ( x , z 3 ) + z 4 4 ⋅ h ( z 3 , z 2 ) t(z_4)= p(z_3)+z_4\cdot q(z_3)+z_4^2\cdot r(z_3,1)+z_4^3\cdot s(x,z_3)+z_4^4\cdot h(z_3,z_2) t(z4)=p(z3)+z4q(z3)+z42r(z3,1)+z43s(x,z3)+z44h(z3,z2),然后Verifier验证 t ( z 4 ) t(z_4) t(z4)确实是commitment T T T evaluate at z 4 z_4 z4的值。

4.2 分摊 G G G的计算开销

根据本博文3.1节内容,Verifier还需计算:
G ′ = < s ⃗ , G ⃗ > G'=<\vec{s},\vec{G}> G=<s ,G >
其中, s ⃗ = ( u 1 − 1 u 2 − 1 ⋯ u k − 1 , u 1 u 2 − 1 ⋯ u k − 1 , u 1 − 1 u 2 ⋯ u k − 1 , u 1 u 2 ⋯ u k − 1 , ⋮ u 1 u 2 ⋯ u k ) \vec{s}=(u_1^{-1}u_2^{-1}\cdots u_k^{-1}, \\ u_1 u_2^{-1}\cdots u_k^{-1}, \\ u_1^{-1}u_2\cdots u_k^{-1},\\ u_1u_2\cdots u_k^{-1},\\ \vdots \\ u_1u_2\cdots u_k) s =(u11u21uk1,u1u21uk1,u11u2uk1,u1u2uk1,u1u2uk)

若直接计算 G ′ = < s ⃗ , G ⃗ > G'=<\vec{s},\vec{G}> G=<s ,G >,Verifier需要 a multiscalar multiplication that is linear in the degree bound and thus also linear in ∣ C ∣ |C| C;当需要验证 m m m个arguments,Verifier为了计算 G 1 ′ , G 2 ′ , ⋯   , G m ′ G_1',G_2',\cdots,G_m' G1,G2,,Gm 的计算量为 m ∣ C ∣ m|C| mC。需要寻找一种方法,当需验证 m m m个arguments时,Verifier仅需 perform a single operation that is linear time in ∣ C ∣ |C| C at the end of the argument and otherwise expend only logarithmic marginal work to accept each individual argument。

实现的基本思路为:
构建多项式:
g ( X , u 1 , u 2 , ⋯   , u k ) = ∏ i = 1 k ( u i − 1 + u i X 2 i − 1 ) g(X,u_1,u_2,\cdots,u_k)=\prod_{i=1}^{k}(u_i^{-1}+u_iX^{2^{i-1}}) g(X,u1,u2,,uk)=i=1k(ui1+uiX2i1)
G ′ G' G可看成是对多项式 g ( X , u 1 , u 2 , ⋯   , u k ) g(X,u_1,u_2,\cdots,u_k) g(X,u1,u2,,uk) 系数的commitment值:
G ′ = C o m m i t ( σ , g ( X , u 1 , u 2 , ⋯   , u k ) ) G'=Commit(\sigma, g(X,u_1,u_2,\cdots,u_k)) G=Commit(σ,g(X,u1,u2,,uk))

借助第4节中 s ′ ( X , Y ) s'(X,Y) s(X,Y)的amortizing evaluation策略类似,第3.1节中提到的“helper”工作此时可直接由prover承担。
注意,别忘了此时针对的场景是:
对固定的circuit C C C,Prover重复多次与Verifier交互来生成multiple arguments in sequence。

也就是说,在每个argument中都包含了challenges ( ( u n e w ) 1 , ( u n e w ) 2 , ⋯   , ( u n e w ) k ) ) ((u_{new})_1,(u_{new})_2,\cdots, (u_{new})_k)) ((unew)1,(unew)2,,(unew)k))值和commitment G n e w = C o m m i t ( σ , g ( X , ( u n e w ) 1 , ( u n e w ) 2 , ⋯   , ( u n e w ) k ) G_{new}=Commit(\sigma,g(X, (u_{new})_1,(u_{new})_2,\cdots, (u_{new})_k) Gnew=Commit(σ,g(X,(unew)1,(unew)2,,(unew)k)。假设 ( ( u o l d ) 1 , ( u o l d ) 2 , ⋯   , ( u o l d ) k , G o l d ) ((u_{old})_1,(u_{old})_2,\cdots, (u_{old})_k, G_{old}) ((uold)1,(uold)2,,(uold)k,Gold) ( ( u n e w ) 1 , ( u n e w ) 2 , ⋯   , ( u n e w ) k , G n e w ) ((u_{new})_1,(u_{new})_2,\cdots, (u_{new})_k,G_{new}) ((unew)1,(unew)2,,(unew)k,Gnew)前一个argument的值。收到 G o l d ) G_{old}) Gold),在验证时,Verifier不需要判断 G o l d = C o m m i t ( σ , g ( X , ( u o l d ) 1 , ( u o l d ) 2 , ⋯   , ( u o l d ) k ) ) G_{old}=Commit(\sigma,g(X, (u_{old})_1,(u_{old})_2,\cdots, (u_{old})_k)) Gold=Commit(σ,g(X,(uold)1,(uold)2,,(uold)k)),仅需ask the prover to open G o l d G_{old} Gold at x ∈ F x\in\mathbb{F} xF in the next argument。则Prover可通过如下方式来验证 G o l d G_{old} Gold是否正确:【这里只需要考虑 G o l d G_{old} Gold是因为其是对单变量多项式 g ( X , u 1 , u 2 , ⋯   , u k ) g(X,u_1,u_2,\cdots,u_k) g(X,u1,u2,,uk)的commitment,而上面需要用到 S o l d , S n e w S_{old},S_{new} Sold,Snew是因为其是对双变量多项式 s ( X , Y ) s(X,Y) s(X,Y)的commitment,为了唯一确定,需要用到2个?】

  • Prover:发送Commitment G o l d = C o m m i t ( σ , g ( X , ( u o l d ) 1 , ( u o l d ) 2 , ⋯   , ( u o l d ) k ) ) G_{old}=Commit(\sigma,g(X, (u_{old})_1,(u_{old})_2,\cdots, (u_{old})_k)) Gold=Commit(σ,g(X,(uold)1,(uold)2,,(uold)k))
  • Verifier:发送random challenge x x x
  • Prover:发送commitment G n e w = C o m m i t ( σ , g ( X , ( u n e w ) 1 , ( u n e w ) 2 , ⋯   , ( u n e w ) k ) G_{new}=Commit(\sigma,g(X, (u_{new})_1,(u_{new})_2,\cdots, (u_{new})_k) Gnew=Commit(σ,g(X,(unew)1,(unew)2,,(unew)k);发送opening for commitment G o l d G_{old} Gold at x x x g a o l d g_{aold} gaold
  • Verifier:验证opening for commitment G o l d G_{old} Gold at x x x是否正确即可。然后发送新的random challenge,继续循环以上流程。

因此,在4.1节中“需open at x x x的polynomial commitment”中需再增加:
G o l d = C o m m i t ( σ , g ( X , ( u o l d ) 1 , ( u o l d ) 2 , ⋯   , ( u o l d ) k ) ) G_{old}=Commit(\sigma,g(X, (u_{old})_1,(u_{old})_2,\cdots, (u_{old})_k)) Gold=Commit(σ,g(X,(uold)1,(uold)2,,(uold)k))
相应地, P P P需调整为:
P = R + [ z 1 ] S o l d + [ z 1 2 ] S + [ z 1 3 ] S n e w + [ z 1 4 ] T l o + [ z 1 5 ] T h i + [ z 1 6 ] G o l d = C o m m i t ( σ , p ( Z ) ) P=R+[z_1]S_{old}+[z_1^2]S+[z_1^3]S_{new}+[z_1^4]T_{lo}+[z_1^5]T_{hi}+[z_1^6]G_{old}=Commit(\sigma,p(Z)) P=R+[z1]Sold+[z12]S+[z13]Snew+[z14]Tlo+[z15]Thi+[z16]Gold=Commit(σ,p(Z)),其中多项式 p ( Z ) ∈ F [ Z ] p(Z)\in\mathbb{F}[Z] p(Z)F[Z]

So that G o l d G_{old} Gold is opened at x x x,此时Verifier可计算the expected opening of G o l d G_{old} Gold in logarithmic time —— 因为 g ( x , u 1 , u 2 , ⋯   , u k ) = ∏ i = 1 k ( u i − 1 + u i x 2 i − 1 ) = < s ⃗ , b ⃗ > , 其 中 b ⃗ = ( 1 , x , ⋯   , x n − 1 ) g(x,u_1,u_2,\cdots,u_k)=\prod_{i=1}^{k}(u_i^{-1}+u_ix^{2^{i-1}})=<\vec{s},\vec{b}>,其中\vec{b}=(1,x,\cdots,x^{n-1}) g(x,u1,u2,,uk)=i=1k(ui1+uix2i1)=<s ,b >b =(1,x,,xn1)??。The verifier will thus be convinced of the correctness of each value G n e w G_{new} Gnew in a sequence of arguments so long as the final G n e w G_{new} Gnew sent by the prover is correct。

4.3 a sequence of 同一arithmetic circuit arguments的完整协议实现

针对场景:
对固定的circuit C C C,Prover重复多次与Verifier交互来生成multiple arguments in sequence。

基本信息为:

  • public info: G o l d , S o l d ∈ G G_{old},S_{old}\in\mathbb{G} Gold,SoldG y o l d , ( u o l d ) 1 , ( u o l d ) 2 , ⋯   , ( u o l d ) k ∈ F y_{old},(u_{old})_1,(u_{old})_2,\cdots, (u_{old})_k\in\mathbb{F} yold,(uold)1,(uold)2,,(uold)kF k ⃗ ∈ F Q \vec{k}\in\mathbb{F}^{Q} k FQ
  • private info: a ⃗ , b ⃗ , c ⃗ ∈ F N \vec{a},\vec{b},\vec{c}\in\mathbb{F}^{N} a ,b ,c FN
  • relation:
    1) ∀ i , ( a i ⋅ b i = c i ) \forall i, (a_i\cdot b_i=c_i) i,(aibi=ci)
    2) ∀ q , ( ∑ i = 1 N a i ⋅ ( u q ) i ) + ( ∑ i = 1 N b i ⋅ ( v q ) i ) + ( ∑ i = 1 N c i ⋅ ( w q ) i ) = k q \forall q, (\sum_{i=1}^{N}a_i\cdot (u_q)_i)+(\sum_{i=1}^{N}b_i\cdot (v_q)_i)+(\sum_{i=1}^{N}c_i\cdot (w_q)_i)=k_q q,(i=1Nai(uq)i)+(i=1Nbi(vq)i)+(i=1Nci(wq)i)=kq
    3) G o l d = C o m m i t ( σ , g ( X , ( u o l d ) 1 , ( u o l d ) 2 , ⋯   , ( u o l d ) k ) ) G_{old}=Commit(\sigma,g(X, (u_{old})_1,(u_{old})_2,\cdots, (u_{old})_k)) Gold=Commit(σ,g(X,(uold)1,(uold)2,,(uold)k))
    4) S o l d = C o m m i t ( σ , s ( X , y o l d ) ) S_{old}=Commit(\sigma,s(X,y_{old})) Sold=Commit(σ,s(X,yold))

对于以上信息,Verifier不需要立即确定是accept or reject each individual argument,Prover将take the values as G o l d , S o l d G_{old}, S_{old} Gold,Sold for the next argument and suspend its decision to accept。After the final argument the verifier will check the values G n e w , S n e w G_{new}, S_{new} Gnew,Snew in linear time.
利用Fiat-Shamir heuristic将4.1和4.2中的交互实现为non-interactive argument of knowledge。

当验证a stream of proofs时,Verifier主要做两大类不同的操作:

  • 维护a state s t st st
  • 当接收到a proof,执行a verification operation that is logarithmic-time in the circuit size;
  • 更新state s t st st,以便Verifier用于下一个proof;
  • 当收到a sequence of proofs的最后一个proof时,Verifier执行一次linear-time operation来验证 s t st st的正确性,然后决定是accept还是reject all previous proofs。

整个实际实现过程中,充分利用了之前提到的nested amortization strategy:

  • The circuit encodes the logarithmic-time proof checking operation, taking s t st st as a public input to the circuit。
  • The ultimate verifier of the recursive proof 执行了最后的linear-time operation outside the circuit。
  • 最终的结果是:the circuit 汇聚为 a finite size,从而达成recursive proof composition。

r ( X , Y ) = ∑ i = 1 N a i X i Y i + ∑ i = 1 N b i X − i Y − i + ∑ i = 1 N c i X − i − N Y − i − N r(X,Y)=\sum_{i=1}^{N}a_iX^iY^i+\sum_{i=1}^{N}b_iX^{-i}Y^{-i}+\sum_{i=1}^{N}c_iX^{-i-N}Y^{-i-N} r(X,Y)=i=1NaiXiYi+i=1NbiXiYi+i=1NciXiNYiN
s ( X , Y ) = ∑ i = 1 N u i ( Y ) X − i + ∑ i = 1 N v i ( Y ) X i + ∑ i = 1 N w i ( Y ) X i + N s(X,Y)=\sum_{i=1}^{N}u_i(Y)X^{-i}+\sum_{i=1}^{N}v_i(Y)X^i+\sum_{i=1}^{N}w_i(Y)X^{i+N} s(X,Y)=i=1Nui(Y)Xi+i=1Nvi(Y)Xi+i=1Nwi(Y)Xi+N
s ′ ( X , Y ) = Y N s ( X , Y ) − ∑ i = 1 N ( Y i + Y − i ) X i + N s'(X,Y)=Y^Ns(X,Y)-\sum_{i=1}^{N}(Y^i+Y^{-i})X^{i+N} s(X,Y)=YNs(X,Y)i=1N(Yi+Yi)Xi+N
t ( X , Y ) = r ( X , 1 ) ( r ( X , Y ) + s ′ ( X , Y ) ) − Y N k ( Y ) t(X,Y)=r(X,1)(r(X,Y)+s'(X,Y))-Y^Nk(Y) t(X,Y)=r(X,1)(r(X,Y)+s(X,Y))YNk(Y)
需证明Laurent polynomial t ( X , Y ) t(X,Y) t(X,Y) X 0 X^0 X0 constant term项的系数为0。

注意,若Laurent polynomial p ( X ) = p − k X − k + p − ( k − 1 ) X − ( k − 1 ) + ⋯ + p − 1 X − 1 + p 0 + p 1 X + ⋯ + p k − 1 X k − 1 + p k X k p(X)=p_{-k}X^{-k}+p_{-(k-1)}X^{-(k-1)}+\cdots+p_{-1}X^{-1}+p_0+p_1X+\cdots +p_{k-1}X^{k-1}+p_kX^k p(X)=pkXk+p(k1)X(k1)++p1X1+p0+p1X++pk1Xk1+pkXk,若 p 0 = 0 p_0=0 p0=0,则可将其表示为:
p ( X ) = p l o ( X ) X − k + p h i ( X ) X p(X)=p_{lo}(X)X^{-k}+p_{hi}(X)X p(X)=plo(X)Xk+phi(X)X
其中:( p l o ( X ) p_{lo}(X) plo(X) p h i ( X ) p_{hi}(X) phi(X)均为 k − 1 k-1 k1阶多项式。)
p l o ( X ) = p − k + p − ( k − 1 ) X + ⋯ + p − 1 X k − 1 p_{lo}(X)=p_{-k}+p_{-(k-1)}X+\cdots+p_{-1}X^{k-1} plo(X)=pk+p(k1)X++p1Xk1
p h i ( X ) = p 1 + p 2 X + ⋯ + p k X k − 1 p_{hi}(X)=p_1+p_2X+\cdots+p_{k}X^{k-1} phi(X)=p1+p2X++pkXk1

  • public info为: σ , G o l d , S o l d , K = C o m m i t ( σ , k ( Y ) ) ∈ G \sigma,G_{old},S_{old},K=Commit(\sigma,k(Y))\in\mathbb{G} σ,Gold,Sold,K=Commit(σ,k(Y))G y o l d , ( u o l d ) 1 , ( u o l d ) 2 , ⋯   , ( u o l d ) k ∈ F y_{old},(u_{old})_1,(u_{old})_2,\cdots, (u_{old})_k\in\mathbb{F} yold,(uold)1,(uold)2,,(uold)kF k ⃗ ∈ F Q \vec{k}\in\mathbb{F}^{Q} k FQ

  • private info: a ⃗ , b ⃗ , c ⃗ ∈ F N \vec{a},\vec{b},\vec{c}\in\mathbb{F}^{N} a ,b ,c FN

  • relation:
    r ( X , Y ) = ∑ i = 1 N a i X i Y i + ∑ i = 1 N b i X − i Y − i + ∑ i = 1 N c i X − i − N Y − i − N r(X,Y)=\sum_{i=1}^{N}a_iX^iY^i+\sum_{i=1}^{N}b_iX^{-i}Y^{-i}+\sum_{i=1}^{N}c_iX^{-i-N}Y^{-i-N} r(X,Y)=i=1NaiXiYi+i=1NbiXiYi+i=1NciXiNYiN
    s ( X , Y ) = ∑ i = 1 N u i ( Y ) X − i + ∑ i = 1 N v i ( Y ) X i + ∑ i = 1 N w i ( Y ) X i + N s(X,Y)=\sum_{i=1}^{N}u_i(Y)X^{-i}+\sum_{i=1}^{N}v_i(Y)X^i+\sum_{i=1}^{N}w_i(Y)X^{i+N} s(X,Y)=i=1Nui(Y)Xi+i=1Nvi(Y)Xi+i=1Nwi(Y)Xi+N
    s ′ ( X , Y ) = Y N s ( X , Y ) − ∑ i = 1 N ( Y i + Y − i ) X i + N s'(X,Y)=Y^Ns(X,Y)-\sum_{i=1}^{N}(Y^i+Y^{-i})X^{i+N} s(X,Y)=YNs(X,Y)i=1N(Yi+Yi)Xi+N
    t ( X , Y ) = r ( X , 1 ) ( r ( X , Y ) + s ′ ( X , Y ) ) − Y N k ( Y ) t(X,Y)=r(X,1)(r(X,Y)+s'(X,Y))-Y^Nk(Y) t(X,Y)=r(X,1)(r(X,Y)+s(X,Y))YNk(Y) X 0 X^0 X0 constant term项的系数为0。
    t ( X , y ) = t l o ( X , y ) X − d + t h i ( X , y ) X t(X,y)=t_{lo}(X,y)X^{-d}+t_{hi}(X,y)X t(X,y)=tlo(X,y)Xd+thi(X,y)X,其中 d = 4 N d=4N d=4N

    完整的协议细节为:

  • Prover:选择blinding random δ R ← F \delta_R\leftarrow \mathbb{F} δRF,计算commitment R = C o m m i t ( σ , r ( X , 1 ) X 3 N − 1 ; δ R ) R=Commit(\sigma,r(X,1)X^{3N-1};\delta_R) R=Commit(σ,r(X,1)X3N1;δR)
    R ∈ G R\in\mathbb{G} RG发送给Verifier。

  • Verifier:发送random challenge y ← I y\leftarrow \mathbb{I} yI 给Prover。

  • Prover:选择 blinding random δ t l o ← F , δ t h i ← F \delta_{t_{lo}}\leftarrow \mathbb{F},\delta_{t_{hi}}\leftarrow \mathbb{F} δtloF,δthiF,计算commitment T l o = C o m m i t ( σ , t l o ( X , y ) ; δ t l o ) , T h i = C o m m i t ( σ , t h i ( X , y ) ; δ t h i ) T_{lo}=Commit(\sigma,t_{lo}(X,y); \delta_{t_{lo}}), T_{hi}=Commit(\sigma,t_{hi}(X,y); \delta_{t_{hi}}) Tlo=Commit(σ,tlo(X,y);δtlo),Thi=Commit(σ,thi(X,y);δthi) S = C o m m i t ( σ , s ( X , y ) X N ) S=Commit(\sigma,s(X,y)X^N) S=Commit(σ,s(X,y)XN)
    T l o , T h i , S ∈ G T_{lo},T_{hi},S\in\mathbb{G} Tlo,Thi,SG发送给Verifier。

  • Verifier:发送random challenge x ← I x\leftarrow \mathbb{I} xI 给Prover。

  • Prover:计算commitment C = C o m m i t ( σ , s ( x , Y ) x N ) C=Commit(\sigma,s(x,Y)x^N) C=Commit(σ,s(x,Y)xN)
    C ∈ G C\in\mathbb{G} CG发送给Verifier。

  • Verifier:发送random challenge y n e w ← I y_{new}\leftarrow \mathbb{I} ynewI 给Prover。

  • Prover:
    计算Commitment S n e w = C o m m i t ( σ , s ( X , y n e w ) X N ) S_{new}=Commit(\sigma,s(X,y_{new})X^N) Snew=Commit(σ,s(X,ynew)XN)
    open R R R at x x x v 1 = r ( x , 1 ) x 3 N − 1 v_1=r(x,1)x^{3N-1} v1=r(x,1)x3N1
    open S o l d S_{old} Sold at x x x(或 open C C C at y o l d y_{old} yold): v 2 = s ( x , y o l d ) x N v_2=s(x,y_{old})x^N v2=s(x,yold)xN
    open S S S at x x x(或 open C C C at y y y): v 3 = s ( x , y ) x N v_3=s(x,y)x^N v3=s(x,y)xN
    open S n e w S_{new} Snew at x x x(或open C C C at y n e w y_{new} ynew): v 4 = s ( x , y n e w ) x N v_4=s(x,y_{new})x^N v4=s(x,ynew)xN
    open T l o T_{lo} Tlo at x x x v 5 = t l o ( x , y ) v_5=t_{lo}(x,y) v5=tlo(x,y)
    open T h i T_{hi} Thi at x x x v 6 = t h i ( x , y ) v_6=t_{hi}(x,y) v6=thi(x,y)
    open G o l d G_{old} Gold at x x x v 7 = g ( x , ( u o l d ) 1 , ( u o l d ) 2 , ⋯   , ( u o l d ) k ) v_7=g(x,(u_{old})_1,(u_{old})_2,\cdots,(u_{old})_k) v7=g(x,(uold)1,(uold)2,,(uold)k)
    open K K K at y y y v 8 = k ( y ) v_8=k(y) v8=k(y)
    open R R R at x y xy xy v 9 = r ( x y , 1 ) ( x y ) 3 N − 1 = r ( x , y ) ( x y ) 3 N − 1 v_9=r(xy,1)(xy)^{3N-1}=r(x,y)(xy)^{3N-1} v9=r(xy,1)(xy)3N1=r(x,y)(xy)3N1
    S n e w ∈ G S_{new}\in\mathbb{G} SnewG v 1 , v 2 , ⋯   , v 9 ∈ F v_1,v_2,\cdots,v_9\in\mathbb{F} v1,v2,,v9F 发送给Verifier。

  • Verifier:发送random challenge z 1 ← I , z 2 ← I z_1\leftarrow \mathbb{I}, z_2\leftarrow \mathbb{I} z1I,z2I 给Prover。

  • Prover:
    构建commitment P = R + [ z 1 ] S o l d + [ z 1 2 ] S + [ z 1 3 ] S n e w + [ z 1 4 ] T l o + [ z 1 5 ] T h i + [ z 1 6 ] G o l d = C o m m i t ( σ , p ( X ) ) P=R+[z_1]S_{old}+[z_1^2]S+[z_1^3]S_{new}+[z_1^4]T_{lo}+[z_1^5]T_{hi}+[z_1^6]G_{old}=Commit(\sigma,p(X)) P=R+[z1]Sold+[z12]S+[z13]Snew+[z14]Tlo+[z15]Thi+[z16]Gold=Commit(σ,p(X)),其中多项式 p ( X ) ∈ F [ X ] p(X)\in\mathbb{F}[X] p(X)F[X]
    构建 commitment Q = K + [ z 1 ] C = C o m m i t ( σ , q ( X ) ) Q=K+[z_1]C=Commit(\sigma,q(X)) Q=K+[z1]C=Commit(σ,q(X)),其中多项式 q ( X ) ∈ F [ X ] q(X)\in\mathbb{F}[X] q(X)F[X]
    构建 多项式 h ( X , z 2 ) = p ( X ) − p ( x ) X − x + z 2 q ( X ) − q ( y ) X − y + z 2 2 r ( X , 1 ) − r ( x y , 1 ) X − x y + z 2 3 s ( x , X ) − s ( x , y o l d ) X − y o l d h(X,z_2)=\frac{p(X)-p(x)}{X-x}+z_2\frac{q(X)-q(y)}{X-y}+z_2^2\frac{r(X,1)-r(xy,1)}{X-xy}+z_2^3\frac{s(x,X)-s(x,y_{old})}{X-y_{old}} h(X,z2)=Xxp(X)p(x)+z2Xyq(X)q(y)+z22Xxyr(X,1)r(xy,1)+z23Xyolds(x,X)s(x,yold)
    引入blinding random δ H ← F \delta_H\leftarrow \mathbb{F} δHF,计算对多项式 h ( X , z 2 ) h(X,z_2) h(X,z2)的commitment H = C o m m i t ( σ , h ( X , z 2 ) ; δ H ) H=Commit(\sigma, h(X,z_2);\delta_H) H=Commit(σ,h(X,z2);δH)
    H ∈ G H\in\mathbb{G} HG 发送给Verifier。

  • Verifier:发送除 { x , y , x y , y o l d , y n e w } \{x,y,xy,y_{old},y_{new}\} {x,y,xy,yold,ynew} 之外的random challenge z 3 ← I z_3\leftarrow \mathbb{I} z3I

  • Prover:
    open P P P at z 3 z_3 z3 v 10 = p ( z 3 ) v_{10}=p(z_3) v10=p(z3)
    open Q Q Q at z 3 z_3 z3 v 11 = q ( z 3 ) v_{11}=q(z_3) v11=q(z3)
    open R R R at z 3 z_3 z3 v 12 = r ( z 3 , 1 ) z 3 3 N − 1 v_{12}=r(z_3,1)z_3^{3N-1} v12=r(z3,1)z33N1
    open C C C at z 3 z_3 z3 v 13 = s ( x , z 3 ) x N v_{13}=s(x,z_3)x^N v13=s(x,z3)xN
    v 10 , v 11 , v 12 , v 13 ∈ F v_{10},v_{11},v_{12},v_{13}\in\mathbb{F} v10,v11,v12,v13F发送给Verifier。

  • Verifier:
    验证 t ( x , y ) = r ( x , 1 ) ( r ( x , y ) + y n s ( x , y ) − ∑ i = 1 N ( y i + y − i ) x i + N ) − y N k ( y ) t(x,y)=r(x,1)(r(x,y)+y^ns(x,y)-\sum_{i=1}^{N}(y^i+y^{-i})x^{i+N})-y^Nk(y) t(x,y)=r(x,1)(r(x,y)+yns(x,y)i=1N(yi+yi)xi+N)yNk(y)是否成立,即验证 v 5 x − d + v 6 x = v 1 x − 3 N + 1 ( v 9 ( x y ) − 3 N + 1 + v 3 x − N y N − ∑ i = 1 N ( y i + y − i ) x i + N ) − v 8 y N v_5x^{-d}+v_6x=v_1x^{-3N+1}(v_9(xy)^{-3N+1}+v_3x^{-N}y^N-\sum_{i=1}^{N}(y^i+y^{-i})x^{i+N})-v_8y^N v5xd+v6x=v1x3N+1(v9(xy)3N+1+v3xNyNi=1N(yi+yi)xi+N)v8yN是否成立,in logarithmic time。
    验证 v 7 = ∏ i = 1 k ( u i + u i − 1 x 2 i − 1 ) v_7=\prod_{i=1}^{k}(u_i+u_i^{-1}x^{2^{i-1}}) v7=i=1k(ui+ui1x2i1) 是否成立,in logarithmic time。
    发送random challenge z 4 ← I z_4\leftarrow \mathbb{I} z4I
    构建 commitment M = P + [ z 4 ] Q + [ z 4 2 ] R + [ z 4 3 ] C + [ z 4 4 ] H = C o m m i t ( σ , m ( X ) ) M=P+[z_4]Q+[z_4^2]R+[z_4^3]C+[z_4^4]H=Commit(\sigma,m(X)) M=P+[z4]Q+[z42]R+[z43]C+[z44]H=Commit(σ,m(X)),Verifier可计算 M M M open at z 3 z_3 z3的值为:
    m ( z 3 ) = v 10 + z 4 v 11 + z 4 2 v 12 + z 4 3 v 13 + z 4 4 h ( z 3 , z 2 ) m(z_3)=v_{10}+z_4v_{11}+z_4^2v_{12}+z_4^3v_{13}+z_4^4h(z_3,z_2) m(z3)=v10+z4v11+z42v12+z43v13+z44h(z3,z2)
    其中:
    h ( z 3 , z 2 ) = v 10 − p ( x ) z 3 − x + z 2 v 11 − q ( y ) z 3 − y + z 2 2 v 12 z 3 − 3 N + 1 − r ( x y , 1 ) z 3 − x y + z 2 3 v 13 x − N − s ( x , y o l d ) z 3 − y o l d + z 2 4 v 13 x − N − s ( x , y n e w ) z 3 − y n e w h(z_3,z_2)= \frac{v_{10}-p(x)}{z_3-x}+z_2\frac{v_{11}-q(y)}{z_3-y}+z_2^2\frac{v_{12}z_3^{-3N+1}-r(xy,1)}{z_3-xy}+z_2^3\frac{v_{13}x^{-N}-s(x,y_{old})}{z_3-y_{old}}+z_2^4\frac{v_{13}x^{-N}-s(x,y_{new})}{z_3-y_{new}} h(z3,z2)=z3xv10p(x)+z2z3yv11q(y)+z22z3xyv12z33N+1r(xy,1)+z23z3yoldv13xNs(x,yold)+z24z3ynewv13xNs(x,ynew)
    p ( x ) = v 1 x − 3 N + 1 + z 1 v 2 x − N + z 1 2 v 3 x − N + z 1 3 v 4 x − N + z 1 4 v 5 + z 1 5 v 6 + z 1 6 v 7 p(x)=v_1x^{-3N+1}+z_1v_2x^{-N}+z_1^2v_3x^{-N}+z_1^3v_4x^{-N}+z_1^4v_5+z_1^5v_6+z_1^6v_7 p(x)=v1x3N+1+z1v2xN+z12v3xN+z13v4xN+z14v5+z15v6+z16v7
    q ( y ) = v 8 + z 1 v 3 x − N q(y)=v_8+z_1v_3x^{-N} q(y)=v8+z1v3xN
    r ( x y , 1 ) = v 9 ( x y ) − 3 N + 1 r(xy,1)=v_9(xy)^{-3N+1} r(xy,1)=v9(xy)3N+1
    s ( x , y o l d ) = v 2 x − N s(x,y_{old})=v_2x^{-N} s(x,yold)=v2xN
    s ( x , y n e w ) = v 4 x − N s(x,y_{new})=v_4x^{-N} s(x,ynew)=v4xN
    然后Verifier需与Prover互动polynomial commitment opening argument,用于证明 m ( z 3 ) m(z_3) m(z3)确实是open M M M at z 3 z_3 z3的值。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值