Skip to content

Commit ad1e5b9

Browse files
author
Nadim Kobeissi
authored
Merge pull request 0xPolygon#43 from 0xPolygon/empieichO-docs-review
Last but one table rendering fixes
2 parents 5cb5403 + 493ea8d commit ad1e5b9

File tree

17 files changed

+219
-431
lines changed

17 files changed

+219
-431
lines changed

docs/zkEVM/concepts/circom-intro-brief.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The set of valid circuit input, intermediate and output values satisfying the R1
2222

2323
This document focuses on what CIRCOM is, its common context of implementation, and how the zkProver utilizes CIRCOM.
2424

25-
## Circuit Context
25+
## Circuit context
2626

2727
Arithmetic circuits are mostly used as standard models for studying the complexity of computations.
2828

@@ -48,7 +48,7 @@ CIRCOM is a Domain-Specific Language (DSL) used to define Arithmetic circuits, a
4848

4949
![CIRCOM Overall Context](../../img/zkEVM/02circom-overall-context.png)
5050

51-
### CIRCOM As A DSL
51+
### CIRCOM as a DSL
5252

5353
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**.
5454

@@ -62,7 +62,7 @@ In this regard, CIRCOM users can use templates to create their own custom circui
6262

6363
However, CIRCOM users can also use templates from [CIRCOMLIB](https://github.com/iden3/circomlib), which is a publicly available library that contains hundreds of circuits such as; comparators, hash functions, digital signatures, binary and decimal converters.
6464

65-
### Circuit Compiler
65+
### Circuit compiler
6666

6767
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.
6868

@@ -87,7 +87,7 @@ $$
8787
\texttt{a} \times \texttt{b} \texttt{ - c = 0}
8888
$$
8989

90-
### The `pragma` Instruction
90+
### The `pragma` instruction
9191

9292
The `pragma` instruction specifies the version of the CIRCOM compiler being used. It is meant to ensure compatibility between the circuit and the compiler version. If the two are incompatible, the compiler throws a warning.
9393

@@ -97,7 +97,7 @@ pragma circom 2.0.0;
9797

9898
As a precautionary measure, all files with the `.circom` extension should start with a `pragma` instruction. In the absence of this instruction, it is assumed that the code is compatible with the latest compiler version.
9999

100-
### Declaration Of Signals
100+
### Declaration of signals
101101

102102
In the Multiplier example, there are two input signals $\texttt{a}$ and $\texttt{b}$, and an output signal $\texttt{c}$.
103103

@@ -111,7 +111,7 @@ signal input b;
111111
signal output c;
112112
```
113113

114-
### The <== Operator
114+
### The <== operator
115115

116116
The functionality of this operator is twofold;
117117

@@ -122,7 +122,7 @@ The functionality of this operator is twofold;
122122
c <== a * b;
123123
```
124124

125-
### Creation Of Templates
125+
### Creation of templates
126126

127127
One of the main peculiarities of CIRCOM is the allowance to define parameterizable small circuits called **templates**.
128128

@@ -145,7 +145,7 @@ template Multiplier () {
145145
}
146146
```
147147

148-
### Instantiation Of Templates
148+
### Instantiation of templates
149149

150150
Although the above code succeeds in creating the `Multiplier template`, the template is yet to be instantiated.
151151

@@ -163,7 +163,7 @@ Declaration of components is the means by which CIRCOM enables programmers to wo
163163

164164
Small circuits can be defined which can be combined to create larger circuits by the complexity of the computations needed to be carried out.
165165

166-
### Compiling a Circuit
166+
### Compiling a circuit
167167

168168
As previously mentioned, the use of the operator "<==" in the `Multiplier template` has dual functionality:
169169

@@ -193,7 +193,7 @@ Whichever program is used, needs as input, a file containing a set of valid inpu
193193

194194
Recall that **a valid set of circuit input, intermediate and output values is called the witness**.
195195

196-
### Private And Public Signals
196+
### Private and public signals
197197

198198
Depending on the `template` being used, some signals are `private` while others are `public`.
199199

@@ -205,7 +205,7 @@ component main {public [a]} = Multiplier();
205205

206206
According to the above line, the input signal $\texttt{a}$ is `public`, while $\texttt{b}$ is `private` by default.
207207

208-
### Main Component
208+
### Main component
209209

210210
The CIRCOM compiler needs a specific component as an entry point. And this initial component is called `main`.
211211

@@ -229,7 +229,7 @@ However, the `main` component has a special attribute to set a list of global in
229229

230230
The rule of thumb is: **Any other input signal not included in this list `{public [s1,..,sn]}`, is considered private**.
231231

232-
### Concluding CIRCOM's Features
232+
### Concluding CIRCOM's features
233233

234234
There are many more features that distinguish CIRCOM from other known ZK tools. The rest of these features delineated in the original [CIRCOM paper](https://www.techrxiv.org/articles/preprint/CIRCOM_A_Robust_and_Scalable_Language_for_Building_Complex_Zero-Knowledge_Circuits/19374986/1).
235235

0 commit comments

Comments
 (0)