Efficient Zero-Knowledge Argument for Correctness of a Shuffle学习笔记(3)
1. 前言
- 在博客 Efficient Zero-Knowledge Argument for Correctness of a Shuffle学习笔记(1)中介绍了Shuffle argument总体算法以及Multi-exponentiation Argument算法。
- 在博客Efficient Zero-Knowledge Argument for Correctness of a Shuffle学习笔记(2)中,将重点介绍product argument算法——拆分为三个:hadamard product argument、zero argument和single value product argument.。
在本博客中,主要介绍对Stephanie Bayer和Jens Groth 2012年论文《Efficient Zero-Knowledge Argument for Correctness of a Shuffle》中各算法的代码实现。目前github上主要有两类实现:
- https://github.com/derbear/verifiable-shuffle
- https://github.com/nirvantyagi/stadium和https://github.com/grnet/bg-mixnet
2. https://github.com/derbear/verifiable-shuffle中代码实现
round_n,为奇数对应是Prover操作,为偶数对应是Verifier操作。
- round_1:shuffle argument中的commit to 。
- round_2:challenge 。
- round_3:, commit to 。
- round_4:challenge 。
- round_5a: ,构建矩阵,构建用于product argument的矩阵,并对进行commit。
- round_5b:引入随机变量和并分别对其commit,分别对应Multi-exponentiation Argument中的。
- round_5c:计算Multi-exponentiation Argument中的。
- round_6:challenge 。
- round_7a:
为Hadamard product argument服务,引入随机向量,commitment to ,构建矩阵,commit to 。
为zero argument服务,构建相应的并commit,对应其中的。
为Single value product argument服务,引入随机变量,计算。 - round_7b:计算Multi-exponentiation Argument中的。
- round_8:challenge 。
- round_9a:计算Single value product argument中的和。
- round_9b:计算zero argument中的。
- round_10:分别对shuffle argument、Multi-exponentiation Argument、Hadamard product argument、zero argument以及Single value product argument的最后一步verify即可。
3. https://github.com/nirvantyagi/stadium和https://github.com/grnet/bg-mixnet中代码实现
https://github.com/nirvantyagi/stadium和https://github.com/grnet/bg-mixnet两套代码之间的关系为:
bg-mixnet builds on top of the Stadium software project, which is hosted at https://github.com/nirvantyagi/stadium. Stadium is a distributed metadata-private messaging system.
性能相对于https://github.com/derbear/verifiable-shuffle做了性能优化: