QAP
Consider an arithmetic circuit consisting of multiplication gates and wires. For the th multiplication gate, we assign a constant . Let be a vanishing polynomial over .
Define selector polynomials for of degree such that
- if the -th wire is left input of -th gate, and otherwise.
- if the -th wire is right input of -th gate, and otherwise.
- if the -th wire is output of -th gate, and otherwise.
- specify addition/multiplication by constants.
A quadratic arithmetic program (QAP) over consists of . The wire values satisfy QAP iff there exists some such that where .
Relation
Given an index , we obtain the following indexed relation:
where is the size of public statement.
The naive protocol
For a moment, let’s assume that a public statement is empty i.e. . To prove knowledge of a valid witness vector , we can consider the following protocol that checks divisibility of QAP relation taking advantage of bilinear pairings.
Protocol
- Setup : Output a CRS containing
- for
- for
- Prove: outputs where
- (as above, i.e. )
- Verify: checks
Attacks
Assuming that an adversary only performs generic group operations on CRS , we can at least make sure that for some polynomials such that , the polynomial is divisible by . It is easy to see however that a cheating prover can convince the verifier in essentially two ways: (1) use arbitrarily shifted polynomials to construct e.g. instead of the linear span of , and (2) use inconsistent wire values to construct i.e. .
To counter the first attack, we can introduce additional pairing checks to make sure that are computed from the correct linear spans. That is, we ask a prover to additionally output , while including (but e.g. not ) in the CRS. In this way the prover is forced to construct as linear combinations of only. The second attack can be thwarted by adding another pairing check to make sure that the same coefficients are used for . This can be realized by having a prover compute while including in the CRS.
Simple Pinocchio
In what follows, we assume the type-I pairing for simplicity (used in the “wire consistency check” below).
Protocol
- Setup : Output a CRS containing
- for
- for
- for
- for
- Prove: outputs where
- ,
- ,
- ,
- Verify: performs the following checks.
- Divisibility check:
- Linear span check:
- Wire consistency check:
Pinocchio with public inputs
Now it is easy to account for public inputs . All we need to do is to ask a prover to compute the above using private inputs and a verifier to adjust the proof strings using the knowledge of a public statement, respectively.
Protocol
- Setup : Output a CRS containing
- for
- for
- for
- for
- Prove: outputs where
- ,
- ,
- ,
- Verify: first adjusts proof strings as follows:
- and then performs the following checks.
- Divisibility check:
- Linear span check: , ,
- Wire consistency check: