1. 背景知识

Prover 需要在不reveal permutation π\pi的基础上,证明其确实知道π\pi,且在收到Verifier challenge信息后,Prover对challenge 信息采用相同的π\pi处理并将处理后的消息发送给Verifier,Verifier应可验证所收到的消息确实是采用了相同的permutation π\pi处理,尽管其并不知道具体的permutation π\pi内容。
在Jens Groth 2010年论文《A Verifiable Secret Shuffle of Homomorphic Encryptions》和Stephanie Bayer和Jens Groth 2012年论文《Efficient Zero-Knowledge Argument for Correctness of a Shuffle》中,均有对permutation π\pi证明算法实现,具体也可结合这两篇博客来看:

假设均针对长度为N=nmN=nm的Permutation π\pi进行证明,且均采用Pedersen commitment规则:
Permutation $\pi$ 零知识证明

2. Groth2010的permutation π\pi零知识证明

Jens Groth 2010年论文《A Verifiable Secret Shuffle of Homomorphic Encryptions》的思路为:
Common Input: public commitment key ckck。【length为N+1N+1
Prover’s witness: permutation πN\pi\in\sum_{N}
证明:在不暴露permutation π\pi的前提下,Verifier给challenge(s),Prover respond,Verifier需验证:Prover确实知道某permutation π\pi;Prover respond的消息内采用了相同的permutation π\pi

