第 7 课 补充讲义
算术化是将计算编码为代数约束满足问题的过程。这将检验其正确性的复杂性降低到少量概率代数检查。在证明系统中,算术化的选择会影响IOP的选择范围(见图1)。
图1:证明系统的组成部分。请回顾第5讲(承诺方案)中,承诺方案可用于将交互式预言机证明(IOP)编译成证明系统。
英文原文
Arithmetisation is the encoding of a computation as an algebraic constraint satisfaction problem. This reduces the complexity of verifying its correctness to a few probabilistic algebraic checks. In a proof system, the choice of arithmetisation limits the corresponding range of IOPs that can be used to check it (see Figure 1).
Figure 1: The components of a proof system. Recall from Lecture 3 (Commitment Schemes) that a commitment scheme can be used to compile an interactive oracle proof (IOP) into a proof system.
二次算术程序 (QAPs)
二次算术程序(Quadratic Arithmetic Program,QAP) [9] 是一种将语句转换为多项式上二次方程组的方式。它们可以通过线性交互式证明(LIPs)[10],代数IOPs [6],多线性IOPs ([14],[15]) 进行检验。任何具有乘性复杂度
定义1.1. 二次算术程序(QAP)
一个度数为
其中
英文原文
The Quadratic Arithmetic Program (QAP) [9] is a way to translate statements into a system of quadratic equations over polynomials. They can be checked by linear interactive proofs (LIPs) [10], algebraic IOPs [6], multilinear IOPs ([14], [15]). Any circuit with multiplicative complexity
Definition 1.1. [Quadratic Arithmetic Program (QAP)]
A Quadratic Arithmetic Program Q of degree
where
一阶约束系统 (R1CS)
算术电路可以用简化形式的一阶约束系统(R1CS)表示,而R1CS则可以转换为QAP。
参数系统 | 算术化 | 信息理论协议 | 密码编译器 |
---|---|---|---|
Groth16 [10] | R1CS | 线性交互证明 (LIP) | 双线性配对 |
Marlin [6] | R1CS | 代数全息证明 (AHP) | 改进的KZG承诺 |
Spartan [15] | R1CS | 变体的sumcheck协议 | SPARK |
Dory [14] | R1CS | 多线性IOP | 双线性配对 |
Nova [13] | 放宽的R1CS | 多线性IOP | 多线性PCS |
表1:使用R1CS算术化的证明系统的示例。
在第二讲(Circom 1)中,我们看到了IsZero
电路,它检查给定值是否为零的声明。让我们将IsZero
转换为一个R1CS电路,然后将其转换为QAP。
template IsZero(){
signal input in;
signal output out;
signal inv;
inv <−− in != 0 ? 1 / in : 0;
out <== −in * inv + 1;
in * out === 0;
}
template IsZero(){
signal input in;
signal output out;
signal inv;
inv <−− in != 0 ? 1 / in : 0;
out <== −in * inv + 1;
in * out === 0;
}
代码1:从comparators.circom
中获取的IsZero
电路。
circom的IsZero
程序可以“展平”为四个约束条件,每个都采用 左侧 o 右侧 = output
的形式:
在算术电路表示中(左图),每个约束条件对应于一个加法或乘法门。
证明人声称知道一些合法的赋值
现在,我们将每个左边的
矩阵
英文原文
Arithmetic circuits can be expressed a simplified form known as Rank-1 Constraint System (R1CS), which can in turn be transformed into a QAP.
Argument system | Arithmetization | Information-theoretic protocol | Cryptographic compiler |
---|---|---|---|
Groth16 [10] | R1CS | linear interactive proof (LIP) | bilinear pairings |
Marlin [6] | R1CS | algebraic holographic proof (AHP) | adapted KZG commitment |
Spartan [15] | R1CS | variant of sumcheck protocol | SPARK |
Dory [14] | R1CS | multilinear IOP | bilinear pairings |
Nova [13] | Relaxed R1CS | multilinear IOP | multilinear PCS |
Table 1: Examples of proof systems which make use of R1CS arithmetisation.
In Lecture 2 (Circom 1), we saw the Is Zero circuit, which checks a claim about whether a given value is zero. Let's convert Is eero into an R1CS circuit, and then transform it into a QAP.
template IsZero(){
signal input in;
signal output out;
signal inv;
inv <−− in != 0 ? 1 / in : 0;
out <== −in * inv + 1;
in * out === 0;
}
template IsZero(){
signal input in;
signal output out;
signal inv;
inv <−− in != 0 ? 1 / in : 0;
out <== −in * inv + 1;
in * out === 0;
}
Listing 1: The Iszero circuit, taken from comparators. circom in circomlib.
The circom Iszero program can be "flattened" into four constraints, each of the form left o right = output:
In the arithmetic circuit representation (left), each of these constraints corresponds to an addition or multiplication gate.
The prover is claiming to know some legal assignment
Now, we collect each of the left
The