Skip to content

Commit

Permalink
simplyfing the getting started tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
jlmunoz77 committed Oct 11, 2021
1 parent 07708b1 commit 8451253
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions mkdocs/docs/getting-started/proving-circuits.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Proving circuits
## Next steps

After compiling the circuit and running the witness calculator with
an appropriate input we have a file with extension .wtns that
Expand All @@ -24,7 +23,7 @@ snarkjs print -r multiplier2.r1cs -s multiplier2.sym
```
-->

First, we start a new powers of tau ceremony:
First, we start a new "powers of tau" ceremony:

```text
snarkjs powersoftau new bn128 12 pot12_0000.ptau -v
Expand All @@ -42,15 +41,14 @@ We can verify the protocol so far:
```text
snarkjs powersoftau verify pot12_0001.ptau
```
-->
Finally, we apply a random beacon:
```text
snarkjs powersoftau beacon pot12_0001.ptau pot12_beacon.ptau 0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f 10 -n="Final Beacon"
```
-->```

Now, we have the contributions to the powers of tau in the file *pot12_beacon.ptau* and
Now, we have the contributions to the powers of tau in the file *pot12_0001.ptau* and
we can proceed with the Phase 2.

## Trusted setup: Phase 2 <a id="my-first-trusted-setup"></a>
Expand All @@ -59,7 +57,7 @@ The **phase 2** is **circuit-specific**.
Execute the following command to start the generation of this phase:

```text
snarkjs powersoftau prepare phase2 pot12_beacon.ptau pot12_final.ptau -v
snarkjs powersoftau prepare phase2 pot12_0001.ptau pot12_final.ptau -v
```
<!--
We can verify the final ptau file:
Expand All @@ -82,15 +80,14 @@ snarkjs zkey contribute multiplier2_0000.zkey multiplier2_0001.zkey --name="1st
<!--
Verify the latest zkey
snarkjs zkey verify $1.r1cs pot12_final.ptau $1_0001.zkey
-->
Apply a random beacon:
```text
snarkjs zkey beacon multiplier2_0001.zkey multiplier2_final.zkey 0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f 10 -n="Final Beacon phase2"
```
<!--
Verify the final zkey
snarkjs zkey verify $1.r1cs pot12_final.ptau $1_final.zkey
Expand Down Expand Up @@ -119,7 +116,7 @@ If everything checks out, you should see the following at the top of the output:

Export the verification key:
```text
snarkjs zkey export verificationkey multiplier2_final.zkey verification_key.json
snarkjs zkey export verificationkey multiplier2_0001.zkey verification_key.json
```

### Generating a Groph16 ZKP <a id="my-first-zero-knowledge-proof"></a>
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/docs/getting-started/writing-compiling-circuits.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ With these options we generate three types of files:
* `--r1cs`: it generates the file `multiplier2.r1cs` that contains the [R1CS constraint system](/getting-started/background#rank-1-constraint-system) of the circuit in binary format.
* `--wasm`: it generates the directory `multiplier2_js` that contains the `Wasm` code (multiplier2.wasm) and other files needed to generate the [witness](/getting-started/background#witness).
* `--sym` : it generates the file `multiplier2.sym` , a symbols file required for debugging or for printing the constraint system in an annotated mode.
* `--c` : it generates the directory `multiplier2_cpp` that contains several files \(multiplier2.cpp, multiplier2.dat, and other common files for every compiled program like main.cpp, MakeFile, etc\) needed to compile the C code to generate the witness.
* `--c` : it generates the directory `multiplier2_cpp` that contains several files (multiplier2.cpp, multiplier2.dat, and other common files for every compiled program like main.cpp, MakeFile, etc) needed to compile the C code to generate the witness.

We can use the option -o to specify the directory where these files are created.

Expand Down

0 comments on commit 8451253

Please sign in to comment.