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
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,11 @@
6
6
7
7
As seen in the [zkProver Overview](../architecture/zkprover/index.md) document, the output of the STARK Recursion component is a STARK proof.
8
8
9
-
The next step in the zkProver's process of providing validity proof is to **produce the witness similar to the output of the STARK Recursion**.
9
+
The next step in the zkProver's process of providing validity proof is to produce the witness similar to the output of the STARK Recursion.
10
10
11
11
Although the zkProver is designed as a state machine emulating the EVM, in order to generate this witness, it makes use of a tool based on the Arithmetic circuits model, called CIRCOM.
12
12
13
-
**CIRCOM takes the output of the STARK Recursion as input, so as to create its corresponding witness**.
13
+
CIRCOM takes the output of the STARK Recursion as input, so as to create its corresponding witness.
14
14
15
15
The witness is in turn taken as input to the Rapid SNARK, which is used to generate a SNARK proof published as the validity proof.
16
16
@@ -50,7 +50,7 @@ CIRCOM is a Domain-Specific Language (DSL) used to define Arithmetic circuits, a
50
50
51
51
### CIRCOM as a DSL
52
52
53
-
As described in the title of its [specifications paper](https://www.techrxiv.org/articles/preprint/CIRCOM_A_Robust_and_Scalable_Language_for_Building_Complex_Zero-Knowledge_Circuits/19374986/1), CIRCOM is a **language for building complex zero-knowledge circuits**.
53
+
As described in the title of its [specifications paper](https://www.techrxiv.org/articles/preprint/CIRCOM_A_Robust_and_Scalable_Language_for_Building_Complex_Zero-Knowledge_Circuits/19374986/1), CIRCOM is a language for building complex zero-knowledge circuits.
54
54
55
55
It is designed as a low-level circuit language, mimicking the design of electronic circuits, for naturally defining Arithmetic circuits.
56
56
@@ -66,7 +66,7 @@ However, CIRCOM users can also use templates from [CIRCOMLIB](https://github.com
66
66
67
67
In addition to being a DSL used to define and create Arithmetic circuits, CIRCOM has a special compiler of Arithmetic circuits into their equivalent R1CS.
68
68
69
-
The term "CIRCOM" is in fact short for **Circuit Compiler**, implying that the CIRCOM compiler takes an Arithmetic circuit as input and outputs the following:
69
+
The term "CIRCOM" is in fact short for Circuit Compiler, implying that the CIRCOM compiler takes an Arithmetic circuit as input and outputs the following:
70
70
71
71
- A file with the R1CS description, containing the set of associated R1CS constraints, and
72
72
- A program written either in C++ or WebAssembly, for efficiently computing a valid assignment to all wires of the circuit (the witness).
@@ -124,9 +124,9 @@ c <== a * b;
124
124
125
125
### Creation of templates
126
126
127
-
One of the main peculiarities of CIRCOM is the allowance to define parameterizable small circuits called **templates**.
127
+
One of the main peculiarities of CIRCOM is the allowance to define parameterizable small circuits called templates.
128
128
129
-
Templates are **parametrizable** in the sense that their outputs depend on free input values (i.e., values that are freely chosen by users).
129
+
Templates are parametrizable in the sense that their outputs depend on free input values (i.e., values that are freely chosen by users).
130
130
131
131
They are general descriptions of circuits, that have some input and output signals, as well as a relation between the inputs and the outputs.
132
132
@@ -149,7 +149,7 @@ template Multiplier () {
149
149
150
150
Although the above code succeeds in creating the `Multiplier template`, the template is yet to be instantiated.
151
151
152
-
In CIRCOM, the instantiation of a template is called a **component**, and it is created as follows:
152
+
In CIRCOM, the instantiation of a template is called a component, and it is created as follows:
153
153
154
154
```
155
155
component main = Multiplier();
@@ -191,7 +191,7 @@ At this stage, either one of the C++ or WebAssembly programs generated by the co
191
191
192
192
Whichever program is used, needs as input, a file containing a set of valid input values.
193
193
194
-
Recall that **a valid set of circuit input, intermediate and output values is called the witness**.
194
+
Recall that a valid set of circuit input, intermediate and output values is called the witness.
195
195
196
196
### Private and public signals
197
197
@@ -227,7 +227,7 @@ Note that global inputs are considered `private` signals while global outputs ar
227
227
228
228
However, the `main` component has a special attribute to set a list of global inputs as public signals.
229
229
230
-
The rule of thumb is: **Any other input signal not included in this list `{public [s1,..,sn]}`, is considered private**.
230
+
The rule of thumb is: Any other input signal not included in this list `{public [s1,..,sn]}`, is considered private.
This section covers some of the basic concepts crucial to understanding the design approach of Polygon zkEVM. Since Polygon zkEVM emulates the EVM, a few EVM basics are herein detailed.
2
+
3
+
One of the differences between Polygon zkEVM and Ethereum is in the way their states are recorded. Ethereum uses Patricia Merkle tries while Polygon zkEVM uses Sparse Merkle trees (SMTs). The Concepts section therefore discusses how SMTs are constructed and the Create, Read, Update and Delete operations executed on the SMTs.
4
+
5
+
The design approach is delineated in terms of an example: the multiplicative Fibonacci state machine. Further details of the Polygon zkEVM design are given in the form of a 'Generic state machine', which involves a program written in zkASM called the ROM.
6
+
7
+
This section also includes a brief discussion on what CIRCOM is, and how it is used in the zkProver.
This introduction to the how to section is being written.
1
+
The aim with this section is to demostrate that existing smart contracts, developer toolings and wallets work seamlessly in Polygon zkEVM as in Ethereum.
2
+
3
+
Herein are guides to writing a smart contract using the OpenZeppelin Wizard, deploying an NFT using Foundry, deploying an ERC-20 token using Hardhat, and verifying a smart contract either manually on the Explorer or using Remix.
This section contains specifications of other zkEVM features not covered in the Architecture section of this documentation.
2
+
3
+
First are the two novel languages: The zero-knowledge Assembly (zkASM) language which interpretes the firmware of microprocessor-type state machines, and the Polynomial Identity Language (PIL) which is instrumental in enabling verification of state transitions.
4
+
5
+
Second are some of the differences between Polygon zkEVM and the EVM. These are differences in terms of opcodes, supported precompiled contracts, newly added features and other variances.
0 commit comments