Linear PCP-based SNARK
Here is another paradigm for SNARKs: a cryptographic tool and a linear PCP builds a SNARK system. Before IOP and PCS paradigm was put forward, the main paradigm is PCP, e.g. Kilian’92 and Micali’00 is PCP+Merkle tree; IKO’07 is linear PCP; GGPR’13 uses QAP as linear PCP.
Quadratic Arithmetic Program (QAP)
QAP is another method to encode a circuit into a polynomial. Recall that in the first IOP for circuit SAT, we label each gate with a bitstring, and the satisfying value is encoded into a multilinear polynomial on the hypercube (interpolated to ). In PLONK, we label each wire with an integer, and the satisfying value is encoded into a univariate polynomial on the roots of unity.
QAP labels all the input and output of all multiplicative gates. We label each gate with integers in and each wire (except output wires of additive gate) with integers in . The value of wire is . Then we define by , iff is the left input of the gate ; and the same as , for the right input and output.
Note that we say is the left input of gate also if passes several additive gates before it is the left input of gate . Then we have: the value on the circuit is proper iff
where
exactly encodes the left-input, right-input and output of gate with , , and .
Thus, the statement that knows such that holds iff knows a vector such that .
Constructing SNARK: [PGHR13] and [Groth16]
The global parameter is where is a random element (later deleted) in .
With KZG in our hands, we reach to a simple protocol: The prover can compute , , , and by homomorphically combining the global parameters. The verifier checks if .
However, the protocol is far from the real protocol.
Problem 1: How to make sure that is computed from ?
KoE Assumption. We use . If the prover can compute and without knowing , then there is an extractor that can extract ’s from the prover. The Pinocchio [PGHR13] uses KoE assumption.
GGM Assumption. Any prover can only compute linear combinations of ’s, i.e., if the prover can compute , then it must know every . [Groth16] uses GGM assumption.
Problem 2: How to make sure every share the same ’s?
We use another random for setup (also deleted after setup). We add and to the global parameters.
Problem 3: How to handle the public input and the expected output?
Recall that all the wires except the output of add gates are labelled. So the input wire and output wire (if not labelled, add a multiply gate) are labelled with . The idea is to split apart, and let verifier compute .
Analysis
- Setup: group exps, since there is a unique that makes , if we label different wires with a same output gate with different labels.
- Prover: for NTT. The prover computes the values of polynomial on the unity set and uses NTT to get its coefficients. Only with coefficients can the prover compute . Also, group exps.
- Proof size:
- Verifier: for pairing, group exps.
Recursive SNARKs
Recall if the circuit size is :
- Pinocchio and Groth16: prover time and proof size
- PLONK-KZG: prover time (every gadgets the prover should compute NTT) and proof size
- FRI-based: prover time and proof size
How can we achieve the better one in both prover time and proof size? The recursive proof provides a “proof of proof”. Let the inner system be , which proves that the prover knows the such that . Suppose that the prover and verifier and is fast but the proof is long, the idea is to construct another proof system proving that the prover knows the such that . This outer system has slower prover, but since the verifier is fast, the circuit of is much smaller than that of the original . So the outer prover is not so slow, as we expected.
A simple argument shows that if and are both knowledge sound, then the integrated proof system is also knowledge sound. The idea of proof is to regard the extractor as a malicious prover of . The probability gap is the sum of those of the original prove systems, thus negligible.
Application 1: incrementally verifiable computation
Suppose that a computation is applied to initial state recursively, each round takes an input . The prover wants to prove that it knows the ’s such that each computation step is correct. The verifier wants to verify that after steps, the state eventually becomes . (TODO)
Application 2: streaming proof generation
Suppose there is a bunch of transactions to be proved. We need not wait the transactions all to take place; rather, we generate proofs on every arrival of batches. For example if the batch size is , first proves the prover knows that ; then proves that the prover knows such that . Then a proof is generated to prove that the prover knows such that the verifier accepts them all.
Construction: alternating groups
Recall in KZG, the public parameter is a tuple , where is a group of order with its generator. And in this section, we regard the verifier algorithm as a circuit, so we had better embed into some vector space over .
Definition (Algebraic Groups). Group is an algebraic group if and only if
- there are polynomials such that for all , ;
- there is an efficient algorithm testing if .
Can we make a subgroup of ? No, because the discrete log is trivial in such groups. Take Smart Attack in the anomalous curve for an example.
The idea is to construct a group chain that: , ; , . The original circuit is over . The KZG PCS will help us understand this recursive SNARK, because in that scheme, an exponentiation embeds every elements in into . Now that is a circuit over , the proof that the prover knows a proof involves group arithmetic on . Since has order , then sends a proof in .
However it is inefficient to have two pairing groups. For one pairing group and another non-pairing group, we can use KZG for one and bulletproofs for the other. The Halo is based on two non-pairing groups, i.e. elliptic group and of the elliptic curve . Details https://eprint.iacr.org/2019/1021.pdf
Construction: folding
Another idea is homomorphic commitment, which we can compute a commitment of an addition simply by adding the commitments. We use this to prove two circuits at once (generate one proof for the two circuits) . More precisely, all circuits can be written in R1CS form . An idea to prove two instance of the same R1CS at one time is to randomly choose an and prove for some R1CS, the combination is feasible. However, we cannot have if are feasible inputs. Thus we turn to modify the definition and put forward Relaxed R1CS.
HW
- ❎ Knowledge soundness is a meaningful notion when a prover claims that there are no satisfying assignments to a system of constraints
- ❎ Knowledge soundness is a meaningful notion for the sumcheck protocol
- ✅ Knowledge soundness (as defined in lecture 2) implies soundness
- ❎ Non-interactive implies publicly verifiable
- ❎ Vector commitments are as expressive as polynomial commitments
- ✅ Polynomial extensions are distance amplifying encodings
- ✅ Multivariate polynomial encoding reduces the total degree by an exponential factor compared to univariate polynomial encoding
- ✅ The verifier in the sum-check protocol is oblivious to the polynomial g whose evaluations are being summed until the last step
- ❎ The uniqueness of multilinear extensions is crucial for the soundness of the sumcheck protocol
- ❎ The claim f(x) = g(x) for all k-bit inputs, where f and g are low degree polynomials over a large field, can be reduced to the following sumcheck claim: _{x ^k} (f(x)-g(x)) = 0
- ❎ The polynomial IOP for SAT (from lecture 4) can be transformed into a SNARK with verifier complexity independent of circuit size
- ✅ The polynomial IOP for SAT (from lecture 4) has optimal prover complexity
- ✅ Extending the polynomial IOP for SAT in the natural way to support gates with n inputs will result in a sumcheck protocol over (n+1) * logS variables
verkle trees