PLOOKUP

1. 引言

Aztec团队Gabizon和Williamson 2020年论文 plookup: A simplified polynomial protocol for lookup tables。

代码实现参见:

  • https://github.com/kevaundray/plookup
  • https://github.com/neidis/plonk-plookup

视频介绍参见:

  • Youtube视频 zkSummit: plookup: Speeding up the PLONK prover

针对的场景为:

  • Prover 对 a polynomial f ∈ F < n [ X ] f\in\mathbb{F}_{fF<n[X] over a multiplicative subgroup H ⊂ F H\subset\mathbb{F} HF of size n n n 进行commit;
  • Prover 对该多项式 f f f进行evaluation: f 1 = f ( x 1 ) , ⋯   , f n = f ( x n ) f_1=f(x_1),\cdots, f_n=f(x_n) f1=f(x1),,fn=f(xn)
  • Prover 提供相应的proof,证明 f 1 , ⋯   , f n f_1,\cdots,f_n f1,,fn值均在 t ∈ F d t\in\mathbb{F}^d tFd表内。

本文可看成是Bootle等人2018年论文《Arya: Nearly linear-time zero-knowledge proofs for correct program execution》的简化版,且当 d ≤ n d\leq n dn时,性能可能有所提升。

  • 在Bottle的Arya论文中,要求对多个degree为 d ⋅ log ⁡ n d\cdot \log n dlogn的辅助多项式进行commit;
  • 而本文仅需要对3个degree为 n n n的多项式进行commit,当 d d d n n n相当时,相应的commitment可小很多。

一个常用的应用场景可为:

  • “batch range proof”,即验证所有的 f f f’s values on H H H 均在 [ 0 , ⋯   , M ] [0,\cdots,M] [0,,M]范围内。

本文为"batch range proof"这种特殊应用场景设计了一个稍微优化了的协议。

2. Why lookup table?

当想用zk-SNARK来证明如AES-128或SHA-256这样的标准primitive时,若采用native SNARK language来表达时,对应为大量low degree equations over a large prime field。这些primitives被认为是“SNARK unfriendly”的。因为存在大量的开销用于如bitwise XOR或AND等位分解(bit decomposition)操作。
因此,有相关研究致力于寻找仅需基于native field operations的STARK friendly和SNARK friendly的 hash 函数和对称primitives:

  • Grassi等人2019年论文《Starkad and poseidon: New hash functions for zero knowledge proof systems》
  • Aly等人2019年论文《Efficient symmetric primitives for advanced cryptographic protocols (A marvellous contribution)》
  • Albrecht等人2016年论文《Mimc: Efficient encryption and cryptographic hashing with minimal multiplicative complexity》
  • Albrecht等人2019年论文《 Algebraic cryptanalysis of stark-friendly designs: Application to marvellous and mimc》

本文主要关注的是:

  • 将常用的合法(输入、输出)组合,precompute一个相应的lookup table。然后Prover仅需要证明相应的witness values存在该table中即可。

借助randomness,可将其reduce为looking up single field elements instead of tupples。

假设looup table中的值为 { t i } i ∈ [ d ] \{t_i\}_{i\in [d]} {ti}i[d],witness值为 { f i } i ∈ [ n ] \{f_i\}_{i\in[n]} {fi}i[n]时,对于:
F ( X ) : = ∏ i ∈ [ n ] ( X − f i ) , G ( X ) : = ∏ i ∈ [ d ] ( X − t i ) F(X):=\prod_{i\in[n]}(X-f_i), G(X):=\prod_{i\in[d]}(X-t_i) F(X):=i[n](Xfi),G(X):=i[d](Xti)
转为证明多项式 F ( X ) , G ( X ) F(X),G(X) F(X),G(X)忽略多重性的话,两者具有相同的根。所谓多重性是指,存在某些非负整数,可将 F ( X ) F(X) F(X)表示为 F ( X ) = ∏ i ∈ [ d ] ( X − t i ) e i F(X)=\prod_{i\in[d]}(X-t_i)^{e_i} F(X)=i[d](Xti)ei

在Bootle等人的Arya论文中,提供了上述问题的解决方案——通过repeatedly checking that field elements correspond to certain convenient sparse representations of boolean strings。
在Arya论文中,为证明 F ( X ) = ∏ i ∈ [ d ] ( X − t i ) e i F(X)=\prod_{i\in[d]}(X-t_i)^{e_i} F(X)=i[d](Xti)ei,需要以下两种commitment:

  • commit to a vector of length d log ⁡ n d\log n dlogn。在该vector 中的值为 ( x − t i ) 2 j (x-t_i)^{2^j} (xti)2j,其中 i ∈ [ d ] , j ∈ [ log ⁡ n ] i\in[d],j\in[\log n] i[d],j[logn] x ∈ F x\in\mathbb{F} xF为random verifier challenge。
  • commit to the binary decomposition of the { e i } \{e_i\} {ei}

而本文提供了相对更简单的方法,不再需要明确证明相应的多重性(即无需证明相应的 { e i } \{e_i\} {ei})。

本文以 f ⊂ t f\subset t ft来表示 { f i } i ∈ [ n ] ⊂ { t i } i ∈ [ d ] \{f_i\}_{i\in[n]}\subset \{t_i\}_{i\in[d]} {fi}i[n]{ti}i[d]

t = { 1 , 4 , 8 } , f = { 4 , 1 , 8 , 1 , 8 , 8 } t=\{1,4,8\},f=\{4,1,8,1,8,8\} t={1,4,8},f={4,1,8,1,8,8},详细的解决思路为:

  • { f i } \{f_i\} {fi}排序(根据 t t t的顺序排序)为: s = { 1 , 1 , 4 , 8 , 8 , 8 } s=\{1,1,4,8,8,8\} s={1,1,4,8,8,8}
  • 计算 s s s t t t的非零difference set,均为 { 3 , 4 } \{3,4\} {3,4}。【sequence ( f 1 , f 2 , ⋯ f n ) (f_1,f_2,\cdots f_n) (f1,f2,fn)的difference set的计算方式为: ( f 2 − f 1 , f 3 − f 2 , ⋯   , f n − f n − 1 ) (f_2-f_1,f_3-f_2,\cdots,f_n-f_{n-1}) (f2f1,f3f2,,fnfn1),非零difference set是将其中的零差值移除。】【若 f ⊂ t f\subset t ft,且 t t t中的每个元素都至少在 f f f中出现了1次,则 s s s t t t有完全相同的非零difference set。但是反之不成立,如 s ′ = { 1 , 5 , 5 , 5 , 8 , 8 } s'=\{1,5,5,5,8,8\} s={1,5,5,5,8,8}的非零difference set也为 { 3 , 4 } \{3,4\} {3,4},但是 s ′ ⊂ t s'\subset t st并不成立。】
  • 引入随机值 β ∈ F \beta\in\mathbb{F} βF,对difference set进行randomized: { t i + β t i + 1 } i ∈ [ d − 1 ] \{t_i+\beta t_{i+1}\}_{i\in[d-1]} {ti+βti+1}i[d1] { s i + β s i + 1 } i ∈ [ n − 1 ] \{s_i+\beta s_{i+1}\}_{i\in[n-1]} {si+βsi+1}i[n1]。【若 s i + 1 = s i s_{i+1}=s_i si+1=si,则 s i + β ⋅ s i + 1 = ( 1 + β ) ⋅ s i s_i+\beta\cdot s_{i+1}=(1+\beta)\cdot s_i si+βsi+1=(1+β)si,于是可以借助 ( 1 + β ) (1+\beta) (1+β)来判断出这些重复值,在实际compare时剔除出去,从而实现多重性 { e i } \{e_i\} {ei}的功能。】【可借助“grand product argument”——类似 Gabizon等人2019年论文《PLONK: permutations over lagrange-bases for oecumenical noninteractive arguments of knowledge》中的 permutation argument来证明。】

3. polynomial for lookup table

以上假设了 t t t中的每个元素都至少在 f f f中出现了1次,实际上,若设定:

  • s s s f f f拼接 t t t 之后排序

则不再需要约束 t t t中的值必须在 f f f至少出现1次了。此时对于 t ∈ F d , f ∈ F n t\in\mathbb{F}^d,f\in\mathbb{F}^n tFd,fFn,有 s ∈ F n + d s\in\mathbb{F}^{n+d} sFn+d。【以 t = { 1 , 4 , 8 } , f = { 1 , 8 , 1 , 8 , 8 } t=\{1,4,8\},f=\{1,8,1,8,8\} t={1,4,8},f={1,8,1,8,8}为例,有 s = { 1 , 1 , 1 , 4 , 8 , 8 , 8 , 8 } s=\{1,1,1,4,8,8,8,8\} s={1,1,1,4,8,8,8,8}】。

{ t i + β t i + 1 } i ∈ [ d − 1 ] \{t_i+\beta t_{i+1}\}_{i\in[d-1]} {ti+βti+1}i[d1] { s i + β s i + 1 } i ∈ [ n − 1 ] \{s_i+\beta s_{i+1}\}_{i\in[n-1]} {si+βsi+1}i[n1]证明 f ⊂ t f\subset t ft,构建如下双变量多项式 F , G F,G F,G
PLOOKUP_第1张图片

有:
PLOOKUP_第2张图片
证明以上结论成立的基本思路为:

  • 提取 ( 1 + β ) (1+\beta) (1+β)因子:
    PLOOKUP_第3张图片
  • 拆分为 P ′ P' P P P P两个域来考虑:
    PLOOKUP_第4张图片

4. 单个多项式 f ∈ F < n [ X ] f\in\mathbb{F}_{fF<n[X]的lookup table 关系证明

根据第三节内容,相应的多项式关系为:
F ( β , γ ) / G ( β , γ ) = ( 1 + β ) n ⋅ ∏ i ∈ [ n ] ( γ + f i ) ∏ i ∈ [ d − 1 ] ( γ ( 1 + β ) + t i + β t i + 1 ) ∏ i ∈ [ n + d − 1 ] ( γ ( 1 + β ) + s i + β s i + 1 ) F(\beta,\gamma)/G(\beta,\gamma)=\frac{(1+\beta)^n\cdot \prod_{i\in[n]}(\gamma+f_i)\prod_{i\in[d-1]}(\gamma(1+\beta)+t_i+\beta t_{i+1})}{\prod_{i\in[n+d-1]}(\gamma(1+\beta)+s_i+\beta s_{i+1})} F(β,γ)/G(β,γ)=i[n+d1](γ(1+β)+si+βsi+1)(1+β)ni[n](γ+fi)i[d1](γ(1+β)+ti+βti+1)

根据以上Claim 3.1,可扩展为直接设置 d = n + 1 d=n+1 d=n+1(若 d ≤ n d\leq n dn,则可在 t t t后面pad n − d + 1 n-d+1 nd+1个重复值 of the last element,pad后以上多项式关系仍然成立)。
针对的场景为:

  • Preprocessed polynomials为:用于描述lookup values的多项式 t ∈ F < n + 1 [ X ] t\in\mathbb{F}_{tF<n+1[X]
  • Inputs输入为: f ∈ F < n [ X ] f\in\mathbb{F}_{fF<n[X]

相应协议为:

  • 1)令 s ∈ F 2 n + 1 s\in\mathbb{F}^{2n+1} sF2n+1 ( f , t ) (f,t) (f,t) sorted by t t t。通过两个多项式 h 1 , h 2 ∈ F < n + 1 [ X ] h_1,h_2\in\mathbb{F}_{h1,h2F<n+1[X]来表示 s s s。对于 i ∈ [ n + 1 ] i\in[n+1] i[n+1],有 h 1 ( g i ) = s i h_1(\mathbf{g}^i)=s_i h1(gi)=si h 2 ( g i ) = s n + i h_2(\mathbf{g}^i)=s_{n+i} h2(gi)=sn+i。【其中 g \mathbf{g} g n + 1 n+1 n+1-th root of unity, g n + 1 = 1 \mathbf{g}^{n+1}=1 gn+1=1。有 h 1 ( 1 ) = s n + 1 = h 2 ( g ) h_1(1)=s_{n+1}=h_2(\mathbf{g}) h1(1)=sn+1=h2(g)。】

  • 2)Prover P \mathbf{P} P 按如上规则计算出以上多项式 h 1 , h 2 h_1,h_2 h1,h2,将多项式 h 1 , h 2 h_1,h_2 h1,h2发送给理想第三方 I \mathcal{I} I

  • 3)Veriifer V \mathbf{V} V 发送给 P \mathbf{P} P 随机challenge值 β , γ ∈ F \beta,\gamma\in\mathbb{F} β,γF

  • 4)Prover P \mathbf{P} P 计算多项式 Z ∈ F n + 1 [ X ] Z\in\mathbb{F}_{n+1}[X] ZFn+1[X] that aggregates the value F ( β , γ ) / G ( β , γ ) F(\beta,\gamma)/G(\beta,\gamma) F(β,γ)/G(β,γ)
    4.a)令 Z ( g ) = 1 Z(\mathbf{g})=1 Z(g)=1
    4.b)当 2 ≤ i ≤ n 2\leq i \leq n 2in时,令:【拆分的思想为与 h 1 , h 2 h_1,h_2 h1,h2呼应。】
    Z ( g i ) = ( 1 + β ) i − 1 ⋅ ∏ j < i ( γ + f j ) ∏ 1 ≤ j < i ( γ ( 1 + β ) + t j + β t j + 1 ) ∏ 1 ≤ j < i ( γ ( 1 + β ) + s j + β s j + 1 ) ( γ ( 1 + β ) + s n + j + β s n + j + 1 ) Z(\mathbf{g}^i)=\frac{(1+\beta)^{i-1}\cdot \prod_{jZ(gi)=1j<i(γ(1+β)+sj+βsj+1)(γ(1+β)+sn+j+βsn+j+1)(1+β)i1j<i(γ+fj)1j<i(γ(1+β)+tj+βtj+1)
    4.c)令 Z ( g n + 1 ) = 1 Z(\mathbf{g}^{n+1})=1 Z(gn+1)=1

  • 5) P \mathbf{P} P 将多项式 Z Z Z 发送给 I \mathcal{I} I

  • 6) V \mathbf{V} V 验证多项式 Z Z Z确实是如上格式且 Z ( g n + 1 ) = 1 Z(\mathbf{g}^{n+1})=1 Z(gn+1)=1 V \mathbf{V} V 将验证所有的identities x ∈ H = { g , ⋯   , g n + 1 = 1 } \mathbf{x}\in H=\{\mathbf{g},\cdots,\mathbf{g}^{n+1}=1\} xH={g,,gn+1=1},以下等式均成立:【同时已约定 H H H的lagrange base表示为:对 i ∈ [ n + 1 ] i\in[n+1] i[n+1],有 L i ( g i ) = 1 L_i(\mathbf{g}^i)=1 Li(gi)=1;对任意的 j ≠ i j\neq i j=i,有 L i ( g j ) = 0 L_i(\mathbf{g}^j)=0 Li(gj)=0。】
    6.a) L 1 ( x ) ( Z ( x ) − 1 ) = 0 L_1(\mathbf{x})(Z(\mathbf{x})-1)=0 L1(x)(Z(x)1)=0
    6.b) ( x − g n + 1 ) Z ( x ) ( 1 + β ) ⋅ ( γ + f ( x ) ) ( γ ( 1 + β ) + t ( x ) + β t ( g ⋅ x ) ) = ( x − g n + 1 ) Z ( g ⋅ x ) ( γ ( 1 + β ) + h 2 ( x ) + β h 2 ( g ⋅ x ) ) ( γ ( 1 + β ) + h 1 ( x ) + β h 1 ( g ⋅ x ) ) (\mathbf{x}-\mathbf{g}^{n+1})Z(\mathbf{x})(1+\beta)\cdot(\gamma+f(\mathbf{x}))(\gamma(1+\beta)+t(\mathbf{x})+\beta t(\mathbf{g}\cdot \mathbf{x}))=(\mathbf{x}-\mathbf{g}^{n+1})Z(\mathbf{g}\cdot\mathbf{x})(\gamma(1+\beta)+h_2(\mathbf{x})+\beta h_2(\mathbf{g}\cdot\mathbf{x}))(\gamma(1+\beta)+h_1(\mathbf{x})+\beta h_1(\mathbf{g}\cdot\mathbf{x})) (xgn+1)Z(x)(1+β)(γ+f(x))(γ(1+β)+t(x)+βt(gx))=(xgn+1)Z(gx)(γ(1+β)+h2(x)+βh2(gx))(γ(1+β)+h1(x)+βh1(gx))【核心思想是计算 Z ( g i ) / Z ( g i + 1 ) Z(\mathbf{g}^{i})/Z(\mathbf{g}^{i+1}) Z(gi)/Z(gi+1)】【此处Verifier的计算具有the highest degree。】
    6.c) L n + 1 ( x ) ( h 1 ( x ) − h 2 ( g ⋅ x ) ) = 0 L_{n+1}(\mathbf{x})(h_1(\mathbf{x})-h_2(\mathbf{g}\cdot\mathbf{x}))=0 Ln+1(x)(h1(x)h2(gx))=0【因为之前有约定 h 1 ( 1 ) = h 2 ( g ) = s n + 1 h_1(1)=h_2(\mathbf{g})=s_{n+1} h1(1)=h2(g)=sn+1
    6.d) L n + 1 ( x ) ( Z ( x ) − 1 ) = 0 L_{n+1}(\mathbf{x})(Z(\mathbf{x})-1)=0 Ln+1(x)(Z(x)1)=0

