第 9 课 补充讲义
本文介绍了一些端到端证明系统的构建方法,并希望开始构建某种分类法。我们简要探讨了递归,这让我们能够使用常量大小的证明来检查任意长的计算链;以及证明组合,其中多个证明系统嵌入到单个协议中。
英文原文
This note illustrates a few more end-to-end constructions of proof systems, with the hope of beginning to construct some kind of taxonomy. We briefly explore recursion, which lets us check an arbitrarily long chain of computation with a constant-size proof; and proof composition, where multiple proof systems are embedded in a single protocol.
证明系统分类
大多数现代证明系统都是以模块化方式设计的,使用代数全息证明作为信息论组件。这些是多项式交互式 Oracle 证明 (PIOPs),其中验证者无法访问被证明关系的完整编码,而是通过 Oracle 访问来进行“查询”。因为 AHP 可以使用任何多项式承诺方案,所以这些证明系统的设置仅特定于所选择的承诺方案,而不是被证明的关系。为了将基于 IOP 的方法与旧方案进行对比,我们通过两个证明系统堆栈,这两个堆栈都从 R1CS 算术化开始:Pinocchio [6] 构建了一个线性概率可检查证明 (LPCP),然后使用基于配对密码学的编译,而 Marlin [2] 和 Spartan [7] 构建了代数全息证明 (AHPs),使用多项式承诺方案进行编译。
图 1:现代 SNARKs 的分类法。从 [9] 的图 19.1 改编。
英文原文
Most modern proof systems are designed in a modular way, using algebraic holographic proofs as the information-theoretic component. These are polynomial interactive oracle proofs (PIOPs) where the verifier does not have access to the full encoding of the relation being proven, but instead queries it via oracle access. Because AHPs work with any polynomial commitment scheme, the setups for these proof systems are specific to just the chosen commitment scheme, and not the relation being proven. To contrast the IOP-based approach against older schemes, we go through two proof system stacks that both start with the R1CS arithmetisation: Pinocchio [6] constructs a linear probabilistically checkable proof (LPCP), which is then compiled using pairing-based cryptography, while Marlin [2] and Spartan [7] construct algebraic holographic proofs (AHPs), compiled using a polynomial commitment scheme.
Figure 1: A taxonomy of modern SNARKs. Adapted from Fig. 19.1 of [9].
R1CS QAP + LPCP + 双线性映射 (Pinocchio)
回顾第7讲(算术化),一个Rank-1约束系统(R1CS)由矩阵
R1CS可以表示为一个二次算术程序(QAP)
其中:
检查评估域中的每个点的赋值; 。
定义1.1. [线性概率可检验证明(LPCP)]
长度为
英文原文
Recall from Lecture 7 (Arithmetisations) that a Rank-1 Constraint System (R1CS) consists of the matrices
The R1CS can be expressed as a Quadratic Arithmetic Program (QAP)
where:
checks the assignment at each point in the evaluation domain; .
Definition 1.1. [Linear Probabilistically Checkable Proof (LPCP)]
A Linear Probabilistically Checkable Proof (LPCP) of length
QAP 可除性检查
为了检查QAP的正确性,Pinocchio [6]使用基于配对密码学的LPCP进行编译。在这里,我们使用对称配对
QAP可除性检查
- 采样一个随机的评估点
; - 输出QAP的多项式在
处的评估的承诺:
- 采样一个随机的评估点
: - 计算
- 计算
- 输出
这相当于在“指数”中检查 。
英文原文
To check the correctness of the QAP, Pinocchio [6] constructs an LPCP compiled with pairingbased cryptography. Here, we use a symmetric pairing
QAP divisibility check
- sample a random evaluation point
; - output the commitments to the evaluations of the QAP's polynomials at
:
- sample a random evaluation point
: - compute
- compute
- output
this corresponds to checking "in the exponent".
QAP 线性组合检查
然而,我们实际上并没有限制证明者使用设置中提供的
QAP 线性组合检查
srs: - 采样随机偏移量
; - 计算在
处的“ -偏移” 多项式的评估的承诺: - 同样地,计算
- 像 QAP 可除性检查中一样计算剩余的 srs,并输出
- 采样随机偏移量
: - 计算“
-偏移”:
- 像 QAP 可除性检查中一样计算
; - 输出
。
- 计算“
验证
:检查
由于证明者不知道移位值
英文原文
However, we haven't actually constrained the prover to use the provided
QAP linear combination check
srs: - sample random shifts
; - compute the commitments to the evaluations of the "
shifted" polynomials at - similarly, compute
- compute the rest of the srs as in the QAP divisibility check, and output
- sample random shifts
: - compute the "
-shifted"
- compute
as in the QAP divisibility check; - output
.
- compute the "
Verify
: check that
Since the prover does not know the shift values
QAP 系数一致性检查
最后一个问题仍然存在:我们如何限制证明者在计算每个
QAP 系数一致性检查
srs: - 随机采样
- 计算 "
-shifted" 多项式在 处的评估的承诺: - 类似地,计算
- 像在 QAP 可除性检查中一样计算剩余的 srs,并输出
- 随机采样
: - 计算多项式
; - 使用来自 srs 的 shifted 承诺,在
处计算一个承诺到 " -shifted" 的评估:
- 像在 QAP 可除性检查中一样计算
; - 输出 srs
- 计算多项式
检查 这相当于在指数中检查
。
QAP
英文原文
A final problem remains: how do we know constrain the prover to use the same coefficients
QAP coefficients consistency check
srs: - sample random
- compute the commitments to the evaluations of the "
-shifted" polynomials at - similarly, compute
- compute the rest of the srs as in the QAP divisibility check, and output
- sample random
: - compute the polynomial
; - using the shifted commitments from the srs, compute a commitment to the "
-shifted" evaluated at :
- compute
as in the QAP divisibility check; - output srs
- compute the polynomial
check this corresponds to checking
"in the exponent".
The QAP
R1CS AHP + 多项式承诺方案
对于相同的R1CS算术化,Marlin [2]和Spartan [7]都引入了代数全息证明(AHP),允许重用通用设置以用于任意关系。这里的直觉是电路的布线谓词没有在设置中硬编码;相反,在离线阶段发送它们的多项式编码。大部分工作涉及将矩阵转换为多项式编码,并减少访问这些编码的验证器成本。为了实现这一点,Marlin和Spartan都引入了额外的交互轮次,在这些轮次中,验证器使用sumcheck协议查询矩阵值。
图2:回顾第5讲(承诺方案)中的交互式Oracle证明(IOP)。代数全息证明(AHP)与多项式IOP密切相关。
定义1.2. [代数全息证明(AHP)]
对于域
- 第0轮(离线阶段):索引器接收索引
,并输出 个编码给定索引的多项式。 轮(在线阶段):验证者 向证明者 发送消息 ; 用 个oracle多项式 进行回复。验证者可以任意次数地查询它收到的任何多项式。查询包括一个评估点 ,其对应的答案是 。
交互后,验证者接受或拒绝。
数学构建块:索引关系。
索引关系
英文原文
For the same R1CS arithmetisation, both Marlin [2] and Spartan [7] introduce algebraic holographic proofs (AHPs) that allow a universal setup to be reused for arbitrary relations. The intuition here is that the circuit's wiring predicates are not hard-coded in the setup; rather, their polynomial encoding is sent during the offline phase. Most of the work involves massaging the matrices into polynomial encodings, and reducing the verifier cost of accessing these encodings. To achieve this, both Marlin and Spartan introduce additional rounds of interaction where the verifier queries the matrix values using the sumcheck protocol.
Figure 2: Recall the interactive oracle proof (IOP) from Lecture 5 (Commitment Schemes). An algebraic holographic proof (AHP) is closely related to a polynomial IOP.
Definition 1.2. [Algebraic Holographic Proof (AHP)]
An algebraic holographic proof (AHP) for an indexed relation
- Round 0 (offline phase): the indexer receives an index
and outputs polynomials encoding the given index. - Round
(online phase): the verifier sends a message to the prover replies with oracle polynomials . The verifier may query any of the polynomials it has received any number of times. A query consists of an evaluation point , and its corresponding answer is .
After the interaction, the verifier either accepts or rejects.
Math building block: Indexed relations.
An indexed relation
PAIR + 多项式 IOP + KZG (PlonK)
对于相同的R1CS算术化,Marlin [2]和Spartan [7]都引入了_代数全息证明_(AHP),允许重复使用_通用设置_来处理任意关系。这里的直觉是电路的布线谓词没有在设置中硬编码;相反,在离线阶段发送它们的多项式编码。大部分工作涉及将矩阵转换为多项式编码,并降低访问这些编码的验证器成本。为了实现这一点,Marlin和Spartan都引入了额外的交互轮次,其中验证器使用sumcheck协议查询矩阵值。
图2:回想一下第5讲(承诺方案)中的交互式Oracle证明(IOP)。代数全息证明(AHP)与多项式IOP密切相关。
定义1.2. [代数全息证明(AHP)]
在域
- 第0轮(离线阶段): 索引器接收一个索引
,并输出 个多项式,编码给定的索引。 - 第
轮(在线阶段): 验证者 向证明者 发送一个消息 ;证明者 回复 个Oracle多项式 。验证者可以任意次地查询它接收到的任何多项式。一个查询由一个评估点 组成,其对应的答案是 。
交互后,验证者要么接受要么拒绝。
数学构建块:索引关系。
索引关系
英文原文
The PlonK proof system [3] is very similar to Marlin [2]: they both encode their values in Lagrange interpolation polynomials over a multiplicative subgroup, and check relations on them using polynomial identities; then, they both construct polynomial IOPs compiled with the KZG polynomial commitment scheme.
Their key difference is in arithmetisation: since the verifier's checks are now performed "in the clear", as opposed to "in the exponent", PlonK no longer limits itself to degree-2 gates (formerly imposed by the bilinear pairing). This lets us define higher-degree custom gates than in R1CS.
Figure 3: Recall from Lecture 8 (PlonK) the multiple subprotocols making up PlonK's IOP, including gate constraints, the permutation argument, and the lookup argument. These are randomly combined into a "zero check" over the vanishing polynomial. (Figure taken from [1]).
The modular construction of PlonK has allowed implementers to experiment with alternative arithmetisations and polynomial commitment schemes. This opens up possibilities for composition across different proof systems.
Figure 4: "PlonKish" arithmetisation and IOP is the core of many production proof system stacks.
Reference
- [1] B. Chen, B. Bünz, D. Boneh, and Z. Zhang. Hyperplonk: Plonk with linear-time prover and high-degree custom gates. Cryptology ePrint Archive, 2022.
- [2] A. Chiesa, Y. Hu, M. Maller, P. Mishra, N. Vesely, and N. Ward. Marlin: Preprocessing zksnarks with universal and updatable srs. In Advances in Cryptology–EUROCRYPT 2020: 39th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Zagreb, Croatia, May 10–14, 2020, Proceedings, Part I 39, pages 738–768. Springer, 2020.
- [3] A. Gabizon, Z. J. Williamson, and O. Ciobotaru. Plonk: Permutations over lagrange-bases for oecumenical noninteractive arguments of knowledge. Cryptology ePrint Archive, 2019.
- [4] R. Gennaro, C. Gentry, B. Parno, and M. Raykova. Quadratic span programs and succinct nizks without pcps. In Advances in Cryptology–EUROCRYPT 2013: 32nd Annual International Conference on the Theory and Applications of Cryptographic Techniques, Athens, Greece, May 26-30, 2013. Proceedings 32, pages 626–645. Springer, 2013.
- [5] J. Groth. On the size of pairing-based non-interactive arguments. In Advances in Cryptology– EUROCRYPT 2016: 35th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Vienna, Austria, May 8-12, 2016, Proceedings, Part II 35, pages 305–326. Springer, 2016.
- [6] B. Parno, J. Howell, C. Gentry, and M. Raykova. Pinocchio: Nearly practical verifiable computation. Communications of the ACM, 59(2):103–112, 2016.
- [7] S. Setty. Spartan: Efficient and general-purpose zksnarks without trusted setup. In Advances in Cryptology–CRYPTO 2020: 40th Annual International Cryptology Conference, CRYPTO 2020, Santa Barbara, CA, USA, August 17–21, 2020, Proceedings, Part III, pages 704–737. Springer, 2020.
- [8] S. Setty, B. Braun, V. Vu, A. J. Blumberg, B. Parno, and M. Walfish. Resolving the conflict between generality and plausibility in verified computation. In Proceedings of the 8th ACM European Conference on Computer Systems, pages 71–84, 2013.
- [9] J. Thaler et al. Proofs, arguments, and zero-knowledge. Foundations and Trends® in Privacy and Security, 4(2–4):117–660, 2022.