CCS
Customizable Constraint System
Definition 2.1 (R1CS). An R1CS structure S consists of:
size bounds m,n,N,ℓ∈N where n>ℓ
and three matrices A,B,C∈Fm×n with at most N=Ω(max(m,n)) non-zero entries in total.
An R1CS instance consists of public input x∈Fℓ. An R1CS witness consists of a vector w∈Fn−ℓ−1. An R1CS structure-instance tuple (S,x) is satisfied by an R1CS witness w if:
where
Here, A⋅z denotes a matrix-vector multiplication operation, ∘ denotes the Hadamard (i.e., entry-wise) product between vectors, and 0 is a zero vector in Fm.
Definition 2.2 (CCS). A CCS structure S consists of:
size bounds m,n,N,ℓ,t,q,d∈N where n>ℓ
a sequence of matrices M0,…,Mt−1∈Fm×n with at most N=Ω(max(m,n)) non-zero entries in total
a sequence of q multisets [S0,…,Sq−1], where an element in each multi-set is from the domain {0,...,t−1} and the cardinality of each multi-set is at most d
a sequence of q constants [c0,…,cq−1], where each constant is from F
A CCS instance consists of public input x∈Fℓ. A CCS witness consists of a vector w∈Fn−ℓ−1. Then, a CCS structure-instance tuple (S,x) is satisfied by a CCS witness w if:
where
Mj⋅z denotes matrix-vector multiplication, ◯ denotes the Hadamard product between vectors, and 0 is a zero vector in Fm.
CCS can be easily converted to R1CS. I will leave it as a thought exercise.
Representing Plonkish with CCS
Let's recall the Plonkish constraint system first.
Definition 2.3 (Plonkish). A Plonkish structure S consists of:
size bounds m,n,ℓ,t,q,d,e∈N;
a multivariate polynomial g in t variables, where g is expressed as a sum of q monomials and each monomial has a total degree at most d;
a vector of constants called selectors s∈Fe; and
a set of m constraints. Each constraint i is specified via a vector Ti of length t, with entries in the range {0,...,n+e−1}. Ti is interpreted as specifying t entries of a purported satisfying assignment z to feed into g.
A Plonkish instance consists of public input x∈Fℓ. A Plonkish witness consists of a vector w∈Fn−ℓ. A Plonkish structure-instance tuple (S,x) is satisfied by a Plonkish witness w if:
where z=(w,x,s)∈Fn+e.
Representing AIR with CCS
Definition 2.4 (AIR). An AIR structure S consists of:
size bounds m,t,q,d∈N, where t is even;
a multivariate polynomial g in t variables (also known as state transition constraint), where g is expressed as a sum of q monomials and each monomial has total degree at most d.
An AIR instance consists of public input and output x∈Ft. An AIR witness consists of a vector w∈F(m−1)⋅t/2. Let
Notice that, z can be viewed as F(m+1)×t/2 matrix. Let us index the m+1 “rows” of z as 0,1,...,m. An AIR structure-instance tuple (S,x) is satisfied by an AIR witness w if:
Handling many AIR constraint polynomials
To represent the constraints capturing a single step of a CPU, typically many polynomials g will be needed, say g1,...,gk. In practice, k may be in the many dozens to hundreds [GPR21, BGtRZt23]. There is, however, a straightforward and standard randomized reduction from AIR with k>1 constraint polynomials to AIR with a single constraint polynomial g: the verifier picks a random r∈F and sends it to the prover, and the prover replaces g1,...,gk with the single constraint polynomial
If Equation (7) holds for all g1,…,gk in place of g, then with probability 1 over the choice of r the same will hold for the random linear combination g. Meanwhile, if it fails to hold for any gi then with probability at least 1−∣F∣(k−1), it will fail to hold for the random linear combination g. You could also get k random values for each polynomial, which improves the soundness error to ∣F∣1.
Lemma 3 (AIR to CCS transformation). Given an AIR structure SAIR=(m,t,q,d,g), instance IAIR=x, and witness wAIR=w, there exists a CCS structure SCCS such that the tuple (SCCS,x) is satisfied by w if and only if (SAIR,x) is satisfied by w. The natural NP checker’s time to verify the tuple ((SCCS,x),w) is identical to the runtime of the NP checker that evaluates g monomial-by-monomial when checking that ((SAIR,x),w) satisfies Equation (7).
Proof.
Let wCCS=wAIR and ICCS=IAIR.
Let SCCS=(m,n,N,ℓ,t,q,d,[M0,…,Mt−1],[s0,…,sq−1],[c0,…,cq−1]) where:
m,t,q,d are from the SAIR
ℓ←t/2,n←(m+1)⋅t/2
Deriving M0,…,Mt−1, and N.
Recall that g in SAIR is a multivariate polynomial in t variables. There is a CCS row for each of the m transition constraints in SAIR, so, if we index the CCS rows by {0,…,m−1}, it suffices to specify how the ith row of these matrices is set. We consider three cases:
For all i∈{0,…,m−1},j∈{0,1...,t−1}, let kj=i⋅t/2+j.
If i=0 and j<t/2, we set Mj[i][j+∣wAIR∣]=1.
If i=m−1 and j≥t/2, we set Mj[i][j+∣wAIR∣+t/2]=1.
Otherwise, we set Mj[i][kj]=1.
NOTE: In this version, I think the authors assumed:
Last updated