Bulletproofs: Short Proofs for Confidential Transactions and More学习笔记

1. 引言

Benedikt B¨unz、 Jonathan Bootle和 Dan Boneh等人2018年论文《Bulletproofs: Short Proofs for Confidential Transactions and More》中:

  • 提出了Bulletproofs算法——基于discrete logarithm assumption,无需trusted setup,具有short proofs的NIZK算法。(采用Fiat-Shamir heuristic来实现non-interactive。)Bulletproofs尤其适合用于为committed values提供range proofs:
    – 证明a committed value is in a range,仅需要 2 log ⁡ 2 ( n ) + 9 2\log_2(n)+9 2log2(n)+9 group 和 field elements,其中 n n n为range的bit length。
    – Proof generation和verification time均为 O ( n ) O(n) O(n)

  • 现有Bitcoin及其它加密货币隐私交易的range proof size为 O ( n ) O(n) O(n),Bulletproofs将其提高至 2 log ⁡ 2 ( n ) + 9 2\log_2(n)+9 2log2(n)+9

  • Bulletproofs支持对多个range proofs的aggregation,
    – 为了证明来自同一party的 m m m个commitments lie in a given range,可将其aggregate 为 a single proof,并仅需额外再增加 O ( log ⁡ ( m ) ) O(\log(m)) O(log(m)) 个group elements。
    – 为了aggregate proofs from multiple parties,we enable the parties to generate a single proof without revealing their inputs to each other via a simple multi-parity computation (MPC) protocol for constructing Bulletproofs。该多方安全计算协议可为:1)具有constant number of rounds and linear communication或者2)具有a logarithmic number of rounds and logarithmic communication。以CoinJoin混币方案(Maxwell 2013年《 CoinJoin: Bitcoin privacy for the real world》)为例,隐私交易的inputs来自多个parties,可借助MPC protocol,allow multiple parties with secret committed values to jointly generate a single range proof for all their values, without revealing their secret values to each other。

  • 尽管Bulltproofs的verification time为 O ( n ) O(n) O(n),但实际是足够高效的。同时,支持对多个Bulletproofs仅需batch verify,从而进一步提升verify速度。
    verify an aggregation of 16 range proofs的时间与verify 16个ECDSA signatures的时间相当。

Bulletproofs构建在Bootle和Groth等人2016年论文《Efficient Zero-Knowledge Arguments for Arithmetic Circuits in the Discrete Log Setting》算法基础之上,做了如下改进:

  • 将其中的inner product argument的communication complexity降低了3倍。
  • 构建range proofs时,在最后一轮无需为Verifier提供commitment openings。

除了用于range proofs,Bulletproofs还可用于:

  • 为arithmetic circuit提供基于discrete logarithm assumption 无需trusted setup的short 零知识证明算法。其proof size 为 O ( N ) O(\sqrt{N}) O(N ),其中 N N N为multiplication gate的数量。
  • verifiable shuffle。

本文对应的代码实现有:

  • https://github.com/dalek-cryptography/bulletproofs
  • https://github.com/adjoint-io/bulletproofs
  • https://github.com/lovesh/bulletproofs-r1cs-gadgets
  • https://github.com/KZen-networks/bulletproofs
  • https://github.com/akosba/jsnark

https://github.com/akosba/jsnark 中提供了一个通用工具,用于构建Bulletproofs for any NP language,该工具可读取Pinocchio格式的arithmetic circuit,同时包含了将C语言编译为circuit fomat 的编译器。

1.1 背景

基于区块链构建的加密货币支持点对点的价值交互,通过维护全局同步的分布式账本——blockchain。
任何人均可验证区块链中当前状态以及账本中所有交易的有效性。为此,Bitcoin 要求交易中的所有信息均是public的:

  • the sender 交易发起方;
  • the receiver 交易接收方;
  • the amount transferred 交易金额。

所谓隐私支付包含2个属性:

  • 1)anonymity 匿名性,即交易中的发起方和接收方的身份信息均需隐藏;
  • 2)confidentiality 机密性,即交易金额需隐藏。

由于Bitcoin addresses与现实真实身份之间存在unlinkability,Bitcoin提供了弱的anonymity,但是缺少confidentiality。这制约了Bitcoin的一些应用。如雇员并不喜欢被用bitcoin来支付薪水,因为那样他们的薪水金额将发布到public blockchain中。

为了对交易金额实现隐藏,Maxwell 在2016年《Confidential transactions》提出了confidential transactions (CT) 概念,通过对每笔交易金额进行commit实现隐藏。这种方式似乎会影响blockchain的public validation,an observer不再能够判断交易的输入之和是否大于交易的输出之和,以及验证所有的交易输入/输出金额是否为正数。通过为每笔交易提供一个证明隐私交易有效性的证明可以解决该问题。

Poelstra等人在2017年 《 Confidential assets 》中指出,现有的隐私交易零知识证明要么非常大,要么需要trusted setup。

构建同时具有short proof size和不需要trusted setup的零知识证明方案,在加密货币领域很有价值。对于任何分布式系统,若proofs需要通过网络传输或者需要长期存储时,更短的proof size将有助于节约cost。

1.2 相关研究

1)现有的range proofs方案有:

  • Maxwell 2016年《Confidential transactions》中提出了confidential transactions (CT) 概念,通过对每笔交易金额进行commit实现隐藏。这种方式似乎会影响blockchain的public validation,an observer不再能够判断交易的输入之和是否大于交易的输出之和,以及验证所有的交易输入/输出金额是否为正数——即在区间 [ 0 , 2 n ] [0,2^n] [0,2n],其中 2 n 2^n 2n远远小于group size。通过为每笔交易提供一个证明隐私交易有效性的证明可以解决该问题。
  • [Poe] Poelstra 2016年《Mimblewimble
  • Maxwell和Poelstra 2015年《Borromean ring signatures》。
  • Poelstra等人2017年《 Confidential assets 》中通过side-chains来实现隐私交易。
  • Noether等人2016年《Ring confidential transactions》中提出了关注隐私的加密货币Monero。
  • Andreev 2017年《Hidden in Plain Sight: Transacting Privately on a Blockchain》私有链中实现的隐私交易。

以上方案除[Poe] 外都是基于committed values 构建的range proofs,其proof size为 O ( n ) O(n) O(n),这些proof是隐私交易中size的主要贡献者。
现有的Maxwell 2016年《Confidential transactions》实现,对于仅有2个output,32bit精度的隐私交易其大小为5.4KB,而其中5KB是由range proof贡献的。尽管近期有做优化,但range proof大小仍占据3.8KB。

在本文写作时,Bitcoin有来自2200万笔交易的约5000万个UTXOs。使用52-bit 来表示bitcoin从1 satoshi到2100万bitcoin的数值,若使用现有的range proofs方案,大约需要160GB的range proof data。而若采用aggregated Bulletproofs,则将仅需小于17GB的空间,节约了大概10倍的空间。

2)现有的加密货币隐私交易方案有:

  • 以CoinJoin混币方案(Maxwell 2013年《 CoinJoin: Bitcoin privacy for the real world》)为例,隐私交易的inputs来自多个parties,可借助MPC protocol,allow multiple parties with secret committed values to jointly generate a single range proof for all their values, without revealing their secret values to each other。无法建立transaction inputs 和 transaction outputs之间的联系。
  • CoinShuffle [RMSK14] (Ruffing等人2014年论文《CoinShuffle: Practical decentralized coin mixing for Bitcoin》)在CoinJoinh混币方案的基础上,去除了对可信第三方的依赖,实现了完全去中心化的Bitcoin mixing protocol。
  • Monero [Mon] (《Monero - Private Digital Currency》)为采用了密码学技术实现了强隐私保护的加密货币。借助的密码学技术有:
    – stealth address;
    – ring-signatures [vS13];
    – ring confidential transactions [NM+16](Noether等人2016年论文《Ring confidential transactions》)。
  • ZeroCash [BSCG+14] (Ben-Sasson等人2014年论文《 Zerocash: Decentralized anonymous payments from Bitcoin》) 中也提供了隐私保护交易可选项,但是需要expensive transaction generation cost且需要trusted setup。

1.3 Mimblewimble

[Poe] Poelstra 2016年《Mimblewimble》和 Jedusor 2016年 《Mimblewimble》 提出的Mimblewimble协议,可进一步节约存储空间。

  • Jedusor 2016年 《Mimblewimble》中指出:对0的Pedersen commitment可看成是一个ECDSA的公钥,而对于一个有效的隐私交易,其 (inputs-outputs-transaction fees) 必须为0。A prover constructing a confidential transaction can therefore sign the transaction with the difference of the outputs and inputs as the public key. This small change removes the need for a scriptSig which greatly simplifies the structure of confidential transactions。

  • Poelstra 2016年《Mimblewimble》在Jedusor的基础上进一步改进了Mimblewimble协议,所有的spent transactions can be pruned and new nodes can efficiently validate the entire blockchain without downloading any old and spent transactions,从而大幅简化了区块链。进一步优化,可实现高度压缩的区块链,仅需要包含一小部分区块头和剩余的unspent transaction outputs 以及相应的range proofs和 an un-prunable 32 bytes per transaction。
    Mimblewimble协议支持对多个transaction先aggregate,然后再发送给blockchain。

