nil Foundation的Placeholder证明系统(2)
前序博客:
- nil Foundation的Placeholder证明系统(1)
=nil; Foundation团队2022年11月论文《Placeholder证明系统》。[2022年11月29日版本]
8. 优化
8.1 Batched FRI
不同于单独检查每个commitment,可对其进行FRI聚合。如对多项式f0,⋯,fkf_0,\cdots,f_kf0,⋯,fk:
- 1)从transcript中获取θ\thetaθ。
- 2)计算f=f0⋅θk−1+⋯+fkf=f_0\cdot \theta^{k-1}+\cdots+f_kf=f0⋅θk−1+⋯+fk。
- 3)基于fff运行FRI,using oracles to f0,⋯,fkf_0,\cdots,f_kf0,⋯,fk。
从而可对所有committed polynomials只允许依次FRI实例。详细参看RedShift论文。
8.2 Hash By Column
不同于对每个多项式都进行commit,可对多个多项式采用相同的Merkle tree,这样可降低Prover所需提供的Merkle tree paths数量。
详细参看RedShift论文。
8.3 Hash By Subset
每个i+1i+1i+1 FRI round假定Prover发送all elements from a coset H∈D(i)H\in D^{(i)}H∈D(i)。每个Merkle leaf可包含the whole coset instead of separate values。
详细参看RedShift论文。不过RedShift作者在每个leaf中使用了更多的values,从而具有更好的性能。
8.4 FRI PoW
待续。。。。
9. Placeholder参数
本节重点讨论Placeholder参数 及其对协议安全和性能的影响。
9.1 FRI参数
令RS[F,D,ρ]\mathbf{RS}[\mathbb{F},D,\rho]RS[F,D,ρ]为Reed-Solomon code family。此处有∣D∣=n=2k,ρ=2−R(k,RN)|D|=n=2^k,\rho=2^{-R}(k,R\mathbb{N})∣D∣=n=2k,ρ=2−R(k,RN)。这意味着committing polynomials的degree bound为d=2k−Rd=2^{k-R}d=2k−R。
令r∈[1,logd=n^]r\in [1,\log d=\hat{n}]r∈[1,logd=n^]为FRI inner rounds数,lll为repetition参数。
相应的:
- Prover:O(n)\mathcal{O}(n)O(n)
- Verifier:O(logn)\mathcal{O}(\log n)O(logn)
对于每个ϵ∈(0,1]\epsilon\in (0,1]ϵ∈(0,1],令Jϵ:[0,1]→[0,1]J_{\epsilon}:[0,1]\rightarrow [0,1]Jϵ:[0,1]→[0,1]函数为:
Jϵ(X)=1−1−X(1−ϵ)J_{\epsilon}(X)=1-\sqrt{1-X(1-\epsilon)}Jϵ(X)=1−1−X(1−ϵ)
假设Δ(f,RS)=δ>0\Delta(f,\mathbf{RS})=\delta>0Δ(f,RS)=δ>0,则根据Eli Ben-Sasson 2019年论文 DEEP-FRI: Sampling Outside the Box Improves Soundness,相应的soundness error上限为:
err(δ)=2log∣D∣ϵ3∣F∣+(1−min{δ0,Jϵ(1−ρ)}+ϵlog∣D∣)l\mathbf{err}(\delta)=\frac{2\log |D|}{\epsilon^3|\mathbb{F}|}+(1-\min\{\delta_0,J_{\epsilon}(1-\rho)\}+\epsilon \log |D|)^lerr(δ)=ϵ3∣F∣2log∣D∣+(1−min{δ0,Jϵ(1−ρ)}+ϵlog∣D∣)l
9.2 Placeholder参数
当前可将circuit parameters用于FRI commitments。
令ddd为the smallest power of two,使得d≥Nrowsd\geq N_{rows}d≥Nrows。在Placeholder中,ddd定义为the highest degree of polynomials that can be committed by FRI instance。
令www为ddd-th root of unity。有d=2n^d=2^{\hat{n}}d=2n^,且n^≥Nrows\hat{n}\geq N_{rows}n^≥Nrows。
用RS[F,D,ρ]\mathbf{RS}[\mathbb{F},D,\rho]RS[F,D,ρ]来表示FRI commitments,其中:
- F\mathbb{F}F:与PLONK arithmetization中的field相同。
- DDD:为domain of n=2k=2n^+Rn=2^k=2^{\hat{n}+R}n=2k=2n^+R root of unity。
- ρ=2−R\rho=2^{-R}ρ=2−R:为可调整的参数。
Soundness error定义为:
ϵπ(δ)≤max(ϵFRI(δ),ϵIOPN,1F)\epsilon_{\pi}(\delta)\leq\max(\epsilon_{FRI}(\delta),\epsilon_{IOP}^N, \frac{1}{\mathbb{F}})ϵπ(δ)≤max(ϵFRI(δ),ϵIOPN,F1)
其中,ϵIOPN=(Jp,ν)8⋅4nF/D\epsilon_{IOP}^N=(J_{p,\nu })^8\cdot \frac{4n}{\mathbb{F}/D}ϵIOPN=(Jp,ν)8⋅F/D4n
令log∣F∣=255,ν=∣F∣−1/20,D=228\log |\mathbb{F}|=255,\nu=|\mathbb{F}|^{-1/20},D=2^{28}log∣F∣=255,ν=∣F∣−1/20,D=228,其对ϵIOPN\epsilon_{IOP}^NϵIOPN的error contribution量级为2−1282^{-128}2−128。
令ρ=1/16\rho=1/16ρ=1/16,根据上面的FRI error公式,为达到80 bits security ,需要40个verifier queries(λ\lambdaλ)。
【注意,以上参数并未考虑借助”grinding“技术,可进一步降低queries数量。】
10. Circuit性能评估
关键标识有:
标识 | 含义 |
---|---|
nnn(对应之前NrowsN_{rows}Nrows) | Rows的数量 |
NwitnessN_{witness}Nwitness | Witness Columns(又名”Advice Columns“)的数量 |
NpermN_{perm}Nperm | 包含在Permutation Argument中的Witness Columns数量 |
NselN_{sel}Nsel | Circuit中所使用的Selectors数量 |
NlookupN_{lookup}Nlookup | |
NcN_cNc | |
NPIN_{PI}NPI | |
wiw_iwi | |
cj(i)c_j^{(i)}cj(i) | |
gatei\mathbf{gate}_igatei | Gate Polynomials,0≤i<Nsel0\leq i<N_{sel}0≤i<Nsel。 |
PIiPI_iPIi | |
σ(col:i,row:j)=(col:i′,row:j′)\sigma(col:\ i, row:\ j)=(col:\ i', row:\ j')σ(col: i,row: j)=(col: i′,row: j′) | Permutation over the Table |
o\mathbf{o}o | |
fi\mathbf{f}_ifi | Witness polynomials,0≤i<Nwitness0\leq i < N_{witness}0≤i<Nwitness |
fci\mathbf{f}_{c_i}fci | Constant-related polynomials,0≤i<Nconst0\leq i < N_{const}0≤i<Nconst |
HcH_cHc | Commitment hash |
HrH_rHr | Random Oracle hash |
lHcl_{H_c}lHc | Number of bits in commitment hash |
lHrl_{H_r}lHr | Number of bits in random oracle hash |
10.1 Proof Size
Proof中包含:
- f0,comm,⋯,fNwitness−1,commf_{0,comm},\cdots,f_{N_{witness}-1,comm}f0,comm,⋯,fNwitness−1,comm:对witness多项式的承诺值。
- Acomm′,Scomm′A'_{comm},S'_{comm}Acomm′,Scomm′:为lookup承诺值。
- Pcomm,QcommP_{comm},Q_{comm}Pcomm,Qcomm
- VcommV_{comm}Vcomm:lookup相关
- T0,comm,⋯,TNperm−1,commT_{0,comm},\cdots,T_{N_{perm}-1,comm}T0,comm,⋯,TNperm−1,comm
- Values and paths with size logn\log nlogn:
- fi(y)f_i(y)fi(y) for i∈[0,Nwitness−1]i\in [0, N_{witness}-1]i∈[0,Nwitness−1]
- P(y),P(yw),Q(y),Q(yw)P(y), P(yw),Q(y), Q(yw)P(y),P(yw),Q(y),Q(yw)
- Tj(y)T_j(y)Tj(y) for j∈[0,Nperm−1]j\in [0, N_{perm}-1]j∈[0,Nperm−1]
- A′(y),S′(y),V(y),A′(yw−1),V(yw)A'(y),S'(y), V(y), A'(yw^{-1}),V(yw)A′(y),S′(y),V(y),A′(yw−1),V(yw)
- Gate-depending fi(ywμ)f_i(yw^{\mu})fi(ywμ)
- For circuit polynomials:区分point values
- Evaluation proof for the values above(lll次):
附录 nil Foundation系列博客
- nil Foundation的Solana-Ethereum Bridge Based on Light-Client State Proof Verification
- nil Foundation的基于Solana light client实现的zk-bridge方案
- nil Foundation的Mina->以太坊 bridge原型已完成
- nil Foundation的Mina-Ethereum State Proof Verification Applications
- nil Foundation的in-EVM Full Mina State Verification
- nil Foundation的Placeholder证明系统(1)
- zkLLVM:nil Foundation开发的电路编译器
参考资料
[1] ZCash Halo2 Lookup argument
[2] ZCash Halo2 Permutation argument