This part explains about what is the Cycle of Curve and How it works in Nova Folding. The original Nova paper used a single elliptic curve. However, Recursion, which generally repeats Proving and (partial) Verifying, can improve the efficiency of proof generation by using a special pair of two elliptic curves called a Cycle of Curves. So the implementation of Nova Folding also employs the Cycle of Curve. The paper, Revisiting the Nova Proof System on a Cycle of Curves, discusses how Nova works with the Cycle of Curve and bugs found in early implementations of Nova with the Cycle of Curve.
The purpose of this article is to provide a basic understanding of elliptic curves and the Cycle of Curves and how it is utilized in Nova Folding.
We begin with knowledge of elliptic curves.
Order
Order refers to the number of elements in a group or a field. For
A group is a set combined with an operation (such as addition or multiplication) that satisfies Four conditions: Closure, Associativity, Identity, and Invertibility. When we examine
In
-
Closure: For any two elements
$a, b$ in$Z_7$ , the operation$a + b$ results in an element also in$Z_7$ . For instance,$6 + 2 = 8 \mod 7 = 1$ . -
Associativity: For any three elements
$a, b, c$ in$Z_7$ , the equation$(a + b) + c = a + (b + c)$ always holds. For example,$(1 + 2) + 3 = 6$ , and$1 + (2 + 3) = 6$ . -
Identity: For any element
$a$ in$Z_7$ , adding 0 does not change the element, making 0 the identity element. For example,$4 + 0 = 4$ . -
Invertibility: For every element
$a$ in$Z_7$ , there exists an element$b$ such that$a + b = 0 \mod 7$ . For example, the inverse of 3 is 4 because$3 + 4 = 7 \mod 7 = 0$ .
In the case of group under multiplication, $Z_7^$ consists non-zero element $1,2,3,4,5,6$. And the identity element is $1$, not $0$, as every number multiplied by $1$ remains unchanged. In invertibility, for each element $a$ in $Z_7^$, there exists a corresponding element
An Abelian group, also known as a commutative group, is a group in which the operation is commutative in addition to the four rules of group.
-
commutative: For any two elements
$a, b$ ,$a + b = b + a$ . For instance,$Z_7$ forms an Abelian group under addition, as shown by$3 + 4 = 7 \mod 7 = 0$ and$4 + 3 = 7 \mod 7 = 0$ .
To further understand the concept of a cyclic group and its generator, let's focus on
$2 \mod 7 = 2$ $(2 + 2) \mod 7 = 4$ $(2 + 2 + 2) \mod 7 = 6$ $(2 + 2 + 2 + 2) \mod 7 = 1$ $(2 + 2 + 2 + 2 + 2) \mod 7 = 3$ $(2 + 2 + 2 + 2 + 2 + 2) \mod 7 = 5$ $(2 + 2 + 2 + 2 + 2 + 2 + 2) \mod 7 = 0$ $(2 + 2 + 2 + 2 + 2 + 2 + 2 + 2) \mod 7 = 2$
In this sequence, we start with 2 and, by continuously adding 2, we eventually produce every element in
The fascinating aspect of cyclic groups, especially in a set like
A subgroup is a subset of a group that itself forms a group under the same operation defined for the original group. To qualify as a subgroup, this subset must satisfy the group's rules: Closure, Associativity, Identity, and Invertibility.
A field is an algebraic structure where two operations, addition and multiplication, have six characteristics: Closure, Associativity, Commutativity, Identity, Invertibility, and Distributivity.
-
Closure:
-
Closure under Addition: For any two elements
$a, b$ in$Z_7$ , their sum$a + b$ is also in$Z_7$ . For instance, adding 6 and 2 gives$6 + 2 = 8 \mod 7 = 1$ . -
Closure under Multiplication: For any two elements
$a, b$ in$Z_7$ , their product$a \times b$ is also in$Z_7$ . For example, the product of 3 and 2 is$3 \times 2 = 6 \mod 7 = 6$ .
-
Closure under Addition: For any two elements
-
Associativity:
-
Additive Associativity: For any three elements
$a, b, c$ in$Z_7$ , the equation$(a + b) + c = a + (b + c)$ always holds. For example, taking$a = 2, b = 3, c = 4$ in$Z_7$ , we have$(2 + 3) + 4 = 5 + 4 = 9 \mod 7 = 2$ and$2 + (3 + 4) = 2 + 7 \mod 7 = 2$ . -
Multiplicative Associativity: Similarly, for any three elements
$a, b, c$ in$Z_7$ , the equation$(a \times b) \times c = a \times (b \times c)$ is always true. For example, with$a = 2, b = 3, c = 4$ in$Z_7$ ,$(2 \times 3) \times 4 = 6 \times 4 = 24 \mod 7 = 3$ and$2 \times (3 \times 4) = 2 \times 12 \mod 7 = 3$ .
-
Additive Associativity: For any three elements
-
Commutativity:
-
Additive Commutativity: For any two elements
$a, b$ , the operation$a + b = b + a$ holds. For example, in$Z_7$ ,$2 + 5 = 7 \mod 7 = 0$ and$5 + 2 = 7 \mod 7 = 0$ . This property is a hallmark of an Abelian group. -
Multiplicative Commutativity: Similarly, for multiplication,
$a \times b = b \times a$ for any$a, b$ , excluding the special case of the additive identity (0). For example,$3 \times 4 = 12 \mod 7 = 5$ and$4 \times 3 = 12 \mod 7 = 5$ . This extends the concept of Abelian groups to the multiplicative operation within a field.
-
Additive Commutativity: For any two elements
-
Identity:
-
Additive Identity: The element
$0$ acts as the additive identity, where$a + 0 = a$ for any$a$ . For example,$4 + 0 = 4$ . -
Multiplicative Identity: The element
$1$ serves as the multiplicative identity in$Z_7$ , where$a \times 1 = a$ for any$a$ . For example,$5 \times 1 = 5$ .
-
Additive Identity: The element
-
Invertibility:
-
Additive Inverses: For each element
$a$ in$Z_7$ , there exists an additive inverse$-a$ such that$a + (-a) = 0$ . For example, the additive inverse of$3$ is$4$ because$3 + 4 = 7 \mod 7 = 0$ . -
Multiplicative Inverses: For each non-zero element
$a$ in$Z_7$ , there exists a multiplicative inverse$a^{-1}$ such that$a \times a^{-1} = 1$ . For example, the multiplicative inverse of$3$ is$5$ because$3 \times 5 = 15 \mod 7 = 1$ .
-
Additive Inverses: For each element
-
Distributivity: This law connects the two operations in
$Z_7$ , stating that$a \times (b + c) = a \times b + a \times c$ and$(a + b) \times c = a \times c + b \times c$ . For example,$2 \times (3 + 4) = 2 \times 7 \mod 7 = 0$ and$(2 \times 3) + (2 \times 4) = 6 + 8 \mod 7 = 0$ .
A Finite Field is defined as a field that contains a finite number of elements.
Elliptic curves are defined by a specific equation, commonly known as the Weierstrass equation, represented as follows:
In cryptography, elliptic curves are defined over finite fields
Elliptic curves are defined over a finite field
The calculations on elliptic curves are performed within this finite field, following modular arithmetic. Then, the coordinates (x,y) are satisfying the formula form a group.
The elliptic curve group
To confirm that the elliptic curve group is indeed a group, let's check that the axioms are satisfied. Here we want to focus on Invertibility.
Addition of elliptic curves over a finite field is defined as:
Pairing-based Cryptography와 BLS signature의 이해 — Part 1
So if we try to add
Pairing-based Cryptography와 BLS signature의 이해 — Part 1
When the order
In the previous chapter, we mainly dealt with the case where the order of the elliptic curve group itself is prime.
However, in advanced elliptic curve cryptography such as ZKP, the order of the elliptic curve group is not prime. And instead of using the entire elliptic curve group
This subgroup, which is a subset of the whole elliptic curve group,
In this situation, a prime order in a subgroup also assures that the subgroup is cyclic group.
Given an elliptic curve group
The scalar field is denoted as
Now that you understand the concepts of Finite field and Subgroup, let's see how they are utilized in ZKP.
When you write circuits for ZKP in Circom or Halo2, they are defined in Finite Field
As you may know, in the context of pairing-based SNARKs, the process begins by transforming an Arithmetic Circuit into a set of polynomials defined over a finite field, known as a Quadratic Arithmetic Program (QAP). Subsequently, the coefficients of these polynomials are encoded onto points on an elliptic curve. This encoding is achieved by performing scalar multiplications with respect to a generator of a (sub)group
Please remember the naive snark-based IVC. At each step,
Here, we encounter a mathematical challenge due to the prover and verifier operating within different orders. The prover
Meanwhile, the verifier
The core issue is that the prover
So Field emulation may be one of the solution, but it is very unefficient. The purpose of field emulation is to "emulate" operations of
The solution to this mismatch lies in an advanced approach known as "Cycles of Groups." By introducing two groups,
- Group
$G_1$ , with order$p$ , operates over the finite field$F_q$ . - Conversely, Group
$G_2$ , having order$q$ , is defined over the finite field$F_p$ .
This innovative setup enables an extended recursion capability, allowing the prover and verifier to effectively 'jump' between the two proof systems. Consequently, both parties can conduct their operations within their respective fields,
For instance, the Pasta curves comprise two elliptic curves named "Pallas" and "Vesta," which are used in what's referred to as "Cycles of Curve." In this case, a notable point is that the Base field and Scalar field are inverted for each of the curves.
Next, let's look at why Cycle of Curve can make recursion more efficient. Please remember this relationship.
In recursion, two elliptic curves are used alternately.
This illustration was inspired by The Halo2 Book
First, suppose we want to prove a circuit defined by a finite field
Recall the Augmented Circuit, which includes Non-Interactive Folding.
In the Non-Interactive Folding Scheme, it folds two committed relaxed R1CS instances into one. These instances each have commitment values:
This is precisely where the Cycle of Curves becomes relevant. It would be better to define the Augmented Circuit that does the Folding on the two elliptic curves of the Cycle of Curves, and move the value to be Folded back and forth on the two elliptic curves.
Recall this figure, the
To address these inefficiencies, this part explains the use of elliptic curves from a Cycle of Curves to establish the Augmented Constraints over two distinct finite fields.
Images are borrowed from this video: Revisiting the Nova Proof System - Wilson Nguyen.
First, define an Augmented Circuit that contains Non-Interactive Folding on a finite field of two elliptic curves, the pair of the Cycle of Curve.
This approach transfers the
Revisiting Nova provides a detailed description of Nova utilizing the Cycle of Curve and a clear explanation of the bugs found in early Nova implementations, so I recommend anyone interested to take a look. Revisiting the Nova Proof System - Wilson Nguyen