Mimblewimble blockchain会随着UTXO set 的size而增长,而若使用Bulletproofs,其仅随那些具有unspent outputs的transaction数量而增长,unspent outputs的transaction数量远远小于UTXO set 的size。
总之Bulletproofs不仅适于替代现有隐私交易中的range proofs,同时也有助于帮助Mimblewimble成为实用的方案用于构建比现有Bitcoin blockchain更小的blockchain。

1.4 Provisions协议

Dagher等人在2015年论文《Privacy-preserving proofs of solvency for bitcoin exchanges (full version)》中提出了Provisions 协议,用于证明交易所可偿还能力。
该协议中依赖range proofs来防止插入负数金额的账户。当为a large exchange with 200万客户提供证明时需要约18GB的空间,而range proofs 将占据约13GB。
若用Bulletproofs协议替换Provisions协议中的NIZK proof时,the range proofs would take up less than 2KB, the proof for one commitment per customer 的size为62MB,从而将节约将近300倍的空间。

1.5 Verifiable shuffle

Verifiable shuffle是指:对于2组committed值 x 1 , ⋯   , x n x_1,\cdots,x_n x1,,xn y 1 , ⋯   , y n y_1,\cdots,y_n y1,,yn,证明第二组数据为第一组数据的permutation。

verifiable shuffle可用于voting,mixnets以及可偿还能力证明。

verifiable shuffle的衍化有:

若使用Bulletproofs来实现verifiable shuffle,其size可降至 O ( log ⁡ n ) O(\log n) O(logn)——通过sorting circuit 对两组list进行排序,并验证排序后的两组数据相等。该sorting circuit使用 O ( n ⋅ log ⁡ ( n ) ) O(n\cdot\log(n)) O(nlog(n))个乘法门,具有的proof size仅为 O ( log ⁡ ( n ) ) O(\log (n)) O(log(n))。构建proof和验证的时间为 O ( n ) O(n) O(n)

1.6 智能合约的NIZK proofs

以太坊系统通过使用高度表达的智能合约来实现复杂交易。智能合约与其它区块链交易类似,都是public无法提供内在隐私保证。
为了使智能合约具有隐私保护功能,为其引入了NIZK proofs,使得用户输入信息不被泄露,相关的研究有:

以上这些研究中的NIZK proof本身并不适合通过智能合约来verify,因为区块链与智能合约之间的communication是expensive的,且智能合约本身的计算能力也非常有限。

Bulletproofs不需要trusted setup,具有small proof,但是Bulletproofs的verify不便宜,可以通过以下方式来规避:

  • 仅在有人challenge时,smart contract才验证该proof是否正确。激励措施可保证理智的参与方不伪造proof,也不challenge a correct proof。
    也可以借鉴 [BGB17,TR] 中引入交互 referee delagation机制 [CRR11] 来进一步优化。即Prover在提供proof的同时,也提供 a succinct commitment to the verifier’s execution trace。若a challenger不同意该proof,也需要提供a commitment of his computation trace。然后两方参与通过二进制交互搜索来找到这两组computation的第一个分歧点。该协议的一个有趣的地方在于:若a proof is challenged,smart contract仅需验证a single computation step,如 a single gate of the verification circuit。
    将其与Bulletproofs结合使用,可实现more complex but privacy preserving smart contracts。

与其它NIZK proofs可受益于MPC protocol类似,Bulletproofs也可以分布式生成。以拍卖smart contract为例,竞拍者在第一轮将其竞拍金额的commitment发送出去,然后在第二轮open 该commitment。可通过NIZK proof来证明竞拍金额在一定范围里,而不需要reveal。
采用Bulletproofs’ MPC方案,多个竞拍者可以将其Bulletproofs combine为a single proof,从而可以隐藏竞拍者与竞拍金额之间的关联。

1.7 为Arithmetic circuit构建NIZK proof without trusted setup

Common reference string (CRS) 应对Prover和Verifier均已知,在没有CRS的情况下,不可能为general statements构建non-interactive zero-knowledge protocols。

当前为arithmetic circuit satisfiability构建的NIZK proofs有:

以上这些方案除了性能不同之外,其CRS的complexity也不同。Ben-Sasson等人2013年论文《SNARKs for C: verifying program executions succinctly and in Zero Knowledge》中的算法具有highly structured,and sometimes feature a trapdoor,while some are simply chosen uniformly at random。

Security proofs假设CRS为honestly generated,实际上,CRS可由可信第三方或者通过安全多方计算协议来生成。借助安全多方计算协议,可减轻对embedded trapdoors的关注,如Ben-Sasson等人2014年论文《 Zerocash: Decentralized anonymous payments from Bitcoin》中借助trusted setup ceremony来生成public parameters。

SNARKs有大量研究成果,如:

以上这些SNARKs可生成constant-sized proofs for any statement,同时具有非常快的verification time。但是:

另外,若CRS为随机生成的,就如 π \pi π的数字或者假设hash函数behave like a random oracle。现有的不需要trusted setup的NIZK proof有:

对于无需trusted setup的NIZK proof,Ben-Sasson等人的研究路线是:

对于 2 17 2^{17} 217 size 120-bit security 的circuit,Bulletproofs的proof size仅有约1KB。而构建STARKs需要大量的内存,因为STARKs为提供prove效率,引入了大量的FFT计算。

2. 密码学假设及一些定义

2.1 基于的Discret Log Relation假设

Discret Log Relation假设与Discret log assumption等价。
在这里插入图片描述

2.2 一些定义

  • Commitment定义:
    在这里插入图片描述

  • Commitment的加法同态属性:
    在这里插入图片描述

  • Commitment的hiding属性:
    在这里插入图片描述

  • Commitment的binding属性:
    在这里插入图片描述

  • Pedersen Commitment定义:
    在这里插入图片描述

  • Pedersen Vector Commitment定义:
    在这里插入图片描述

  • zero-knowledge arguments of knowledge相关定义:
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

  • zero-knowledge range proof定义:
    在这里插入图片描述

  • 其它约定:
    在这里插入图片描述
    在这里插入图片描述

3. Inner product argument

参看博客 Efficient Zero-Knowledge Arguments for Arithmetic Circuits in the Discrete Log Setting学习笔记,本文对Bootle等人2016年论文《Efficient zero-knowledge arguments for arithmetic circuits in the discrete log setting》的inner product argument算法进行了改进:

  • Communication complexity 由 6 log ⁡ 2 ( n ) 6\log_2 (n) 6log2(n)降为了 2 log ⁡ 2 ( n ) 2\log_2(n) 2log2(n),其中 n n n为vector dimension。

Bootle 2016方案中的基本信息表达为:

  • public info: z ∈ Z p , A , B ∈ G , g ⃗ , h ⃗ ∈ G n z\in\mathbb{Z}_p,A,B\in\mathbb{G},\vec{g},\vec{h}\in\mathbb{G}^n zZp,A,BG,g ,h Gn
  • private info: a ⃗ , b ⃗ \vec{a},\vec{b} a ,b
  • relation: A = g ⃗ a ⃗ ∧ B = h ⃗ b ⃗ ∧ a ⃗ ⋅ b ⃗ = z A=\vec{g}^{\vec{a}}\wedge B=\vec{h}^{\vec{b}}\wedge \vec{a}\cdot\vec{b}=z A=g a B=h b a b =z

本文通过对待证明relation的修改,使得communication complexity 由 6 log ⁡ 2 ( n ) 6\log_2 (n) 6log2(n)降为了 2 log ⁡ 2 ( n ) 2\log_2(n) 2log2(n)。(注意此处的inner product为sound的,但不是zero-knowledge的)
本文的基本信息表达为:

  • public info: c ∈ Z p , P ∈ G , g ⃗ , h ⃗ ∈ G n c\in\mathbb{Z}_p,P\in\mathbb{G},\vec{g},\vec{h}\in\mathbb{G}^n cZp,PG,g ,h Gn
  • private info: a ⃗ , b ⃗ \vec{a},\vec{b} a ,b
  • relation: P = g ⃗ a ⃗ h ⃗ b ⃗ ∧ a ⃗ ⋅ b ⃗ = c P=\vec{g}^{\vec{a}}\vec{h}^{\vec{b}}\wedge \vec{a}\cdot\vec{b}=c P=g a h b a b =c