有:【 6.b)中,可再引入polynomial commitment来证明,其中 f f f n n n个元素, t t t n + 1 n+1 n+1个元素, Z Z Z n + 1 n+1 n+1个元素,vanishing polynomial H H H n + 1 n+1 n+1元素,因此最终的quotient polynomial中元素数为: n + ( n + 1 ) + ( n + 1 ) − ( n + 1 ) = 2 n + 1 n+(n+1)+(n+1)-(n+1)=2n+1 n+(n+1)+(n+1)(n+1)=2n+1。整个proof size为 ( 3 n + 3 ) + ( 2 n + 1 ) = 5 n + 4 (3n+3)+(2n+1)=5n+4 (3n+3)+(2n+1)=5n+4。】
PLOOKUP_第5张图片

5. 扩展为多个多项式 f 1 , ⋯   , f w ∈ F < n [ X ] f_1,\cdots,f_w\in\mathbb{F}_{f1,,fwF<n[X] 一一对应 多个 lookup tables 关系证明

在第四节的基础上,扩展为多个多项式 f 1 , ⋯   , f w ∈ F < n [ X ] f_1,\cdots,f_w\in\mathbb{F}_{f1,,fwF<n[X] 一一对应 多个 lookup table,具体的场景为:【又称为 vector lookups。】

  • 有多个witness多项式: f 1 , ⋯   , f w ∈ F < n [ X ] f_1,\cdots,f_w\in\mathbb{F}_{f1,,fwF<n[X]
  • 多个lookup table,以矩阵形式表示: t ∗ ∈ ( F w ) d t^*\in(\mathbb{F^w})^d t(Fw)d
  • 证明:对任意的 j ∈ [ n ] j\in[n] j[n],有 ( f 1 ( g j ) , ⋯   , f w ( g j ) ) ∈ t ∗ (f_1(\mathbf{g}^j), \cdots, f_w(\mathbf{g^j}))\in t^* (f1(gj),,fw(gj))t

可借助 randomization 来将上述场景 reduce为第四节的场景:

  • 对于每一个 i ∈ [ w ] i\in[w] i[w],都有相应的preprocessed polynomials t i ∈ F < d [ X ] t_i\in\mathbb{F}_{tiF<d[X],其中对于每一个 j ∈ [ d ] j\in[d] j[d],有 t i ( g j ) = t i , j ∗ t_i(\mathbf{g}^j)=t_{i,j}^* ti(gj)=ti,j

  • Verifier 选择random challenge α ∈ F \alpha\in\mathbb{F} αF

  • 定义: t : = ∑ i ∈ [ w ] α i t i , f : = ∑ i ∈ [ w ] α i f i t:=\sum_{i\in[w]}\alpha^it_i, f:=\sum_{i\in[w]}\alpha^if_i t:=i[w]αiti,f:=i[w]αifi
    从而有,若有某 j ∈ [ n ] j\in[n] j[n] ( f 1 ( g j ) , ⋯   , f w ( g j ) ) ∉ t ∗ (f_1(\mathbf{g}^j),\cdots,f_w(\mathbf{g}^j))\notin t^* (f1(gj),,fw(gj))/t,则 f ( g j ) ∉ t f(\mathbf{g}^j)\notin t f(gj)/t的概率高于 1 − d ⋅ w / ∣ F ∣ 1-d\cdot w/|\mathbb{F}| 1dw/F

  • 然后继续按照第四节的协议运行即可。

以上这种vector lookup primitive,可用于key-value setting场景,如具有a function f f f,该函数有 w − 1 w-1 w1个输入,然后想要证明a vecotr is of the form ( x 1 , ⋯   , x w − 1 , f ( x 1 , ⋯   , x w − 1 ) ) (x_1,\cdots,x_{w-1},f(x_1,\cdots,x_{w-1})) (x1,,xw1,f(x1,,xw1)) for some input ( x 1 , ⋯   , x w − 1 ) (x_1,\cdots,x_{w-1}) (x1,,xw1)

6. 扩展为多个多项式 f 1 , ⋯   , f w ∈ F < n [ X ] f_1,\cdots,f_w\in\mathbb{F}_{f1,,fwF<n[X]同一位置元素 对应 特定 lookup tables 关系证明

在第5节的基础上,将相应的场景调整为:【此时加强了不同函数,同一位置的约束。】【又称为multiple tables。】

  • 将lookup table矩阵以列为单位拆成 l l l份,即由 t ∗ ∈ ( F w ) d t^*\in(\mathbb{F^w})^d t(Fw)d,对每一个 j ∈ [ l ] j\in[l] j[l],有sub-tables: t j ∗ ∈ ( F w ) d / l t_j^*\in(\mathbb{F}^w)^{d/l} tj(Fw)d/l
  • f 1 , ⋯   , f w ∈ F < n [ X ] f_1,\cdots,f_w\in\mathbb{F}_{f1,,fwF<n[X] 的第 i i i个元素的值,在predefined 第 j = j ( i ) j=j(i) j=j(i) 个sub-table中。

可对 t ∗ ∈ ( F w ) d t^*\in(\mathbb{F^w})^d t(Fw)d扩充为 t ∗ ∈ ( F w + 1 ) d t^*\in(\mathbb{F^{w+1}})^d t(Fw+1)d,具体的扩充方法为:

  • t ∗ t^* t的内容进行按照predefined j = j ( i ) j=j(i) j=j(i)规则进行重组,并在最后一行添加新的一行——对于每一个 j ∈ [ l ] , i ∈ [ d / l ] j\in[l],i\in[d/l] j[l],i[d/l],添加元素 j j j。同时使得对于每一个 j ∈ [ l ] , i ∈ [ d / l ] j\in[l],i\in[d/l] j[l],i[d/l],都包含元素 ( j , ( t j ∗ ) i ) (j,(t_j^*)_i) (j,(tj)i)!!!巧妙!!!这样就不再是特定位置的对应关系,而转换成了第5节的一一对应关系了。【借助selectors j j j,实际实现的就是按不同的门类型(不同的逻辑操作)统一归类。】
  • 同时,位置 i i i与sub-table j j j之间的对应关系,以preprocessed 多项式 q ∈ F < n [ X ] q\in\mathbb{F}_{qF<n[X]表示,使得 q i = j ( i ) q_i=j(i) qi=j(i)
  • 至此,整个过程就转换为:证明对于每一个 i ∈ [ n ] i\in[n] i[n],都有 ( q ( g i ) , f 1 ( g i ) , ⋯   , f w ( g i ) ) ∈ t ∗ ∈ ( F w + 1 d ) (q(\mathbf{g}^i), f_1(\mathbf{g}^i), \cdots, f_w(\mathbf{g}^i))\in t^*\in(\mathbb{F^{w+1}}^d) (q(gi),f1(gi),,fw(gi))t(Fw+1d)
    此时,可直接运行第5节的协议进行处理。

7. continuous range proof的优化解决方案

假设想验证 f ⊂ { 0 , ⋯   , d − 1 } f\subset \{0,\cdots,d-1\} f{0,,d1} for some integer d < n dd<n,可使用如上协议来证明,仅需设置 t i = i − 1 t_i=i-1 ti=i1 for i ∈ [ d ] i\in [d] i[d]

根据第4节,设置 d = n + 1 d=n+1 d=n+1,根据Lemma 3.2可知,证明 f ⊂ { 0 , ⋯   , n } f\subset \{0, \cdots,n\} f{0,,n}的proof complexity为 O ( P ) = 5 n + 4 \mathcal{O}(\mathscr{P})=5n+4 O(P)=5n+4

本文在第4节的基础上,可优化为:

  • 对于 f ⊂ { 0 , ⋯   , 2 n − 2 } f\subset\{0,\cdots,2n-2\} f{0,,2n2} 具有相同proof complexity( O ( P ) = 5 n + 4 \mathcal{O}(\mathscr{P})=5n+4 O(P)=5n+4)。
  • 可在仅增加Verifier constraints的degree的情况下,进一步扩展为证明 f ⊂ { 0 , ⋯   , c ( n − 1 ) } f\subset \{0,\cdots,c(n-1)\} f{0,,c(n1)}
    因此,实际执行时,在可承受的最大constraint degree基础上,选择尽可能大的 c c c值,然后以子程序的方式进行range proof f ⊂ { 0 , ⋯   , n − 1 } f\subset\{0,\cdots,n-1\} f{0,,n1}

详细的思路为:【此处假设所有的range值均在 F \mathbb{F} F域内,即 c n < ∣ F ∣ cn<|\mathbb{F}| cn<F。】

  • 强化sorted s s s的值从0开始,到 c ⋅ ( n − 1 ) c\cdot(n-1) c(n1)结束,即 s 1 = 0 , s 2 n + 1 = c ⋅ ( n − 1 ) s_1=0,s_{2n+1}=c\cdot (n-1) s1=0,s2n+1=c(n1)。同时要求对于每一个 i ∈ [ 2 n ] i\in[2n] i[2n],有 s i + 1 − s i ≤ c s_{i+1}-s_i\leq c si+1sic。这足以推断出 s i ∈ { 0 , ⋯   , c ( n − 1 ) } s_i\in\{0,\cdots,c(n-1)\} si{0,,c(n1)} for each i ∈ [ 2 n + 1 ] i\in[2n+1] i[2n+1]
  • 关于 s i + 1 − s i ≤ c s_{i+1}-s_i\leq c si+1sic这个条件,可通过一个constraint来强化——即将该差值插入到the degree c + 1 c+1 c+1 polynomial that vanishes on { 0 , ⋯   , c } \{0,\cdots,c\} {0,,c}。【对于正整数 c c c,将多项式 P P P表示为: P ( X ) = ∏ i = 0 c ( X − i ) P(X)=\prod_{i=0}^{c}(X-i) P(X)=i=0c(Xi)。】
    这种强化增量的的方式就不再需要关注差值的permutation。事实上,也可以替换为:check a permutation between the values of ( f , t ) (f,t) (f,t) and s s s,其中 t t t为the table of c c c'th multiples,即 t i = c ⋅ ( i − 1 ) t_i=c \cdot (i-1) ti=c(i1) for i ∈ [ n ] i\in[n] i[n]

针对的场景为:【此处 H H H仍为 H = { g , ⋯   , g n + 1 = 1 } H=\{\mathbf{g},\cdots,\mathbf{g}^{n+1}=1\} H={g,,gn+1=1}

  • Preprocessed polynomials为:多项式 t ∈ F < n [ X ] t\in\mathbb{F}_{tF<n[X],其中 t i = c ⋅ ( i − 1 ) t_i=c\cdot(i-1) ti=c(i1) for i ∈ [ n ] i\in [n] i[n]
  • Inputs输入为: f ∈ F < n [ X ] f\in\mathbb{F}_{fF<n[X]

详细的协议实现如下:【与第4节的协议非常相似,只是构建的 F , G F,G F,G多项式不同,此处构建的单变量多项式: F ( γ ) = ∏ i ∈ [ n ] ( γ + f i ) ∏ i ∈ [ d − 1 ] ( γ + t i ) , G ( γ ) = ∏ i ∈ [ n + d − 1 ] ( γ + s i ) F(\gamma)=\prod_{i\in[n]}(\gamma+f_i)\prod_{i\in[d-1]}(\gamma+t_i), G(\gamma)=\prod_{i\in[n+d-1]}(\gamma+s_i) F(γ)=i[n](γ+fi)i[d1](γ+ti),G(γ)=i[n+d1](γ+si)。同时仍然设置 d = n + 1 d=n+1 d=n+1。】

  • 1)令 s ∈ F 2 n + 1 s\in\mathbb{F}^{2n+1} sF2n+1 ( f , t ) (f,t) (f,t) sorted by t t t。通过两个多项式 h 1 , h 2 ∈ F < n + 1 [ X ] h_1,h_2\in\mathbb{F}_{h1,h2F<n+1[X]来表示 s s s。对于 i ∈ [ n + 1 ] i\in[n+1] i[n+1],有 h 1 ( g i ) = s i h_1(\mathbf{g}^i)=s_i h1(gi)=si h 2 ( g i ) = s n + i h_2(\mathbf{g}^i)=s_{n+i} h2(gi)=sn+i。【其中 g \mathbf{g} g n + 1 n+1 n+1-th root of unity, g n + 1 = 1 \mathbf{g}^{n+1}=1 gn+1=1。有 h 1 ( 1 ) = s n + 1 = h 2 ( g ) h_1(1)=s_{n+1}=h_2(\mathbf{g}) h1(1)=sn+1=h2(g)。】【其中在 n + 1 n+1 n+1位置插入 c ( n − 1 ) c(n-1) c(n1)值,即 h 2 ( g n + 1 ) = c ( n − 1 ) = s n + 1 h_2(\mathbf{g}^{n+1})=c(n-1)=s_{n+1} h2(gn+1)=c(n1)=sn+1

  • 2)Prover P \mathbf{P} P 按如上规则计算出以上多项式 h 1 , h 2 h_1,h_2 h1,h2,将多项式 h 1 , h 2 h_1,h_2 h1,h2发送给理想第三方 I \mathcal{I} I

  • 3)Veriifer V \mathbf{V} V 发送给 P \mathbf{P} P 随机challenge值 β , γ ∈ F \beta,\gamma\in\mathbb{F} β,γF

  • 4)Prover P \mathbf{P} P 计算多项式 Z ∈ F n + 1 [ X ] Z\in\mathbb{F}_{n+1}[X] ZFn+1[X] that aggregates the value F ( γ ) / G ( γ ) F(\gamma)/G(\gamma) F(γ)/G(γ)
    4.a)令 Z ( g ) = 1 Z(\mathbf{g})=1 Z(g)=1
    4.b)当 2 ≤ i ≤ n 2\leq i \leq n 2in时,令:【拆分的思想为与 h 1 , h 2 h_1,h_2 h1,h2呼应。】
    Z ( g i ) = ∏ j < i ( γ + f j ) ∏ 1 ≤ j < i ( γ + t j ) ∏ 1 ≤ j < i ( γ + s j ) ( γ + s n + j ) Z(\mathbf{g}^i)=\frac{\prod_{jZ(gi)=1j<i(γ+sj)(γ+sn+j)j<i(γ+fj)1j<i(γ+tj)
    4.c)令 Z ( g n + 1 ) = 1 Z(\mathbf{g}^{n+1})=1 Z(gn+1)=1

  • 5) P \mathbf{P} P 将多项式 Z Z Z 发送给 I \mathcal{I} I

  • 6) V \mathbf{V} V 验证多项式 Z Z Z确实是如上格式且 Z ( g n + 1 ) = 1 Z(\mathbf{g}^{n+1})=1 Z(gn+1)=1 V \mathbf{V} V 将验证所有的identities x ∈ H = { g , ⋯   , g n + 1 = 1 } \mathbf{x}\in H=\{\mathbf{g},\cdots,\mathbf{g}^{n+1}=1\} xH={g,,gn+1=1},以下等式均成立:【同时已约定 H H H的lagrange base表示为:对 i ∈ [ n + 1 ] i\in[n+1] i[n+1],有 L i ( g i ) = 1 L_i(\mathbf{g}^i)=1 Li(gi)=1;对任意的 j ≠ i j\neq i j=i,有 L i ( g j ) = 0 L_i(\mathbf{g}^j)=0 Li(gj)=0。】
    6.a) L 1 ( x ) ( h 1 ( x ) ) = 0 L_1(\mathbf{x})(h_1(\mathbf{x}))=0 L1(x)(h1(x))=0【约束 s 1 = 0 s_1=0 s1=0,因为判断证明的是 f ⊂ [ 0 , ⋯   ] f\subset [0,\cdots] f[0,]
    6.b) P ( h 1 ( g ⋅ x ) − h 1 ( x ) ) = 0 P(h_1(\mathbf{g}\cdot\mathbf{x})-h_1(\mathbf{x}))=0 P(h1(gx)h1(x))=0【约束 s i + 1 − s i ≤ c s_{i+1}-s_i\leq c si+1sic
    6.c) P ( h 2 ( g ⋅ x ) − h 2 ( x ) ) = 0 P(h_2(\mathbf{g}\cdot\mathbf{x})-h_2(\mathbf{x}))=0 P(h2(gx)h2(x))=0【约束 s i + 1 − s i ≤ c s_{i+1}-s_i\leq c si+1sic
    6.d) L n + 1 ( x ) ( h 1 ( x ) − h 2 ( g ⋅ x ) ) = 0 L_{n+1}(\mathbf{x})(h_1(\mathbf{x})-h_2(\mathbf{g}\cdot\mathbf{x}))=0 Ln+1(x)(h1(x)h2(gx))=0【因为之前有约定 h 1 ( 1 ) = h 2 ( g ) = s n + 1 h_1(1)=h_2(\mathbf{g})=s_{n+1} h1(1)=h2(g)=sn+1
    6.e) L n + 1 ( x ) ( h 2 ( x ) ) = c ⋅ ( n − 1 ) L_{n+1}(\mathbf{x})(h_2(\mathbf{x}))=c\cdot(n-1) Ln+1(x)(h2(x))=c(n1)【约束 s n + 1 = c ⋅ ( n − 1 ) s_{n+1}=c\cdot (n-1) sn+1=c(n1)
    6.f) L n + 1 ( x ) ( Z ( x ) − 1 ) = 0 L_{n+1}(\mathbf{x})(Z(\mathbf{x})-1)=0 Ln+1(x)(Z(x)1)=0
    6.g) ( x − g n + 1 ) Z ( x ) ( γ + f ( x ) ) ( γ + t ( x ) ) = ( x − g n + 1 ) Z ( g ⋅ x ) ( γ + h 2 ( x ) ) ( γ + h 1 ( x ) ) (\mathbf{x}-\mathbf{g}^{n+1})Z(\mathbf{x})(\gamma+f(\mathbf{x}))(\gamma+t(\mathbf{x}))=(\mathbf{x}-\mathbf{g}^{n+1})Z(\mathbf{g}\cdot\mathbf{x})(\gamma+h_2(\mathbf{x}))(\gamma+h_1(\mathbf{x})) (xgn+1)Z(x)(γ+f(x))(γ+t(x))=(xgn+1)Z(gx)(γ+h2(x))(γ+h1(x))【核心思想是计算 Z ( g i ) / Z ( g i + 1 ) Z(\mathbf{g}^{i})/Z(\mathbf{g}^{i+1}) Z(gi)/Z(gi+1)】【此处Verifier的计算具有the highest degree。】
    6.h) L 1 ( x ) ( Z ( x ) − 1 ) = 0 L_1(\mathbf{x})(Z(\mathbf{x})-1)=0 L1(x)(Z(x)1)=0

对应地:
PLOOKUP_第6张图片

参考资料

[1] Plonk cafe的 Strategies for integrating plookup with PLONK
[2] hackmd的 Plonk and PLookup
[3] metastate的 On PLONK and plookup
[4] dusk network的 Audit Plookup Branch #358
[5] tezosagora的 On PLONK and plookup SNARKs
[6] aztec的研究论文系列
[7] Dusk的开发月报

你可能感兴趣的:(零知识证明)