11

Why not rank-2 constraint system or rank-3 constraint system?

How do rank-1 constraint systems link to circuits?

WeCanBeFriends
  • 1,383
  • 11
  • 21

2 Answers2

8

The "rank-1" specifically refers to the rank of the matrix which is produced.

As for the link to circuits, in zk-SNARKS at least, an arithmetic circuit is converted into a R1CS. Each constraint corresponds to one logic gate.

Here's a more detailed walkthrough by Vitalik Buterin: https://medium.com/@VitalikButerin/quadratic-arithmetic-programs-from-zero-to-hero-f6d558cea649

mountbranch
  • 196
  • 3
1

I may be necro-answering a bit, but the terminology seems to be inherited from a general case of quadratic equation (which is a natural generalization of a linear equation). In quadratic equation you would have an equation of form:

$$x^T A x + c^T x = 0,$$

where, given some field $F$, $x \in F^n$ are unknown variables, $c \in F^{n}$ and $A \in F^{n \times n}$ are known coefficients. In other words, a matrix $A = (a_{ij})$ defines constant coefficients of 2nd-degree monoms $a_{ij} x_i x_j$ in the left-hand side.

While in what seems to be called R1CS (with definition taken from here) you have an equation of the following form:

$$(a^T x) \cdot (b^T x) = (c^T * x),$$

It is a particular case of the former system with $A = (a_i \cdot b_j)_{i,j = 1..n}$. It's easy to verify that a non-zero matrix $A$ can be expressed in such form (pairwise products of components of two vectors) iff $\operatorname{rank} A = 1$. This may explain the naming.