进一步等价表达为:

  • public info: u , P ∈ G , g ⃗ , h ⃗ ∈ G n u,P\in\mathbb{G},\vec{g},\vec{h}\in\mathbb{G}^n u,PG,g ,h Gn
  • private info: a ⃗ , b ⃗ \vec{a},\vec{b} a ,b
  • relation: P = g ⃗ a ⃗ h ⃗ b ⃗ ⋅ u < a ⃗ ⋅ b ⃗ > P=\vec{g}^{\vec{a}}\vec{h}^{\vec{b}}\cdot u^{<\vec{a}\cdot\vec{b}>} P=g a h b u<a b >

相应的relation等价协议表示为:
在这里插入图片描述
在这里插入图片描述
定义一个hash函数:
H : Z p 2 n + 1 → G H:\mathbb{Z}_p^{2n+1}\rightarrow \mathbb{G} H:Zp2n+1G
设置 n ′ = n / 2 n'=n/2 n=n/2,generators g ⃗ , h ⃗ ∈ G n , u ∈ G \vec{g},\vec{h}\in\mathbb{G}^n,u\in\mathbb{G} g ,h Gn,uG
假设该hash函数的输入为: a ⃗ 1 , a ⃗ 2 ′ , b ⃗ 1 , b ⃗ 2 ′ ∈ Z p n ′ , c ∈ Z p \vec{a}_1,\vec{a}_2',\vec{b}_1,\vec{b}_2'\in\mathbb{Z}_p^{n'},c\in\mathbb{Z}_p a 1,a 2,b 1,b 2Zpn,cZp,输出为:
H ( a ⃗ 1 , a ⃗ 2 ′ , b ⃗ 1 , b ⃗ 2 ′ , c ) = g ⃗ [ : n ′ ] a ⃗ 1 ⋅ g ⃗ [ n ′ : ] a ⃗ 2 ′ ⋅ h ⃗ [ : n ′ ] b ⃗ 1 ⋅ h ⃗ [ n ′ : ] b ⃗ 2 ′ ⋅ u c ∈ G H(\vec{a}_1,\vec{a}_2',\vec{b}_1,\vec{b}_2',c)=\vec{g}_{[:n']}^{\vec{a}_1}\cdot \vec{g}_{[n':]}^{\vec{a}_2'}\cdot \vec{h}_{[:n']}^{\vec{b}_1}\cdot \vec{h}_{[n':]}^{\vec{b}_2'}\cdot u^c \in\mathbb{G} H(a 1,a 2,b 1,b 2,c)=g [:n]a 1g [n:]a 2h [:n]b 1h [n:]b 2ucG

对于此时待证明的relation P P P,可将其表达为是hash 函数的输出:(其中 a ⃗ = a ⃗ [ : n ′ ] ∣ ∣ a ⃗ [ n ′ : ] , b ⃗ = b ⃗ [ : n ′ ] ∣ ∣ b ⃗ [ n ′ : ] \vec{a}=\vec{a}_{[:n']}||\vec{a}_{[n':]},\vec{b}=\vec{b}_{[:n']}||\vec{b}_{[n':]} a =a [:n]a [n:],b =b [:n]b [n:]
P = H ( a ⃗ [ : n ′ ] , a ⃗ [ n ′ : ] , b ⃗ [ : n ′ ] , b ⃗ [ n ′ : ] , < a ⃗ , b ⃗ > ) P=H(\vec{a}_{[:n']},\vec{a}_{[n':]},\vec{b}_{[:n']},\vec{b}_{[n':]},<\vec{a},\vec{b}>) P=H(a [:n],a [n:],b [:n],b [n:],<a ,b >)
可看出,该hash函数具有加法同态属性:
H ( a ⃗ 1 , a ⃗ 1 ′ , b ⃗ 1 , b ⃗ 1 ′ , c 1 ) ⋅ H ( a ⃗ 2 , a ⃗ 2 ′ , b ⃗ 2 , b ⃗ 2 ′ , c 2 ) = H ( a ⃗ 1 + a ⃗ 2 , a ⃗ 1 ′ + a ⃗ 2 ′ , b ⃗ 1 + b ⃗ 2 , b ⃗ 1 ′ + b ⃗ 2 ′ , c 1 + c 2 ) H(\vec{a}_1,\vec{a}_1',\vec{b}_1,\vec{b}_1',c_1)\cdot H(\vec{a}_2,\vec{a}_2',\vec{b}_2,\vec{b}_2',c_2)= H(\vec{a}_1+\vec{a}_2,\vec{a}_1' +\vec{a}_2',\vec{b}_1+\vec{b}_2,\vec{b}_1'+\vec{b}_2',c_1+c_2) H(a 1,a 1,b 1,b 1,c1)H(a 2,a 2,b 2,b 2,c2)=H(a 1+a 2,a 1+a 2,b 1+b 2,b 1+b 2,c1+c2)
H ( a ⃗ 1 , a ⃗ 1 ′ , b ⃗ 1 , b ⃗ 1 ′ , c 1 ) x 1 ⋅ H ( a ⃗ 2 , a ⃗ 2 ′ , b ⃗ 2 , b ⃗ 2 ′ , c 2 ) x 2 = H ( x 1 a ⃗ 1 + x 2 a ⃗ 2 , x 1 a ⃗ 1 ′ + x 2 a ⃗ 2 ′ , x 1 b ⃗ 1 + x 2 b ⃗ 2 , x 1 b ⃗ 1 ′ + x 2 b ⃗ 2 ′ , x 1 c 1 + x 2 c 2 ) H(\vec{a}_1,\vec{a}_1',\vec{b}_1,\vec{b}_1',c_1)^{x_1}\cdot H(\vec{a}_2,\vec{a}_2',\vec{b}_2,\vec{b}_2',c_2)^{x_2}= H(x_1\vec{a}_1+x_2\vec{a}_2,x_1\vec{a}_1' +x_2\vec{a}_2',x_1\vec{b}_1+x_2\vec{b}_2,x_1\vec{b}_1'+x_2\vec{b}_2',x_1c_1+x_2c_2) H(a 1,a 1,b 1,b 1,c1)x1H(a 2,a 2,b 2,b 2,c2)x2=H(x1a 1+x2a 2,x1a 1+x2a 2,x1b 1+x2b 2,x1b 1+x2b 2,x1c1+x2c2)

基本的证明思路为:(二分法)

  • Prover:针对 P = H ( a ⃗ [ : n ′ ] , a ⃗ [ n ′ : ] , b ⃗ [ : n ′ ] , b ⃗ [ n ′ : ] , < a ⃗ , b ⃗ > ) P=H(\vec{a}_{[:n']},\vec{a}_{[n':]},\vec{b}_{[:n']},\vec{b}_{[n':]},<\vec{a},\vec{b}>) P=H(a [:n],a [n:],b [:n],b [n:],<a ,b >),二分法计算:
    L = H ( 0 ⃗ n ′ , a ⃗ [ : n ′ ] , b ⃗ [ n ′ : ] , 0 ⃗ n ′ , < a ⃗ [ : n ′ ] , b ⃗ [ n ′ : ] > ) L=H(\vec{0}^{n'},\vec{a}_{[:n']},\vec{b}_{[n':]},\vec{0}^{n'},<\vec{a}_{[:n']},\vec{b}_{[n':]}>) L=H(0 n,a [:n],b [n:],0 n,<a [:n],b [n:]>)
    R = H ( a ⃗ [ n ′ : ] , 0 ⃗ n ′ , 0 ⃗ n ′ , b ⃗ [ : n ′ ] , < a ⃗ [ n ′ : ] , b ⃗ [ : n ′ ] > ) R=H(\vec{a}_{[n':]},\vec{0}^{n'},\vec{0}^{n'},\vec{b}_{[:n']},<\vec{a}_{[n':]},\vec{b}_{[:n']}>) R=H(a [n:],0 n,0 n,b [:n],<a [n:],b [:n]>)
    L , R ∈ G L,R\in\mathbb{G} L,RG发送给Verifier。
  • Verifier:发送random challenge x ← Z p x\leftarrow \mathbb{Z}_p xZp
  • Prover:计算 a ⃗ ′ = x a ⃗ [ : n ′ ] + x − 1 a ⃗ [ n ′ : ] , b ⃗ ′ = x − 1 b ⃗ [ : n ′ ] + x b ⃗ [ n ′ : ] ∈ Z p n ′ \vec{a}'=x\vec{a}_{[:n']}+x^{-1}\vec{a}_{[n':]}, \vec{b}'=x^{-1}\vec{b}_{[:n']}+x\vec{b}_{[n':]} \in\mathbb{Z}_p^{n'} a =xa [:n]+x1a [n:],b =x1b [:n]+xb [n:]Zpn
    a ⃗ ′ , b ⃗ ′ ∈ Z p n ′ \vec{a}',\vec{b}'\in\mathbb{Z}_p^{n'} a ,b Zpn发送给Verifier。
  • Verifier:输入有 ( L , R , a ⃗ ′ , b ⃗ ′ ) (L,R,\vec{a}',\vec{b}') (L,R,a ,b ),计算 P ′ = L ( x 2 ) ⋅ P ⋅ R x − 2 P'=L^{(x^2)}\cdot P\cdot R^{x^{-2}} P=L(x2)PRx2,然后验证 P ′ = H ( x − 1 a ⃗ ′ , x a ⃗ ′ , x b ⃗ ′ , x − 1 b ⃗ ′ , < a ⃗ ′ , b ⃗ ′ > ) P'=H(x^{-1}\vec{a}',x\vec{a}',x\vec{b}',x^{-1}\vec{b}',<\vec{a}',\vec{b}'>) P=H(x1a ,xa ,xb ,x1b ,<a ,b >)是否成立。

利用加法同态性有:
L ( x 2 ) ⋅ P ⋅ R x − 2 = H ( a ⃗ [ : n ′ ] + x − 2 a ⃗ [ n ′ : ] , x 2 a ⃗ [ : n ′ ] + a ⃗ [ n ′ : ] , b ⃗ [ : n ′ ] + x 2 b ⃗ [ n ′ : ] , x − 2 b ⃗ [ : n ′ ] + b ⃗ [ n ′ : ] , x 2 < a ⃗ [ : n ′ ] , b ⃗ [ n ′ : ] > + < a ⃗ , b ⃗ > + x − 2 < a ⃗ [ n ′ : ] , b ⃗ [ : n ′ ] > ) = H ( x − 1 a ⃗ ′ , x a ⃗ ′ , x b ⃗ ′ , x − 1 b ⃗ ′ , < a ⃗ ′ , b ⃗ ′ > ) L^{(x^2)}\cdot P\cdot R^{x^{-2}}= H(\vec{a}_{[:n']}+x^{-2}\vec{a}_{[n':]}, x^2\vec{a}_{[:n']}+ \vec{a}_{[n':]}, \vec{b}_{[:n']}+x^2\vec{b}_{[n':]}, x^{-2}\vec{b}_{[:n']}+ \vec{b}_{[n':]}, x^2<\vec{a}_{[:n']},\vec{b}_{[n':]}>+ <\vec{a},\vec{b}>+x^{-2}<\vec{a}_{[n':]},\vec{b}_{[:n']}>)=H(x^{-1}\vec{a}',x\vec{a}',x\vec{b}',x^{-1}\vec{b}',<\vec{a}',\vec{b}'>) L(x2)PRx2=H(a [:n]+x2a [n:],x2a [:n]+a [n:],b [:n]+x2b [n:],x2b [:n]+b [n:],x2<a [:n],b [n:]>+<a ,b >+x2<a [n:],b [:n]>)=H(x1a ,xa ,xb ,x1b ,<a ,b >)

以上证明思路,proof为 ( L , R , a ⃗ ′ , b ⃗ ′ ) (L,R,\vec{a}',\vec{b}') (L,R,a ,b ),proof size为 n + 2 n+2 n+2个elements,相比于直接发送 a ⃗ , b ⃗ \vec{a},\vec{b} a ,b 时的 2 n 2n 2n个elements,大约节约了一半的communication cost。

利用递归,可进一步降低communication cost:
根据 P ′ = H ( x − 1 a ⃗ ′ , x a ⃗ ′ , x b ⃗ ′ , x − 1 b ⃗ ′ , < a ⃗ ′ , b ⃗ ′ > ) = ( g ⃗ [ : n ′ ] x − 1 ∘ g ⃗ [ n ′ : ] x ) a ⃗ ′ ⋅ ( h ⃗ [ : n ′ ] x ∘ h ⃗ [ n ′ : ] x − 1 ) b ⃗ ′ ⋅ u < a ⃗ ′ , b ⃗ ′ > P'=H(x^{-1}\vec{a}',x\vec{a}',x\vec{b}',x^{-1}\vec{b}',<\vec{a}',\vec{b}'>)=(\vec{g}_{[:n']}^{x^{-1}}\circ \vec{g}_{[n':]}^x)^{\vec{a}'}\cdot (\vec{h}_{[:n']}^{x}\circ \vec{h}_{[n':]}^{x^{-1}})^{\vec{b}'}\cdot u^{<\vec{a}',\vec{b}'>} P=H(x1a ,xa ,xb ,x1b ,<a ,b >)=(g [:n]x1g [n:]x)a (h [:n]xh [n:]x1)b u<a ,b >
相当于generators由 ( g ⃗ , h ⃗ , u ) (\vec{g},\vec{h},u) (g ,h ,u)变为了 ( g ⃗ [ : n ′ ] x − 1 ∘ g ⃗ [ n ′ : ] x , h ⃗ [ : n ′ ] x ∘ h ⃗ [ n ′ : ] x − 1 , u ) (\vec{g}_{[:n']}^{x^{-1}}\circ \vec{g}_{[n':]}^x, \vec{h}_{[:n']}^{x}\circ \vec{h}_{[n':]}^{x^{-1}},u) (g [:n]x1g [n:]x,h [:n]xh [n:]x1,u),对此可进行递归调用,进一步压缩proof size。
通过 log ⁡ 2 n \log_2 n log2n round 调用,最终的communication cost为 2 ⌈ log ⁡ 2 ( n ) ⌉ 2\left \lceil \log_2(n)\right \rceil 2log2(n)个group elements ∈ G \in\mathbb{G} G 和2个Field elements ∈ Z p \in \mathbb{Z}_p Zp,Prover发送给Verifier的内容依次为:
( L 1 , R 1 ) , ⋯   , ( L log ⁡ 2 n , R log ⁡ 2 n ) , a , b (L_1,R_1),\cdots,(L_{\log_2 n},R_{\log_2 n}),a,b (L1,R1),,(Llog2n,Rlog2n),a,b
其中 a , b ∈ Z p a,b\in\mathbb{Z}_p a,bZp,会在最后一轮发送。

可借助Fiat-Shamir heuristic将以上证明过程转换为non-interactive,此时,Prover的主要计算压力在于 8 n 8n 8n 个group exponentiations,Verifier的主要为 4 n 4n 4n个exponentiations。后续可进一步优化,使得Verifier仅需一个 size为 2 n + 2 log ⁡ ( n ) 2n+2\log(n) 2n+2log(n)的multi-exponentiation计算。

3.1 使用Multi-exponentiation对inner-product verification进行优化

在Protocol 2中,具有 log ⁡ 2 ( n ) \log _2(n) log2(n) round,在每个round,Prover和Verifier均需要计算一组新的generators g ⃗ ′ , h ⃗ ′ \vec{g}',\vec{h}' g ,h 。整个证明过程中这些新generators计算需要 4 n 4n 4n个exponentiations:在第一轮 2 n 2n 2n个,第二轮 2 n 2 \frac{2n}{2} 22n,在第 j j j n 2 j − 1 \frac{n}{2^{j-1}} 2j1n个。
这就意味着,Verifier需要有 4 n 4n 4n个exponentiations计算,通过delay all the exponentiations到最后一轮,可进一步优化为使Verifier仅需一个 size为 2 n + 2 log ⁡ ( n ) 2n+2\log(n) 2n+2log(n)的multi-exponentiation计算。

假设 g , h g,h g,h为最后一轮的generators, x j x_j xj为第 j j j轮的challenge。
在最后一轮,Verifier会验证 g a h b u a ⋅ b = P g^ah^bu^{a\cdot b}=P gahbuab=P是否成立,其中 a , b ∈ Z p a,b\in\mathbb{Z}_p a,bZp是由Prover发送来的。
通过对整个递归过程进行展开,最终 g , h ∈ G g,h\in\mathbb{G} g,hG可由原始的generators g ⃗ , h ⃗ ∈ G n \vec{g},\vec{h}\in\mathbb{G}^n g ,h Gn和challenges ( x 1 , ⋯   , x log ⁡ 2 ( n ) ) (x_1,\cdots,x_{\log_2(n)}) (x1,,xlog2(n))计算而来:
g = ∏ i = 1 n g i s i ∈ G , h = ∏ i = 1 n h i 1 / s i ∈ G g=\prod_{i=1}^{n}g_i^{s_i}\in\mathbb{G},h=\prod_{i=1}^{n}h_i^{1/s_i}\in\mathbb{G} g=i=1ngisiG,h=i=1nhi1/siG
其中 s ⃗ = ( s 1 , ⋯   , s n ) ∈ Z p n \vec{s}=(s_1,\cdots,s_n)\in\mathbb{Z}_p^n s =(s1,,sn)Zpn仅依赖于challenges ( x 1 , ⋯   , x log ⁡ 2 ( n ) ) (x_1,\cdots,x_{\log_2(n)}) (x1,,xlog2(n))
scalars s 1 , ⋯   , s n ∈ Z p s_1,\cdots,s_n\in\mathbb{Z}_p s1,,snZp 的计算公式为:
for i = 1 , ⋯   , n : s i = ∏ j = 1 log ⁡ 2 ( n ) x j b ( i , j ) i=1,\cdots,n:s_i=\prod_{j=1}^{\log_2(n)}x_j^{b(i,j)} i=1,,n:si=j=1log2(n)xjb(i,j)
其中:
b ( i , j ) = { 1  the  j th bit of  i − 1  is  1 − 1  otherwise b(i,j)=\left\{\begin{matrix} 1\text{ the } j\text{th bit of } i-1\text{ is } 1\\ -1\text{ otherwise} \end{matrix}\right. b(i,j)={1 the jth bit of i1 is 11 otherwise

通过delay操作,最后一轮Verifier验证的公式变为:
g ⃗ a ⋅ s ⃗ ⋅ h ⃗ b ⋅ s ⃗ − 1 ⋅ u a ⋅ b = P ⋅ ∏ j = 1 log ⁡ 2 ( n ) L j ( x j 2 ) ⋅ R j ( x j − 2 ) \vec{g}^{a\cdot\vec{s}}\cdot \vec{h}^{b\cdot \vec{s}^{-1}}\cdot u^{a\cdot b}=P\cdot \prod_{j=1}^{\log_2(n)}L_j^{(x_j^2)}\cdot R_j^{(x_j^{-2})} g as h bs 1uab=Pj=1log2(n)Lj(xj2)Rj(xj2)
以上公式中具有一个size为 2 n + 2 log ⁡ 2 ( n ) + 1 2n+2\log_2(n)+1 2n+2log2(n)+1的multi-exponentiation计算。而multi-exponentiation计算相比于分别计算 n n n个独立的exponentiation要快得多。
【可参看博客 Updateable Inner Product Argument with Logarithmic Verifier and Applications 学习笔记 中采用结构化的generators来优化Verifier的工作量。】

4. 基于Bulletproofs构建具有logarithmic size的range proof

4.1 将range proof转换为inner product between two vectors

Bootle和Groth等人2016年论文《Efficient Zero-Knowledge Arguments for Arithmetic Circuits in the Discrete Log Setting》中提出了任意arithmetic circuit的proof system思路。(参见博客 Efficient Zero-Knowledge Arguments for Arithmetic Circuits in the Discrete Log Setting学习笔记

range proof的基本信息表示为:

  • public info: g , h ∈ G , V ∈ G , n g,h\in\mathbb{G},V\in\mathbb{G},n g,hG,VG,n
  • private info: v , γ ∈ Z p v,\gamma\in\mathbb{Z}_p v,γZp
  • relation: V = h γ g v ∧ v ∈ [ 0 , 2 n − 1 ] V=h^{\gamma}g^v\wedge v\in[0,2^n-1] V=hγgvv[0,2n1]

将数值 v v v n n n二进制位表示为 a ⃗ L = ( a 1 , ⋯   , a n ) ∈ { 0 , 1 } n \vec{a}_L=(a_1,\cdots,a_n)\in\{0,1\}^n a L=(a1,,an){0,1}n,则有 < a ⃗ L , 2 ⃗ n > = v <\vec{a}_L,\vec{2}^n>=v <a L,2 n>=v,其中 2 ⃗ n = ( 1 , 2 , 4 , ⋯   , 2 n − 1 ) \vec{2}^n=(1,2,4,\cdots,2^{n-1}) 2 n=(1,2,4,,2n1)。同时也得保证 a ⃗ L \vec{a}_L a L中的每个元素值均只能为0或者1,可表示为:
< a ⃗ L , 2 ⃗ n > = v ∧ a ⃗ R = a ⃗ L − 1 ⃗ n ∧ a ⃗ L ∘ a ⃗ R = 0 ⃗ n <\vec{a}_L,\vec{2}^n>=v \wedge \vec{a}_R=\vec{a}_L-\vec{1}^n\wedge \vec{a}_L\circ \vec{a}_R=\vec{0}^n <a L,2 n>=va R=a L1 na La R=0 n

range proof的基本信息可进一步表示为:

  • public info: g , h ∈ G , g ⃗ , h ⃗ ∈ G n , A , V ∈ G , n g,h\in\mathbb{G}, \vec{g},\vec{h}\in\mathbb{G}^n,A,V\in\mathbb{G},n g,hG,g ,h Gn,A,VG,n
  • private info: v , γ , α ∈ Z p , a ⃗ L , a ⃗ R v,\gamma,\alpha\in\mathbb{Z}_p,\vec{a}_L,\vec{a}_R v,γ,αZp,a L,a R
  • relation: V = h γ g v ∧ A = h α g ⃗ a ⃗ L h ⃗ a ⃗ R V=h^{\gamma}g^v\wedge A=h^{\alpha}\vec{g}^{\vec{a}_L}\vec{h}^{\vec{a}_R} V=hγgvA=hαg a Lh a R and < a ⃗ L , 2 ⃗ n > = v ∧ a ⃗ R = a ⃗ L − 1 ⃗ n ∧ a ⃗ L ∘ a ⃗ R = 0 ⃗ n <\vec{a}_L,\vec{2}^n>=v \wedge \vec{a}_R=\vec{a}_L-\vec{1}^n\wedge \vec{a}_L\circ \vec{a}_R=\vec{0}^n <a L,2 n>=va R=a L1 na La R=0 n

接下来,需要将 < a ⃗ L , 2 ⃗ n > = v ∧ a ⃗ R = a ⃗ L − 1 ⃗ n ∧ a ⃗ L ∘ a ⃗ R = 0 ⃗ n <\vec{a}_L,\vec{2}^n>=v \wedge \vec{a}_R=\vec{a}_L-\vec{1}^n\wedge \vec{a}_L\circ \vec{a}_R=\vec{0}^n <a L,2 n>=va R=a L1 na La R=0 n中的 2 n + 1 2n+1 2n+1个constraints以 random linear combination (chosen by the verifier) 的方式压缩为a single inner product constraint,然后使用Protocol 1来证明the inner product relation。

为了证明a committed vector b ⃗ ∈ Z p n \vec{b}\in\mathbb{Z}_p^n b Zpn 满足 b ⃗ = 0 ⃗ n \vec{b}=\vec{0}^n b =0 n,只需要Verifier发送random challenge y ∈ Z p y\in\mathbb{Z}_p yZp,Prover证明 < b ⃗ , y ⃗ n > = 0 <\vec{b},\vec{y}^n>=0 <b ,y n>=0。若 b ⃗ ≠ 0 ⃗ n \vec{b}\neq\vec{0}^n b =0 n,则根据Schwartz-Zippel Lemma, < b ⃗ , y ⃗ n > = 0 <\vec{b},\vec{y}^n>=0 <b ,y n>=0等式成立的概率不高于 n / p n/p n/p。所以若 < b ⃗ , y ⃗ n > = 0 <\vec{b},\vec{y}^n>=0 <b ,y n>=0,则可让Verifier信服 b ⃗ = 0 ⃗ n \vec{b}=\vec{0}^n b =0 n
因此,Verifier发送random challenge y ∈ Z p y\in\mathbb{Z}_p yZp,Prover需证明的relation可做如下转变:
a ⃗ L ∘ a ⃗ R = 0 ⃗ n ⇒ < a ⃗ L , a ⃗ R ∘ y ⃗ n > = 0 \vec{a}_L\circ \vec{a}_R=\vec{0}^n \Rightarrow <\vec{a}_L,\vec{a}_R\circ \vec{y}^n>=0 a La R=0 n<a L,a Ry n>=0
a ⃗ R = a ⃗ L − 1 ⃗ n ⇒ a ⃗ L − a ⃗ R − 1 ⃗ n = 0 ⃗ n ⇒ < a ⃗ L − a ⃗ R − 1 ⃗ n , y ⃗ n > = 0 \vec{a}_R=\vec{a}_L-\vec{1}^n \Rightarrow \vec{a}_L-\vec{a}_R-\vec{1}^n=\vec{0}^n \Rightarrow <\vec{a}_L-\vec{a}_R-\vec{1}^n ,\vec{y}^n>=0 a R=a L1 na La R1 n=0 n<a La R1 n,y n>=0

Verifier在发送random challenge z ∈ Z p z\in\mathbb{Z}_p zZp,将以上三个relation组合在一起,合并为一个待证明relation:
z 2 ⋅ < a ⃗ L , 2 ⃗ n > + z ⋅ < a ⃗ L − a ⃗ R − 1 ⃗ n , y ⃗ n > + < a ⃗ L , a ⃗ R ∘ y ⃗ n > = z 2 ⋅ v z^2\cdot <\vec{a}_L,\vec{2}^n>+z\cdot <\vec{a}_L-\vec{a}_R-\vec{1}^n ,\vec{y}^n> + <\vec{a}_L,\vec{a}_R\circ \vec{y}^n>=z^2\cdot v z2<a L,2 n>+z<a La R1 n,y n>+<a L,a Ry n>=z2v 【???是否可转为用polynomial commitment来证明???】

将上述等式转换为一个inner product来表示,同时保证inner product结果值为public info( v v v除外):【基本思路为将public info表达式挪到一侧( v v v除外),同时有 y ⃗ n = y ⃗ n ∘ 1 ⃗ n , < a ⃗ R , y ⃗ n > = < 1 ⃗ n , a ⃗ R ∘ y ⃗ n > \vec{y}^n=\vec{y}^n\circ \vec{1}^n, <\vec{a}_R,\vec{y}^n>=<\vec{1}^n,\vec{a}_R\circ \vec{y}^n> y n=y n1 n,<a R,y n>=<1 n,a Ry n>。】
< a ⃗ L − z ⋅ 1 ⃗ n , y ⃗ n ∘ ( a ⃗ R + z ⋅ 1 ⃗ n ) + z 2 ⋅ 2 ⃗ n > = z 2 ⋅ v + δ ( y , z ) <\vec{a}_L-z\cdot\vec{1}^n, \vec{y}^n\circ(\vec{a}_R+z\cdot \vec{1}^n)+z^2\cdot \vec{2}^n>=z^2\cdot v+\delta(y,z) <a Lz1 n,y n(a R+z1 n)+z22 n>=z2v+δ(y,z)
其中 δ ( y , z ) = ( z − z 2 ) < 1 ⃗ n , y ⃗ n > − z 3 < 1 ⃗ n , 2 ⃗ n > ∈ Z p \delta(y,z)=(z-z^2)<\vec{1}^n,\vec{y}^n>-z^3<\vec{1}^n,\vec{2}^n>\in\mathbb{Z}_p δ(y,z)=(zz2)<1 n,y n>z3<1 n,2 n>Zp,Verifier可很容易计算出该值。

此时,Range proof基本信息为:

  • public info: g , h ∈ G , g ⃗ , h ⃗ ∈ G n , A , V ∈ G , n , g,h\in\mathbb{G}, \vec{g},\vec{h}\in\mathbb{G}^n,A,V\in\mathbb{G},n, g,hG,g ,h Gn,A,VG,n,
  • Verifier challenges: y , z ∈ Z p ∗ y,z\in\mathbb{Z}_p^* y,zZp
  • private info: v , γ , α ∈ Z p , a ⃗ L , a ⃗ R ∈ Z p n v,\gamma,\alpha\in\mathbb{Z}_p,\vec{a}_L,\vec{a}_R\in\mathbb{Z}_p^n v,γ,αZp,a L,a RZpn
  • relation: V = h γ g v ∧ A = h α g ⃗ a ⃗ L h ⃗ a ⃗ R V=h^{\gamma}g^v\wedge A=h^{\alpha}\vec{g}^{\vec{a}_L}\vec{h}^{\vec{a}_R} V=hγgvA=hαg a Lh a R and < a ⃗ L − z ⋅ 1 ⃗ n , y ⃗ n ∘ ( a ⃗ R + z ⋅ 1 ⃗ n ) + z 2 ⋅ 2 ⃗ n > = z 2 ⋅ v + δ ( y , z ) <\vec{a}_L-z\cdot\vec{1}^n, \vec{y}^n\circ(\vec{a}_R+z\cdot \vec{1}^n)+z^2\cdot \vec{2}^n>=z^2\cdot v+\delta(y,z) <a Lz1 n,y n(a R+z1 n)+z22 n>=z2v+δ(y,z)
    其中 δ ( y , z ) = ( z − z 2 ) < 1 ⃗ n , y ⃗ n > − z 3 < 1 ⃗ n , 2 ⃗ n > ∈ Z p \delta(y,z)=(z-z^2)<\vec{1}^n,\vec{y}^n>-z^3<\vec{1}^n,\vec{2}^n>\in\mathbb{Z}_p δ(y,z)=(zz2)<1 n,y n>z3<1 n,2 n>Zp

在这里插入图片描述

若Prover直接将以上inner product中的两个vectors c ⃗ = a ⃗ L − z ⋅ 1 ⃗ n \vec{c}=\vec{a}_L-z\cdot\vec{1}^n c =a Lz1 n d ⃗ = y ⃗ n ∘ ( a ⃗ R + z ⋅ 1 ⃗ n ) + z 2 ⋅ 2 ⃗ n \vec{d}=\vec{y}^n\circ(\vec{a}_R+z\cdot \vec{1}^n)+z^2\cdot \vec{2}^n d =y n(a R+z1 n)+z22 n 直接发送给Verifier,Verifier可直接验证 C o m ( < c ⃗ , d ⃗ > − δ ( y , z ) ) = C o m ( v ) z 2 Com(<\vec{c},\vec{d}>-\delta(y,z))=Com(v)^{z^2} Com(<c ,d >δ(y,z))=Com(v)z2是否成立即可。
但是,直接发送vectors会泄露 a ⃗ L \vec{a}_L a L信息,从而进一步泄露 v v v值,为了解决该问题,需引入 s ⃗ L , s ⃗ R ∈ Z p n \vec{s}_L,\vec{s}_R\in\mathbb{Z}_p^n s L,s RZpn来blind要发送的vectors。

在这里插入图片描述
借助Vector polynomials inner product来构建 l ( X ) ⃗ , r ( X ) ⃗ ∈ Z p n [ X ] \vec{l(X)},\vec{r(X)}\in\mathbb{Z}_p^n[X] l(X) ,r(X) Zpn[X]
l ( X ) ⃗ = ( a ⃗ L − z ⋅ 1 ⃗ n ) + s ⃗ L ⋅ X ∈ Z p n [ X ] \vec{l(X)}= (\vec{a}_L-z\cdot\vec{1}^n) +\vec{s}_L \cdot X \in\mathbb{Z}_p^n[X] l(X) =(a Lz1 n)+s LXZpn[X]
r ( X ) ⃗ = y ⃗ n ∘ ( a ⃗ R + z ⋅ 1 ⃗ n + s ⃗ R ⋅ X ) + z 2 ⋅ 2 ⃗ n ∈ Z p n [ X ] \vec{r(X)}= \vec{y}^n\circ(\vec{a}_R+z\cdot \vec{1}^n+\vec{s}_R\cdot X)+z^2\cdot \vec{2}^n \in\mathbb{Z}_p^n[X] r(X) =y n(a R+z1 n+s RX)+z22 nZpn[X]
t ( X ) = < l ( X ) ⃗ , r ( X ) ⃗ > = t 0 + t 1 ⋅ X + t 2 ⋅ X 2 ∈ Z p [ X ] t(X)=<\vec{l(X)},\vec{r(X)}>=t_0+t_1\cdot X+t_2\cdot X^2 \in\mathbb{Z}_p[X] t(X)=<l(X) ,r(X) >=t0+t1X+t2X2Zp[X]

可发现 t ( X ) t(X) t(X)中的常量部分代表的即为待证明内容:
< a ⃗ L − z ⋅ 1 ⃗ n , y ⃗ n ∘ ( a ⃗ R + z ⋅ 1 ⃗ n ) + z 2 ⋅ 2 ⃗ n > = z 2 ⋅ v + δ ( y , z ) <\vec{a}_L-z\cdot\vec{1}^n, \vec{y}^n\circ(\vec{a}_R+z\cdot \vec{1}^n)+z^2\cdot \vec{2}^n>=z^2\cdot v+\delta(y,z) <a Lz1 n,y n(a R+z1 n)+z22 n>=z2v+δ(y,z)
其中 δ ( y , z ) = ( z − z 2 ) < 1 ⃗ n , y ⃗ n > − z 3 < 1 ⃗ n , 2 ⃗ n > ∈ Z p \delta(y,z)=(z-z^2)<\vec{1}^n,\vec{y}^n>-z^3<\vec{1}^n,\vec{2}^n>\in\mathbb{Z}_p δ(y,z)=(zz2)<1 n,y n>z3<1 n,2 n>Zp
而blinding vectors s ⃗ L \vec{s}_L s L s ⃗ R \vec{s}_R s R可保证Prover在发送 l ( x ) ⃗ , r ( x ) ⃗ , x ∈ Z p ∗ \vec{l(x)},\vec{r(x)},x\in\mathbb{Z}_p^* l(x) ,r(x) ,xZp时不会泄露任何的 a ⃗ L \vec{a}_L a L a ⃗ R \vec{a}_R a R信息。

t ( x ) t(x) t(x)的常量部分表示为 t 0 t_0 t0,接下来即需要Prover证明:
t 0 = z 2 ⋅ v + δ ( y , z ) t_0=z^2\cdot v+\delta(y,z) t0=z2v+δ(y,z)
对系数 t 1 , t 2 t_1,t_2 t1,t2进行commitment,同时对任意的点 x ∈ Z p ∗ x\in\mathbb{Z}_p^* xZp,转为证明对多项式 t ( X ) t(X) t(X)多项式的evaluation值确实为 t ( x ) t(x) t(x)
为此基本信息为:

  • public info: g , h ∈ G , g ⃗ , h ⃗ ∈ G n , A , V , S ∈ G , n g,h\in\mathbb{G}, \vec{g},\vec{h}\in\mathbb{G}^n,A,V,S\in\mathbb{G},n g,hG,g ,h Gn,A,V,SG,n and l ⃗ , r ⃗ ∈ Z p n , t ^ ∈ Z p \vec{l},\vec{r}\in\mathbb{Z}_p^n,\hat{t}\in\mathbb{Z}_p l ,r Zpn,t^Zp and T 1 , T 2 ∈ G T_1,T_2\in\mathbb{G} T1,T2G
  • Verifier challenges: y , z , x ∈ Z p ∗ y,z,x\in\mathbb{Z}_p^* y,z,xZp
  • private info: v , γ , α ∈ Z p , a ⃗ L , a ⃗ R ∈ Z p n , ρ ∈ Z p , s ⃗ L , s ⃗ R ∈ Z p n v,\gamma,\alpha\in\mathbb{Z}_p,\vec{a}_L,\vec{a}_R\in\mathbb{Z}_p^n,\rho\in\mathbb{Z}_p,\vec{s}_L,\vec{s}_R\in\mathbb{Z}_p^n v,γ,αZp,a L,a RZpn,ρZp,s L,s RZpn and t 1 , t 2 ∈ Z p , τ 1 , τ 2 ∈ Z p t_1,t_2\in\mathbb{Z}_p,\tau_1,\tau_2\in\mathbb{Z}_p t1,t2Zp,τ1,τ2Zp
  • relation: V = h γ g v ∧ A = h α g ⃗ a ⃗ L h ⃗ a ⃗ R ∧ S = h ρ g ⃗ s ⃗ L h ⃗ s ⃗ R ∧ T 1 = h τ 1 g t 1 ∧ T 2 = h τ 2 g t 2 ∧ t ^ = < l ⃗ , r ⃗ > V=h^{\gamma}g^v\wedge A=h^{\alpha}\vec{g}^{\vec{a}_L}\vec{h}^{\vec{a}_R}\wedge S=h^{\rho}\vec{g}^{\vec{s}_L}\vec{h}^{\vec{s}_R}\wedge T_1=h^{\tau_1}g^{t_1}\wedge T_2=h^{\tau_2}g^{t_2}\wedge \hat{t}=<\vec{l},\vec{r}> V=hγgvA=hαg a Lh a RS=hρg s Lh s RT1=hτ1gt1T2=hτ2gt2t^=<l ,r > and l ⃗ = l ( x ) ⃗ = ( a ⃗ L − z ⋅ 1 ⃗ n ) + s ⃗ L ⋅ x ∈ Z p n \vec{l}=\vec{l(x)}= (\vec{a}_L-z\cdot\vec{1}^n) +\vec{s}_L \cdot x \in\mathbb{Z}_p^n l =l(x) =(a Lz1 n)+s LxZpn
    r ⃗ = r ( x ) ⃗ = y ⃗ n ∘ ( a ⃗ R + z ⋅ 1 ⃗ n + s ⃗ R ⋅ x ) + z 2 ⋅ 2 ⃗ n ∈ Z p n \vec{r}=\vec{r(x)}= \vec{y}^n\circ(\vec{a}_R+z\cdot \vec{1}^n+\vec{s}_R\cdot x)+z^2\cdot \vec{2}^n \in\mathbb{Z}_p^n r =r(x) =y n(a R+z1 n+s Rx)+z22 nZpn

在这里插入图片描述
注意:
A = C o m c k ( a ⃗ L , a ⃗ R ; α ) = h α g ⃗ a ⃗ L h ⃗ a ⃗ R = C o m c k ′ ( a ⃗ L , y ⃗ n ∘ a ⃗ R ; α ) = h α g ⃗ a ⃗ L h ⃗ ′ ( y ⃗ n ∘ a ⃗ R ) A=Com_{ck}(\vec{a}_L,\vec{a}_R;\alpha)=h^{\alpha}\vec{g}^{\vec{a}_L}\vec{h}^{\vec{a}_R}=Com_{ck'}(\vec{a}_L,\vec{y}^n\circ\vec{a}_R;\alpha)=h^{\alpha}\vec{g}^{\vec{a}_L}\vec{h}'^{(\vec{y}^n\circ\vec{a}_R)} A=Comck(a L,a R;α)=hαg a Lh a R=Comck(a L,y na R;α)=hαg a Lh (y na R),其中 h ⃗ ′ = h ⃗ y ⃗ − n = ( h 1 , h 2 ( y − 1 ) , h 3 ( y − 2 ) , ⋯   , h n ( y − n + 1 ) ) \vec{h}'=\vec{h}^{\vec{y}^{-n}}=(h_1,h_2^{(y^{-1})},h_3^{(y^{-2})},\cdots,h_n^{(y^{-n+1})}) h =h y n=(h1,h2(y1),h3(y2),,hn(yn+1))
同理对 C o m c k ′ ( s ⃗ L , s ⃗ R ∘ y ⃗ n ) Com_{ck'}(\vec{s}_L,\vec{s}_R\circ\vec{y}^n) Comck(s L,s Ry n)
从而Verifier可利用commitment同态属性来进行验证:

在这里插入图片描述

4.2 实现range proof的inner product argument

相比于4.1节的直接发送整个 l ⃗ , r ⃗ \vec{l},\vec{r} l ,r 长度为 2 ⋅ n 2\cdot n 2n个elements,可利用
第三节的Inner product argument实现logarithmic size 2 ⋅ ⌈ log ⁡ 2 ( n ) ⌉ + 2 2\cdot \left \lceil \log_2 (n)\right \rceil+2 2log2(n)+2个elements,最终整个range proof size为 2 ⋅ ⌈ log ⁡ 2 ( n ) ⌉ + 4 2\cdot \left \lceil \log_2 (n)\right \rceil+4 2log2(n)+4个elements in G \mathbb{G} G 和 5个group elements in Z p \mathbb{Z}_p Zp

注意此时的基本信息为:

  • Public info: ( g ⃗ , h ⃗ ′ , P h − μ , t ^ ) (\vec{g},\vec{h}',Ph^{-\mu},\hat{t}) (g ,h ,Phμ,t^)
  • Private info: l ⃗ , r ⃗ \vec{l},\vec{r} l ,r
  • Relation: t ^ = < l ⃗ , r ⃗ > ∧ P h − μ = g ⃗ l ⃗ ⋅ h ⃗ ′ r ⃗ \hat{t}=<\vec{l},\vec{r}>\wedge Ph^{-\mu}=\vec{g}^{\vec{l}}\cdot\vec{h}'^{\vec{r}} t^=<l ,r >Phμ=g l h r

4.3 aggregate m m m个range proofs into one short proof

Dagher等人在2015年论文《Privacy-preserving proofs of solvency for bitcoin exchanges (full version)》中提出了Provisions 协议,用于证明交易所可偿还能力。Provision 协议中要求为每个账号金额均提供range proof。
所以,希望perform a proof for m m m values which is more efficient than conducting m m m individual range proofs。
relation表示为:
在这里插入图片描述
m m m个values,每个value具有 n n n bits直接拼接在一起,然后为这 n ⋅ m n\cdot m nm bits提供range proof,具体思路为:
在这里插入图片描述
相比于直接发送 n ⋅ m n\cdot m nmbits信息,利用Bulletproofs的inner product argument算法,对 m m m个值的range proof size 可压缩为 2 ⋅ ⌈ log ⁡ 2 ( n ⋅ m ) ⌉ + 4 2\cdot \left \lceil \log_2 (n\cdot m)\right \rceil+4 2log2(nm)+4个elements in G \mathbb{G} G 和 5个group elements in Z p \mathbb{Z}_p Zp。这仅比单个value的range proof size 增加 2 ⋅ log ⁡ 2 ( m ) 2\cdot \log_2(m) 2log2(m) 个elements。

在这里插入图片描述

4.4 实现非交互式range proof

借助Fiat-Shamir heuristic,可将以上interactive protocol转换为non-interactive protocol,如 y = H ( A , S ) , z = H ( A , S , y ) y=H(A,S),z=H(A,S,y) y=H(A,S),z=H(A,S,y)

同时,为了避免trusted setup,也可以用hash函数来生成public parameters ( g ⃗ , h ⃗ , g , h ) (\vec{g},\vec{h},g,h) (g ,h ,g,h) from a small seed。该hash函数需要能map from { 0 , 1 } ∗ \{0,1\}^* {0,1} to G ∖ { 1 } \mathbb{G}\setminus \{1\} G{1},可基于2001年Boneh等人论文《 Short signatures from the weil pairing》中算法进行实现。或者也可以通过provide random access into the public parameters来实现,如使用a common random string。

4.5 MPC protocol for Bulletproofs

multiple parties may want to create a single joined confidential transaction, where each party knows some of the inputs and outputs and needs to create range proofs for their known outputs,满足 the joint transaction would not only be smaller than the sum of multiple transactions,同时可隐藏inputs与outputs的对应关系:
一种可实现方式是CoinJoin混币方案(Maxwell 2013年《 CoinJoin: Bitcoin privacy for the real world》)。

Dagher等人在2015年论文《Privacy-preserving proofs of solvency for bitcoin exchanges (full version)》中提出的Provisions 协议中,交易所需要将私钥分发给多台服务器,同时需要将用户数据库拆分为不同的chunks,但是仍能提供 a single short proof of solvency。

为了将来自于多方的range proofs aggregate 为 a single range proof,是否允许各方在补共享所有witness的情况下,生成一个Bulletproof?
解决方案之一是:采用安全多方计算技术来生成a single proof,但是可能会too expensive and incur significant communication costs。
因此,需要针对Bulletproofs专门设计一个简单的MPC协议。

注意4.3节的aggregate range proofs中,the inputs of one range proof do not affect the output of another range proof。
根据Bulletproofs的结构化特点,可理解为 m m m 方每方都有一个Pedersen commitment ( V k ) k = 1 m (V_k)_{k=1}^m (Vk)k=1m,同时每方都可生成a single Bulletproof that each V k V_k Vk commits to a number in some fixed range。
存在两种实现方式:

  • constant rounds,但communication cost与 m m m和the binary encoding of the range均呈线性关系;
  • logarithmic rounds,同时communication cost仅与 m m m呈线性关系。

假设 m m m为2的幂值,采用类似4.3节中的aggregate range proof表示,但是使用 k k k来表示an index to denote the k k kth party’s message。 A ( k ) A^{(k)} A(k)的生成方式与 A A A类似,但是仅需要使用第 k k k方的inputs。

整个为Bulletproofs设计的MPC protocol流程如下:
在这里插入图片描述

4.6 如何构建量子安全的range proof

Bulletproofs在discrete logarithm assumption下具有binding属性。对于加密货币来说,binding属性的破坏远比hiding属性影响更大,binding属性的破坏将导致空气币的产生。

需要注意:
discrete logarithm assumption仅对classical computers成立,对于量子计算机并不成立。
在这里插入图片描述

5. Arithmetic Circuits的zero-knowledge proof

Bootle和Groth等人2016年论文《Efficient Zero-Knowledge Arguments for Arithmetic Circuits in the Discrete Log Setting》中构建的arithmetic circuit proof size为 6 log ⁡ 2 ( n ) + 13 6\log_2(n)+13 6log2(n)+13个elements(其中group elements 4 log ⁡ 2 ( n ) + 7 4\log_2(n)+7 4log2(n)+7个,field elements 2 log ⁡ 2 ( n ) + 6 2\log_2(n)+6 2log2(n)+6个, n n n为circuit中乘法门个数。)。
而本文通过对inner product argument的改进,可将arithmetic circuit proof size降为 2 log ⁡ 2 ( n ) + 13 2\log_2(n)+13 2log2(n)+13个,同时为circuit增加了committed input wires 支持。
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

6. 对range proof的性能优化

  • 采用3.1节类似的方式,将通过delay all the exponentiations到最后一轮,可进一步优化为使Verifier仅需一个 size为 2 n + 2 log ⁡ ( n ) + 7 2n+2\log(n)+7 2n+2log(n)+7的multi-exponentiation计算。
    在这里插入图片描述
  • 计算scalars,针对上图(105)公式计算,计算challenge product方式改为:using only one multiplication in Z p \mathbb{Z}_p Zp by applying batch inversion。
    在这里插入图片描述
  • 实现batch verification,基本思路为:
    为证明 g x = 1 ∧ g y = 1 g^x=1\wedge g^y=1 gx=1gy=1,则对任意的challenge α \alpha α,若 g α ⋅ x + y = 1 g^{\alpha\cdot x+y}=1 gαx+y=1,则大概率 g x = 1 ∧ g y = 1 g^x=1\wedge g^y=1 gx=1gy=1成立。

    在这里插入图片描述
  • 7
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
Casola, V., & Castiglione, A. (2020). Secure and Trustworthy Big Data Storage. Springer. Corriveau, D., Gerrish, B., & Wu, Z. (2020). End-to-end Encryption on the Server: The Why and the How. arXiv preprint arXiv:2010.01403. Dowsley, R., Nascimento, A. C. A., & Nita, D. M. (2021). Private database access using homomorphic encryption. Journal of Network and Computer Applications, 181, 103055. Hossain, M. A., Fotouhi, R., & Hasan, R. (2019). Towards a big data storage security framework for the cloud. In Proceedings of the 9th Annual Computing and Communication Workshop and Conference (CCWC), Las Vegas, USA (pp. 402-408). Rughani, R. (2019). Analysis of Security Issues and Their Solutions in Cloud Storage Environment. International Journal of Computer Trends and Technology (IJCTT), 67(6), 37-42. van Esbroeck, A. (2019). Zero-Knowledge Proofs in the Age of Cryptography: Preventing Fraud Without Compromising Privacy. Chicago-Kent Journal of Intellectual Property, 19, 374. Berman, L. (2021). Watch out for hidden cloud costs. CFO Dive. Retrieved from https://www.cfodive.com/news/watch-out-for-hidden-cloud-costs/603921/ Bradley, T. (2021). Cloud storage costs continue to trend downward. Forbes. Retrieved from https://www.forbes.com/sites/tonybradley/2021/08/27/cloud-storage-costs-continue-to-trend-downward/?sh=6f9d6ade7978 Cisco. (2019). Cost optimization in the multicloud. Cisco. Retrieved from https://www.cisco.com/c/dam/en/us/solutions/collateral/data-center-virtualization/cloud-cost-optimization/cost-optimization_in_multicloud.pdf IBM. (2020). Storage efficiency solutions. IBM. Retrieved from https://www.ibm.com/blogs/systems/storage-efficiency-solutions/ Microsoft Azure. (n.d.). Azure Blob storage tiers. Microsoft Azure. Retrieved from https://azure.microsoft.com/en-us/services/storage/blobs/#pricing Nawrocki, M. (2019). The benefits of a hybrid cloud strategy for businesses. DataCenterNews. Retrieved from https://datacenternews.asia/story/the-benefits-of-a-hybrid-cloud-strategy-for,请把这一段reference list改为标准哈佛格式
05-29
Casola, V. & Castiglione, A. (2020) 'Secure and Trustworthy Big Data Storage', Springer. Corriveau, D., Gerrish, B. & Wu, Z. (2020) 'End-to-end Encryption on the Server: The Why and the How', arXiv preprint arXiv:2010.01403. Dowsley, R., Nascimento, A. C. A. & Nita, D. M. (2021) 'Private database access using homomorphic encryption', Journal of Network and Computer Applications, 181, p.103055. Hossain, M. A., Fotouhi, R. & Hasan, R. (2019) 'Towards a big data storage security framework for the cloud', in Proceedings of the 9th Annual Computing and Communication Workshop and Conference (CCWC), Las Vegas, USA, pp. 402-408. Rughani, R. (2019) 'Analysis of Security Issues and Their Solutions in Cloud Storage Environment', International Journal of Computer Trends and Technology (IJCTT), 67(6), pp. 37-42. van Esbroeck, A. (2019) 'Zero-Knowledge Proofs in the Age of Cryptography: Preventing Fraud Without Compromising Privacy', Chicago-Kent Journal of Intellectual Property, 19, p.374. Berman, L. (2021) 'Watch out for hidden cloud costs', CFO Dive. [online] Available at: https://www.cfodive.com/news/watch-out-for-hidden-cloud-costs/603921/ (Accessed: 5 October 2021). Bradley, T. (2021) 'Cloud storage costs continue to trend downward', Forbes. [online] Available at: https://www.forbes.com/sites/tonybradley/2021/08/27/cloud-storage-costs-continue-to-trend-downward/?sh=6f9d6ade7978 (Accessed: 5 October 2021). Cisco. (2019) 'Cost optimization in the multicloud', Cisco. [online] Available at: https://www.cisco.com/c/dam/en/us/solutions/collateral/data-center-virtualization/cloud-cost-optimization/cost-optimization_in_multicloud.pdf (Accessed: 5 October 2021). IBM. (2020) 'Storage efficiency solutions', IBM. [online] Available at: https://www.ibm.com/blogs/systems/storage-efficiency-solutions/ (Accessed: 5 October 2021). Microsoft Azure. (n.d.) 'Azure Blob storage tiers', Microsoft Azure. [online] Available at: https://azure.microsoft.com/en-us/services/storage/blobs/#pricing (Accessed: 5 October 2021). Nawrocki, M. (2019) 'The benefits of a hybrid cloud strategy for businesses', DataCenterNews. [online] Available at: https://datacenternews.asia/story/the-benefits-of-a-hybrid-cloud-strategy-for (Accessed: 5 October 2021).

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值