Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Generate plugins #410

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/tutorial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ jobs:
- name: 25. Verify the proof
run: snarkjs groth16 verify verification_key.json public.json proof.json
- name: 26. Turn the verifier into a smart contract
run: snarkjs zkey export solidityverifier circuit_final.zkey verifier.sol
run: snarkjs zkey export verifier circuit_final.zkey verifier.sol
- name: 27. Simulate a verification call
run: snarkjs zkey export soliditycalldata public.json proof.json
run: snarkjs zkey export calldata public.json proof.json
- name: 28. Plonk setup
run: snarkjs plonk setup circuit.r1cs pot14_final.ptau circuit_final.zkey
- name: 29. Export the verification key
Expand All @@ -117,9 +117,9 @@ jobs:
- name: 31. Verify the PLONK proof
run: snarkjs plonk verify verification_key.json public.json proof.json
- name: 32. Turn the PLONK verifier into a smart contract
run: snarkjs zkey export solidityverifier circuit_final.zkey verifier.sol
run: snarkjs zkey export verifier circuit_final.zkey verifier.sol
- name: 33. Simulate a PLONK verification call
run: snarkjs zkey export soliditycalldata public.json proof.json
run: snarkjs zkey export calldata public.json proof.json
- name: 34. Fflonk setup
run: snarkjs fflonk setup circuit.r1cs pot14_final.ptau circuit_final.zkey
- name: 35. Export the verification key
Expand All @@ -129,9 +129,9 @@ jobs:
- name: 37. Verify the FFLONK proof
run: snarkjs fflonk verify verification_key.json public.json proof.json
- name: 38. Turn the FFLONK verifier into a smart contract
run: snarkjs zkey export solidityverifier circuit_final.zkey verifier.sol
run: snarkjs zkey export verifier circuit_final.zkey verifier.sol
- name: 39. Simulate a FFLONK verification call
run: snarkjs zkey export soliditycalldata public.json proof.json
run: snarkjs zkey export calldata public.json proof.json



Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,17 +488,17 @@ If all is well, you should see that `OK` has been outputted to your console. Thi

### 25. Turn the verifier into a smart contract
```sh
snarkjs zkey export solidityverifier circuit_final.zkey verifier.sol
snarkjs zkey export verifier circuit_final.zkey verifier.sol
```

Finally, we export the verifier as a Solidity smart-contract so that we can publish it on-chain -- using [remix](https://remix.ethereum.org/) for example. For the details on how to do this, refer to section 4 of [this tutorial](https://blog.iden3.io/first-zk-proof.html).

### 26. Simulate a verification call
```sh
snarkjs zkey export soliditycalldata public.json proof.json
snarkjs zkey export calldata public.json proof.json
```

We use `soliditycalldata` to simulate a verification call, and cut and paste the result directly in the verifyProof field in the deployed smart contract in the remix environment.
We use `calldata` to simulate a verification call, and cut and paste the result directly in the verifyProof field in the deployed smart contract in the remix environment.

And voila! That's all there is to it :)

Expand Down
Loading
Loading