第 5 课 补充讲义
现代 SNARK 由两个部分组成:信息论交互式预言机证明 (IOP) [1]; 和一个兼容的密码承诺方案,它将 IOP“编译”成一个论证系统 [5]。 本讲义介绍几种常用的承诺方案。
IOP 是“信息论的”,因为即使针对 计算无界 的证明者和验证者,它也能提供可靠性和零知识保证。 为了使这成为可能,证明系统做出了“预言机访问”的理想化假设:换句话说,验证者只能通过随机查询访问证明者的消息。
承诺方案使用密码原语(例如单向函数)实例化此预言机访问:因此,由此产生的论证系统仅对于 计算有界 的证明者和验证者而言是安全的。 为了实现 简洁 的论证系统,所选择的承诺方案必须提供相对于被证明的计算而言较低的通信复杂性。
图 1:
英文原文
Modern SNARKs consist of two components: an information-theoretic interactive oracle proof (IOP) [1]; and a compatible cryptographic commitment scheme, which "compiles" the IOP into an argument system [5]. This note introduces several commonly used commitment schemes.
An IOP is "information-theoretic" in that it provides soundness and zero-knowledge guarantees even when the prover and verifier are computationally unbounded. To make this possible, the proof system makes the idealised assumption of "oracle access": in other words, the verifier can only access the prover's messages through random queries.
The commitment scheme instantiates this oracle access using cryptographic primitives (e.g. a one-way function): as a consequence, the resulting argument system is only secure with respect to a computationally bounded prover and/or verifier. To realise a succinct argument system, the chosen commitment scheme must provide low communication complexity relative to the computation being proven.
Figure 1: A
正式定义
定义 1.1(承诺方案)。 承诺方案是 PPT 算法的元组
采用安全参数 (一元)并生成公共参数 ; 获取秘密消息 并输出公开承诺 和(可选)秘密打开提示 (可能为随机数)。 利用打开提示 ,验证承诺 对消息 的打开。
承诺方案
通俗来说,这意味着如果没有对手可以生成某个不同的消息
承诺方案
通俗来说,如果在承诺方案中,没有人能够“逆向工程”以确定到底是哪一条消息被承诺了,那么该承诺具有隐藏性。
回忆一下:“上锁的盒子”。 [第3讲:“数学基础构件”]
在汉密尔顿回路示例中,我们使用抗碰撞的哈希函数来构建我们的承诺方案:
是输入到哈希函数的随机采样密钥。 Commit:
。 Open: 检查
.
英文原文
Definition 1.1 (Commitment scheme). A commitment scheme is a tuple
takes security parameter (in unary) and generates public parameters ; Commit
takes a secret message and outputs a public commitment and (optionally) a secret opening hint (which might or might not be the randomness used in the computation). Open
verifies the opening of the commitment to the message provided with the opening hint .
A commitment scheme
Informally, this states that a valid commitment
A commitment scheme
Informally, this states that if a commitment is hiding if an adversary cannot "reverse-engineer" which of their messages was committed to.
Recall: "locked boxes". [Lecture 3: "Mathematical Building Blocks"]
In the Hamilton cycle example, we use a collision-resistant hash function to construct our commitment scheme:
is a randomly sampled secret key that is input to the hash function. Commit: hash
. Open : check
.
构造 Constructions
向量承诺 Vector commitment scheme
针对消息集
定义 2.1(位置绑定)。对于任何 PPT 敌手
通俗来说,没有任何敌手可以在同一个位置上用两个不同的值打开
向量 Pedersen 承诺。Pedersen 承诺[9]是一个在消息空间
Pedersen.Setup
,其中 是一个阶为 的群。 Pedersen.Commit
,其中 是一个秘密随机值。 Pedersen.Open
证明者 揭示 和 ,验证者 检查 。
需要注意的是,Pedersen 承诺具有加法同态性:
练习
证明 Pedersen 承诺方案是具有隐藏性和绑定性的。
请注意,在群
隐藏性:在给定承诺
的情况下,每个值 是否均等地有可能成为 对应的隐藏值? 绑定性:证明者是否能够找到
,使得 Pedersen.Commit Pedersen.Commit ?
我们可以将 Pedersen 承诺方案扩展到消息空间
VectorPedersen.Setup
,其中 是一个阶为 的群。 VectorPedersen.Commit
,其中 是一个秘密随机值。 VectorPedersen.Open
证明者 揭示 和 ,验证者 检查 。
练习
证明 VectorPedersen 是具有加法同态性,即
Merkle 树。一个常用的构建向量承诺的解决方案是 Merkle 树 [8]。它被用于像 Git、Cassandra 和 Bitcoin 这样的分布式系统中用于汇总数据集。Merkle 树也具有隐藏性和可提取性,这些安全特性使它成为在随机预言机模型中将 IOP 编译为非交互式证明的理想选择 [1]。
图 2:Merkle 树的每个内部节点都是其两个子节点的哈希值。
Merkle.Commit
:对于 中的每个 ,计算哈希值 。计算 Merkle 树的内部节点 。输出 。 Merkle.Open
: a) 证明者
计算从 到根节点的内部节点路径,并得到证据 。 b) 验证者
检查根节点是否可以通过将 和路径一起计算哈希得到。
英文原文
A vector commitment scheme [2] for the message space
Definition 2.1 (Position binding). A vector commitment scheme
Informally, this states that no adversary can open
Vector Pedersen commitment. The Pedersen commitment [9] is a binding and hiding commitment scheme for the message space
Pedersen.Setup
, where is a cryptographic group of order . Pedersen.Commit
, where is a random secret. Pedersen.Open
the prover reveals and , and the verifier checks
Note that the Pedersen commitment is additively homomorphic:
Exercise. Convince yourself that the Pedersen commitment scheme is hiding and binding.
Note that a cryptographic group
hiding: given a commitment
, is every value equally likely to be the value committed in binding: can a prover find
such that Pedersen.Commit Pedersen.Commit