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中代码实现
Nirvan Tyagi等人2017年论文《Stadium: A Distributed Metadata-Private Messaging System》,针对的场景是:互联网环节下的private communication。即使对传输的消息messages进行了加密(data privacy),但是要想隐藏相互通讯的双方信息(metadata about which pairs of users are communicating——metadata privacy)仍不容易。如匿名网络Tor对traffic analysis流量分析是敏感的。本文的metadata指:who is communicating with whom, at what time, and their traffic volumes.
现有情况:
- Systems that leak no metadata at all, such as Riposte [12] and Dissent [13], require broadcasting all messages to all users or use computationally intensive Private Information Retrieval.
- Vuvuzela 是一个消息通讯系统。可以保护消息的内容和消息元数据的私密性。目前Vuvuzela仅能支持最高约115,000 messages per second,而此时每个Vuvuzela server对应需要的带宽约为1.3Gbit/sec(因其设计为requires transmitting all messages through a single chain of relay servers, preventing it from scaling beyond this.),增加server的成本。基于Jelle van den Hooff等人2015年论文《Vuvuzela: Scalable Private Messaging Resistant to Traffic Analysis》,代码实现可见:https://github.com/vuvuzela/vuvuzela。
Stadium——在保证吞吐量和可扩展性的前提下,可同时提供metadata privacy和data privacy,并保证efficiently distributing its work over multiple servers。与Vuvuzela类似,Stadium基于的也是differential privacy差分隐私技术,但是Stadium可支持的用户。Stadium需要distributing users’ traffic across servers,使得adversaries有机会observe it in fine granularity,为了应对该风险,Stadium采用了以下两种方法:
- a collaborative noise generation approach。
- 和a novel verifiable parallel mixnet design where the servers collaboratively check that others follow the protocol。——即基于的是Stephanie Bayer和Jens Groth 2012年论文《Efficient Zero-Knowledge Argument for Correctness of a Shuffle》的verifiable shuffling 协议 extended for non-interactive proofs via the Fiat Shamir Heuristic and instantiated over a 1536-bit prime order group。
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做了性能优化: