You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/zkEVM/concepts/circom-intro-brief.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,13 +37,13 @@ Once obtained, the R1CS can later be used by a zk-SNARK protocol to generate ver
37
37
38
38
A valid proof attests to the fact that the prover knows an assignment to all wires of the circuit that fulfills all the constraints of the R1CS.
39
39
40
-
An issue that arises, when applying zero-Knowledge protocols to complex computations such as a circuit describing the logic of a ZK-rollup, is that the number of constraints to be verified can be extremely large.
40
+
An issue that arises, when applying zero-knowledge protocols to complex computations such as a circuit describing the logic of a ZK-rollup, is that the number of constraints to be verified can be extremely large.
41
41
42
42
CIRCOM was developed for the very purpose of scaling complex Arithmetic circuits by realizing them as combined instantiations of smaller Arithmetic circuits.
43
43
44
44
## What is CIRCOM?
45
45
46
-
CIRCOM is a domain-specific language (DSL) used to define Arithmetic circuits, and it has an associated compiler of Arithmetic circuits to their respective R1CS.
46
+
CIRCOM is a Domain-Specific Language (DSL) used to define Arithmetic circuits, and it has an associated compiler of Arithmetic circuits to their respective R1CS.
Copy file name to clipboardExpand all lines: docs/zkEVM/concepts/generic-state-machine/exec-trace-correct.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,13 @@ In this document we discuss how the correctness of the execution trace is ensure
2
2
3
3
The first step is to build a mechanism for verifying correctness of the execution trace. This requires creating a set of arithmetic constraints that only hold true when the execution trace is correct. These arithmetic constraints are equations that registry values in any two consecutive rows of the correct execution trace, must satisfy.
4
4
5
-
Similar to the mFibonacci SM, where each state had to conform to polynomial identities, the arithmetic constraints of the generic state machine are translated into polynomial identities, and ultimately be translated into the PIL language.
5
+
Similar to the mFibonacci SM, where each state had to conform to polynomial identities, the arithmetic constraints of the generic state machine are translated into polynomial identities and ultimately into the PIL language.
6
6
7
7
## Constructing arithmetic constraints
8
8
9
9
Since these arithmetic constraints govern state transitions, they express the next state $\big(\mathtt{A'} ,\mathtt{B'}\big)$ in terms of the current state $\big(\texttt{A},\texttt{B}\big)$. That is, in terms of the execution trace, the new registry values are linear combinations of previous registry values, together with constants and free inputs.
10
10
11
-
We therefore need auxiliary columns for selectors. Like switches that can either be ON or OFF, selectors too can either have a value $\mathtt{1}$ or $\mathtt{0}$, depending on the instruction being executed.
11
+
We therefore need auxiliary columns for selectors. Like switches that can either be _ON_ or _OFF_, selectors too can either have a value $\mathtt{1}$ or $\mathtt{0}$, depending on the instruction being executed.
12
12
13
13
In continuing with the previous example of a four-instruction state machine,
14
14
@@ -124,7 +124,7 @@ $$
124
124
125
125
2. It shall be seen later, in our implementation of a state machine with jumps, that $\texttt{CONST}$ is in fact a committed polynomial rather than a constant polynomial.
126
126
127
-
3. All the operations in the constraints are carried out $\mathtt{\ modulo }$ the order $p$ of the prime field. The so-called Goldilocks-like Field, with $p = 2^{64} − 2^{32} +1$, is mainly used where 64-bit numbers suffice (see [Plonky2](https://github.com/mir-protocol/plonky2/blob/main/plonky2/plonky2.pdf)). Otherwise, the [BN128 field](https://iden3-docs.readthedocs.io/en/latest/iden3_repos/research/publications/zkproof-standards-workshop-2/baby-jubjub/baby-jubjub.html) is deployed.
127
+
3. All operations in the constraints are carried out $\mathtt{\ modulo }$ the order $p$ of the prime field. The so-called Goldilocks-like field, with $p = 2^{64} − 2^{32} +1$, is mainly used where 64-bit numbers suffice (see [Plonky2](https://github.com/mir-protocol/plonky2/blob/main/plonky2/plonky2.pdf)). Otherwise, the [BN128 field](https://iden3-docs.readthedocs.io/en/latest/iden3_repos/research/publications/zkproof-standards-workshop-2/baby-jubjub/baby-jubjub.html) is used.
128
128
129
129
In order to match the type of commitment scheme used in the zkEVM, these arithmetic constraints must first be expressed as polynomial identities, which are in turn compiled with PILCOM.
Copy file name to clipboardExpand all lines: docs/zkEVM/concepts/generic-state-machine/intro-generic-sm.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,9 @@ The aim with this document is to explain how the machinery used in the mFibonacc
12
12
13
13
Think of our state machine as being composed of two parts; the part that has to do with generating the execution trace, while the other part is focused on verifying that the executions were correctly executed.
14
14
15
-
- The former part is more like the "software" of the state machine, as it is concerned with interpreting program instructions and correctly generating the execution trace. A novel language dubbed the zero-knowledge Assembly (zkASM) language is used in this part.
15
+
- The former part is more like the 'software' of the state machine, as it is concerned with interpreting program instructions and correctly generating the execution trace. A novel language dubbed the zero-knowledge Assembly (zkASM) language is used in this part.
16
16
17
-
- But the latter part is more like the "hardware" as it consists of a set of arithmetic constraints (or their equivalent, polynomial identities) that every correctly generated execution trace must satisfy. Since these arithmetic constraints are transformed into polynomial identities (via an interpolation process), they are described in a novel language called the polynomial identity language (PIL).
17
+
- But the latter part is more like the 'hardware' as it consists of a set of arithmetic constraints (or their equivalent, polynomial identities) that every correctly generated execution trace must satisfy. Since these arithmetic constraints are transformed into polynomial identities (via an interpolation process), they are described in a novel language called the Polynomial Identity Language (PIL).
Copy file name to clipboardExpand all lines: docs/zkEVM/concepts/mfibonacci/commitment-scheme.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,14 +36,14 @@ For all practical purposes, such the constructed proof-verification system needs
36
36
37
37
Proof systems based on testing polynomial identities take advantage of a basic property of polynomials expressed by the [Schwartz-Zippel lemma](https://courses.cs.washington.edu/courses/cse521/17wi/521-lecture-7.pdf).
38
38
39
-
According to the Schwartz-Zippel lemma;
39
+
According to the Schwartz-Zippel lemma:
40
40
41
-
>For any non-zero polynomial ${Q(X_1, \dots , X_n)}$ on ${n}$ variables with degree ${d}$, and ${S}$ a finite but sufficiently large subset of the field $\mathbb{F}$, then values ${ X_1, \dots , X_n }$ from ${S}$ are independently and uniformly assigned at random, then
41
+
-For any non-zero polynomial ${Q(X_1, \dots , X_n)}$ on ${n}$ variables with degree ${d}$, and ${S}$ a finite but sufficiently large subset of the field $\mathbb{F}$, then values ${ X_1, \dots , X_n }$ from ${S}$ are independently and uniformly assigned at random, then
42
42
${Pr[Q(X_1, \dots , X_n) = 0] ≤ \dfrac{d}{|S|}}$.
43
43
44
44
Here's what the Schwartz-Zippel lemma means in the specific case of the mFibonacci state machine:
45
45
46
-
>If the verifier selects the challenges $\{ \alpha_1, \alpha_2 . . . , \alpha_l \}$ randomly and uniformly, then the probability of the prover finding a false polynomial ${Q'}$ of degree $d$, such that ${Q'(\alpha_j) = 0 = Q(\alpha_j)}$ for all $j \in \{ 1, 2, \dots , l \}$ , is at most ${\dfrac{d}{|S|}}$, which is very small.
46
+
-If the verifier selects the challenges $\{ \alpha_1, \alpha_2 . . . , \alpha_l \}$ randomly and uniformly, then the probability of the prover finding a false polynomial ${Q'}$ of degree $d$, such that ${Q'(\alpha_j) = 0 = Q(\alpha_j)}$ for all $j \in \{ 1, 2, \dots , l \}$ , is at most ${\dfrac{d}{|S|}}$, which is very small.
47
47
48
48
This speaks of the soundness of our polynomial commitment scheme.
Copy file name to clipboardExpand all lines: docs/zkEVM/concepts/mfibonacci/mfibonacci-example.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
Consider a proof-verification scheme, using an arbitrary Polynomial Commitment Scheme, where users have to prove knowledge of the N-th member of a multiplicative Fibonacci series, for specific initial conditions.
1
+
Consider a proof-verification scheme, using an arbitrary Polynomial Commitment Scheme. In this scheme, users must prove knowledge of the $Nth$ member of a multiplicative Fibonacci series for specific initial conditions.
2
2
3
3
## What is a multiplicative Fibonacci series?
4
4
@@ -12,7 +12,7 @@ has the property that the product of every two consecutive members $\mathbf{a_{i
12
12
13
13
Also, the initial values are specified as $\mathbf{a_0} = 2$ and $\mathbf{a_1} = 1$.
14
14
15
-
Here are the first ten members of the mFibonacci series,
15
+
Here are the first ten terms of the mFibonacci series,
@@ -220,7 +220,7 @@ In the context of our mFibonacci SM, the verifier can set the initial conditions
220
220
221
221
Boundary constraints apply to particular registry values, and are used to enforce that the correct initial state was applied.
222
222
223
-
The idea here is to set up a specific boundary constraint, which the verifier can use to check that correct initial conditions were applied, when the prover was computing a particular N-th term of the mFibonacci series. Yet, the verifier must not disclose any information about the secret values $A_0$ and $B_0$.
223
+
The idea here is to set up a specific boundary constraint, which the verifier can use to check that correct initial conditions were applied, when the prover was computing a particular $Nth$ term of the mFibonacci series. Yet, the verifier must not disclose any information about the secret values $A_0$ and $B_0$.
224
224
225
225
Therefore, the first thing to do, is removing terms in the identities bearing the initial values $A_0$ and $B_0$. This means modifying our polynomial identities to the ones below;
226
226
@@ -245,7 +245,7 @@ This logic is valid simply because the computations carried out by the state mac
245
245
246
246
All computations are carried out in a field $\mathbb{F}_p$ , where $p = \mathtt{2^{64}-2^{32}+1}$, a Goldilocks-like prime number.
247
247
248
-
Suppose the verifier knows that an mFibonacci series starting with initial values, $A_0$ and $B_0$, yields $A_{\mathtt{1023}} = \mathtt{14\ 823\ 897\ 298\ 192\ 278\ 947}$ as the value of the $\mathtt{1024}$-th term. The verifier can challenge anyone to prove knowledge of the initial condition of the mFibonacci SM to provide three polynomials and the correct $\mathtt{1024}$-th term. That is, the verifier uses the following constraints to verify the prover's submissions;
248
+
Suppose the verifier knows that an mFibonacci series starting with initial values, $A_0$ and $B_0$, yields $A_{\mathtt{1023}} = \mathtt{14\ 823\ 897\ 298\ 192\ 278\ 947}$ as the value of the $\mathtt{1024}$-th term. The verifier can challenge anyone to prove knowledge of the initial condition of the mFibonacci SM to provide three polynomials and the correct $\mathtt{1024}$-th term. That is, the verifier uses the following constraints to verify the prover's submissions:
Copy file name to clipboardExpand all lines: docs/zkEVM/concepts/mfibonacci/pil-stark.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
The description given here is by no means the architecture of the PIL-STARK system.
6
6
7
-
Simply put, PIL-STARK is a special STARK that enables,
7
+
Simply put, PIL-STARK is a special STARK that enables:
8
8
9
9
- The state machine prover (SM-prover) to generate STARK proofs for any state machine written in PIL.
10
10
- The state machine verifier (SM-verifier) to verify STARK proofs generated by the prover.
@@ -31,19 +31,21 @@ The $\texttt{setup executor}$ takes as input the PIL $\texttt{.json}$ file from
31
31
32
32
### PIL-STARK setup
33
33
34
-
The PIL-STARK setup takes as inputs; the PIL $\texttt{.json}$ file from $\texttt{PILCOM}$, the evaluations of the constant polynomials from the $\texttt{setup}$ $\texttt{executor}$, and the STARK configuration information in the form of a $\texttt{starkstruct.json}$ file. It then creates a Merkle tree with the evaluations of all the constant polynomials, called the $\texttt{constTree}$
34
+
The PIL-STARK setup takes the PIL $\texttt{.json}$ file from $\texttt{PILCOM}$, the evaluations of the constant polynomials from the $\texttt{setup}$ $\texttt{executor}$, and the STARK configuration information in the form of a $\texttt{starkstruct.json}$ file as inputs. It then creates a Merkle tree with the evaluations of all the constant polynomials, called the $\texttt{constTree}$
35
35
36
36
It outputs PIL-STARK parameters; the $\texttt{constTree}$ which is a Merkle tree of evaluations of the constant polynomials, the $\texttt{starkInfo}$ which is a STARK-specific information, and the $\texttt{constRoot}$ which is the root of the $\texttt{constTree}$.
37
37
38
-
Overall, the setup phase of PIL-STARK takes as inputs; the $\texttt{.pil}$ file describing the state machine and STARK-specific parameters. Its outputs are; the evaluations of the constant polynomials, the $\texttt{constTree}$, the $\texttt{starkInfo}$, the $\texttt{constRoot}$, as well as the PIL $\texttt{.json}$ file from $\texttt{PILCOM}$.
38
+
Overall, the setup phase of PIL-STARK takes the $\texttt{.pil}$ file describing the state machine and STARK-specific parameters as inputs. Its outputs are the evaluations of the constant polynomials, the $\texttt{constTree}$, the $\texttt{starkInfo}$, the $\texttt{constRoot}$, as well as the PIL $\texttt{.json}$ file from $\texttt{PILCOM}$.
39
39
40
40
We emphasise that the setup phase of PIL-STARK is run only once for a particular $\texttt{.pil}$ file describing the state machine. A change in the $\texttt{.pil}$ file means a fresh setup needs to be executed.
The proving phase consists of two main components; the $\texttt{SM-prover}$ $\texttt{executor}$ and the PIL-STARK proof $\texttt{Generator}$.
46
+
The proving phase consists of two main components:
47
+
- the $\texttt{SM-prover}$ $\texttt{executor}$.
48
+
- the PIL-STARK proof $\texttt{Generator}$.
47
49
48
50
### SM-prover's executor
49
51
@@ -57,13 +59,13 @@ However, with every set of inputs, the SM-prover's executor computes correspondi
57
59
58
60
### PIL-STARK proof generator
59
61
60
-
This STARK Proof Generator takes as inputs; the evaluations of the committed polynomials from the SM-prover's executor, the evaluations of the constant polynomials from the setup phase, together with the $\texttt{constTree}$ and the $\texttt{starkInfo}$.
62
+
This STARK Proof Generator takes the evaluations of the committed polynomials from the SM-prover's executor, the evaluations of the constant polynomials from the setup phase, together with the $\texttt{constTree}$ and the $\texttt{starkInfo}$ as inputs.
61
63
62
64
This is where the evaluations of the committed polynomials, from the SM-prover's executor, are Merkelized. And all elements of the ultimate STARK proof are generated, these include; the witness and the required openings of the committed polynomials.
63
65
64
66
The output of the STARK Proof Generator is a $\texttt{STARK}$ $\texttt{proof}$ and the $\texttt{publics}$, which are values to be publicised.
65
67
66
-
For the PIL-STARK proving phase as a whole, also as depicted in Figure 9 below,
68
+
For the PIL-STARK proving phase as a whole, also as depicted in Figure 9 below:
67
69
68
70
- there are five (5) inputs; the $\texttt{input.json}$ file, the PIL $\texttt{.json}$ file from $\texttt{PILCOM}$, the evaluations of the constant polynomials from the setup phase, as well as the $\texttt{constTree}$ and the $\texttt{starkInfo}$.
69
71
- and there are two (2) outputs; a $\texttt{STARK}$ $\texttt{proof}$ and the $\texttt{publics}$.
@@ -76,7 +78,7 @@ The verification phase is constituted by the PIL-STARK verifier.
76
78
77
79
As it is common practice amongst zero-knowledge proof-verification systems, the size of the verifier's inputs is very small compared to that of the prover's inputs. For example, while the proving phase takes the whole $\texttt{constTree}$ as one of its inputs, the verifier takes the $\texttt{constRoot}$ instead.
78
80
79
-
The inputs to the verifier are; the $\texttt{STARK}$ $\texttt{proof}$ and the $\texttt{publics}$ from the prover, together with the $\texttt{starkInfo}$ and the $\texttt{constRoot}$ from the setup phase.
81
+
The $\texttt{STARK}$ $\texttt{proof}$ and the $\texttt{publics}$ from the prover, together with the $\texttt{starkInfo}$ and the $\texttt{constRoot}$ from the setup phase are the inputs for the verifier.
80
82
81
83
And the verifier's output is either an $\texttt{Accept}$ if the proof is accepted, or a $\texttt{Reject}$ if the proof is rejected.
Copy file name to clipboardExpand all lines: docs/zkEVM/concepts/mfibonacci/verification-scheme.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ FRI is in fact a Merkle commitment scheme where commitments are roots of Merkle
30
30
31
31
#### Why is FRI fast?
32
32
33
-
The FRI protocol is considered fast for the following reasons.
33
+
The FRI protocol is considered fast for the following reasons:
34
34
35
35
1. Its resemblance of the ubiquitous Fast Fourier Transforms (FFTs).
36
36
2. The strict linearity of the prover's arithmetic complexity.
@@ -43,7 +43,7 @@ We later demonstrate how PIL-STARK is used to prove polynomial identities of the
43
43
44
44
Before describing PIL-STARK, let's take a look at the novel polynomial identity language (PIL), and some of its distinguishing features.
45
45
46
-
### Polynomial identity language
46
+
### Polynomial Identity Language (PIL)
47
47
48
48
PIL is a domain-specific language (DSL) designed for naming polynomials and describing identities that define the computations performed by a state machine.
0 commit comments