1)Prover:对permutation π\pi进行commit c=comck=(π(1),,π(N);r)c=com_{ck}=(\pi(1),\cdots,\pi(N);r),其实就是对数字1,,N1,\cdots,N的permutation commit。只需证明cc为a commit to a permutation of the numbers 1,,N1,\cdots,N,这样就可以保证the prover is bound to some permutation he knows, but the permutation remains hidden.
同时选NN个随机数d1,,dN-d_1,\cdots,-d_N用于保护permutation π\pi不被reveal,对这些随机数进行commit cd=comck(d1,,dN;rd)c_d=com_{ck}(-d_1,\cdots,-d_N;r_d)
cccdc_d发送给Verifier。
2)Verifier:Challenges t1,,tNt_1,\cdots,t_N。【length为NN
3)Prover:对收到的t1,,tNt_1,\cdots,t_N按相同的permutation π\pi进行permute,计算si=tπ(i)+dis_i=t_{\pi(i)}+d_i。Prover给Verifier发送s1,,sNs_1,\cdots,s_N。【length为NN
4)Prover:提供证明sis_i have been formed correctly, using the same permutation π\pi that used to form cc
Common Input: ckckcccdc_d(s1,,sN)(s_1,\cdots,s_N)以及t1,,tNt_1,\cdots,t_N
Prover’s witness: permutation πN\pi\in\sum_{N}
证明:s1,,sNs_1,\cdots,s_N中的permutation π\pi和commitment cc中的permutation π\pi是相同的。

  • Verifier:challenge λ\lambda
  • Common input:构建向量(m1,,mN)=(λ1+t1,,λN+tN)(m_1,\cdots,m_N)=(\lambda\cdot 1+t_1,\cdots,\lambda\cdot N+t_N)(构建依据为cc为a commit to a permutation of the numbers 1,,N1,\cdots,N)。
  • Prover:
    (1)利用witness permutation π\pi构建向量(mπ(1),,mπ(N))=(λπ(1)+tπ(1),,λπ(N)+tπ(N))(m_{\pi(1)},\cdots,m_{\pi(N)})=(\lambda\pi(1)+t_{\pi(1)},\cdots, \lambda\pi(N)+t_{\pi(N)}),引入随机值ρ=rλ+rd\rho=r\lambda+r_d,Prover可计算cλ=comck(λπ(1)+tπ(1),,λπ(N)+tπ(N);ρ)=comck(mπ(1),,mπ(N);ρ)c_{\lambda}=com_{ck}(\lambda\pi(1)+t_{\pi(1)},\cdots,\lambda\pi(N)+t_{\pi(N)};\rho)=com_{ck}(m_{\pi(1)},\cdots,m_{\pi(N)};\rho)
    实际上,利用commitment的加法同态性,Verifier和Prover均可获得cλ=cλcdcomck(s1,,sN;0)c_{\lambda}= c^{\lambda}c_dcom_{ck}(s_1,\cdots,s_N;0)
    从而cλc_{\lambda}为common input,无需传递。
    (2)已知cλ=comck(mπ(1),,mπ(N);ρ)c_{\lambda}= com_{ck}(m_{\pi(1)},\cdots,m_{\pi(N)};\rho)(m1,,mN)(m_1,\cdots,m_N),证明Prover知道相应的permutation π\pi和randomizer ρ\rho:(显然地,可以借助博客博客A Verifiable Secret Shuffle of Homomorphic Encryptions学习笔记第二节的“shuffle of known contents 明文shuffle证明”来实现。同时注意,其中的challenge xx可复用以上(1)中的challenge λ\lambda
  • Prover和Verifier:均计算cλ=cλcdcomck(s1,,sN;0)c_{\lambda}= c^{\lambda}c_dcom_{ck}(s_1,\cdots,s_N;0)
  • Prover:复用x=λx=\lambda,复用之前的cd=cd,c=cλc_d=-c_d,c=c_{\lambda},从而有:
    Permutation $\pi$ 零知识证明

由此,即完成整个permutation π\pi零知识证明。

3. Groth2012的permutation π\pi零知识证明

Stephanie Bayer和Jens Groth 2012年论文《Efficient Zero-Knowledge Argument for Correctness of a Shuffle》的思路为:
Prover’s witness: permutation πN\pi\in\sum_{N}
Common Input: public commitment key ckck。【length为n+1n+1】((π(1),,π(N))(\pi(1),\cdots,\pi(N))向量以nnmm列的矩阵表示,减少ckck的长度减少mm倍。)
证明:在不暴露permutation π\pi的前提下,Verifier给challenge(s),Prover respond,Verifier需验证:Prover确实知道某permutation π\pi;Prover respond的消息内采用了相同的permutation π\pi

1)Prover:将(π(1),,π(N))(\pi(1),\cdots,\pi(N))向量以nnmm列的矩阵表示A=(a1,,am)={π(i)}i=1NA=(\vec{a}_1,\cdots,\vec{a}_m)=\{\pi(i)\}_{i=1}^N,逐列进行commit cA=comck(A;r)=(comck(a1;r1),,comck(am;rm))\vec{c}_A=com_{ck}(A;\vec{r})=(com_{ck}(\vec{a}_1;r_1),\cdots,com_{ck}(\vec{a}_m;r_m)),其实就是对数字1,,N1,\cdots,N的permutation commit。
cA\vec{c}_A发送给Verifier。【length为mm】【第一组commitment】
2)Verifier:Challenges xx。【length为11
3)Prover:采用相同的permutation π\pi构建nnmm列的矩阵B=(b1,,bm)={xπ(i)}i=1NB=(\vec{b}_1,\cdots,\vec{b}_m)=\{x^{\pi(i)}\}_{i=1}^N,逐列进行commit cB=comck(B;s)=(comck(b1;s1),,comck(bm;sm))\vec{c}_B=com_{ck}(B;\vec{s})=(com_{ck}(\vec{b}_1;s_1),\cdots,com_{ck}(\vec{b}_m;s_m))
Prover给Verifier发送cB\vec{c}_B。【length为mm】【第二组commitment】
4)Prover:提供证明cB\vec{c}_B have been formed correctly, using the same permutation π\pi that used to form cA\vec{c}_A
Prover提供argument,证明其知道相应的openings of the commitments to permutations of respectively 1,,N1,…,Nx1,,xNx^1,…,x^N,同时证明这两组commitment采用的是相同的permutation。【即第二组commitment是对x1,,xNx^1,…,x^N permuted in an order that was fixed before the prover saw xx】。

  • 4.1 为了证明两组commitment采用的是相同的permutation,Verifier给Prover random challenges yyzz
  • 4.2 Prover commit to 一系列 d1z=yπ(1)+xπ(1)z,,dNz=yπ(N)+xπ(N)zd_1-z=y\pi(1)+x^{\pi(1)}-z,…,d_N-z=y\pi(N)+x^{\pi(N)}-z。使用product argument,即可证明i=1N(diz)=i=1N(yi+xiz)\prod_{i=1}^{N}(d_i-z)= \prod_{i=1}^{N}(yi+x^i-z)等式成立。【想象其为zz的N阶多项式,did_i是对其root根yi+xiyi+x^i的permute,基于Schwartz-Zippel lemma可知,针对特定的zz值Prover伪造找到相应did_i值使该等式成立的概率不高于Nq1\frac{N}{q-1},可忽略。同理,针对yy值,Prover伪造两组commitment使等式成立的概率也可忽略。】

相关文章: