-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4301 from ethereum/zkp_readme
Zkp update readme
- Loading branch information
Showing
10 changed files
with
115 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
libs/remix-ws-templates/src/templates/hashchecker/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
## CIRCOM ZKP Hash Checker WORKSPACE | ||
|
||
Welcome to the Remix Circom ZKP Hash Checker Workspace. | ||
|
||
The workspace comprises two main directories: | ||
|
||
### circuits: Contains sample Hash Checker contracts. These can be compiled to generate a witness using 'Circom ZKP Compiler' plugin. | ||
|
||
### scripts: Provides a sample script designed for a trusted setup using snarkjs. This script also aids in generating Solidity code, which is essential for on-chain deployment. | ||
|
||
### first steps: | ||
|
||
#### 1) compile the hash checker circuit using the remix circom compiler. This will generate artifacts. | ||
|
||
#### 2) execute the file `run_setup.ts`: | ||
|
||
This step generate a verification key that can be used for generating proof, it will also generate a Solidity contract for on-chain verification. | ||
|
||
Note that this section should only be used for development purposes as this way of running the setup is heavily centralized (although some pieces of this script can be used to achieve that). | ||
|
||
This generates a verification key (`./zk/build/verification_key.json`) and artifacts from the setup (`./zk/build/zk_setup.txt`). | ||
|
||
#### 3) execute the file `run_verification.ts`: | ||
|
||
This script: | ||
|
||
- generate a witness and a proof of execution. The input parameters of `snarkjs.wtns.calculate` are: | ||
|
||
- 4 values, that should remain private. We want to verify that we know a hash that satisfy these 4 values. | ||
- a hash, this is a public signal. | ||
|
||
The witness will be generated only if the provided hash is the poseidon hash of these 4 values. | ||
|
||
- verify that the proof is valid `(snarkjs.groth16.verify)` |
10 changes: 0 additions & 10 deletions
10
libs/remix-ws-templates/src/templates/hashchecker/README.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,38 @@ | ||
<h1 align=center>Rate-Limiting Nullifier circuits in Circom</h1> | ||
<p align="center"> | ||
<img src="https://github.com/Rate-Limiting-Nullifier/rln-circuits-v2/workflows/Test/badge.svg" width="110"> | ||
</p> | ||
|
||
<div align="center"> | ||
|
||
## What's RLN? | ||
|
||
*The project was audited by Veridise, yAcademy fellows and internally.* | ||
Welcome to the Remix Circom ZKP RLN Workspace. | ||
|
||
</div> | ||
RLN is a zero-knowledge gadget that enables spam prevention in anonymous environments. | ||
To learn more on RLN and how it works - check out [documentation](https://rate-limiting-nullifier.github.io/rln-docs/). | ||
|
||
___ | ||
The workspace comprises two main directories: | ||
|
||
## What's RLN? | ||
### circuits: Contains sample semaphore contracts. These can be compiled to generate a witness using 'Circom ZKP Compiler' plugin. | ||
|
||
RLN is a zero-knowledge gadget that enables spam | ||
prevention in anonymous environments. | ||
### scripts: Provides a sample script designed for a trusted setup using snarkjs. This script also aids in generating Solidity code, which is essential for on-chain deployment. | ||
|
||
The core parts of RLN are: | ||
* zk-circuits in Circom (this repo); | ||
* [registry smart-contract](https://github.com/Rate-Limiting-Nullifier/rln-contract); | ||
* set of libraries to build app with RLN ([rlnjs](https://github.com/Rate-Limiting-Nullifier/rlnjs), [zerokit](https://github.com/vacp2p/zerokit)). | ||
### first steps: | ||
|
||
--- | ||
#### 1) compile the semaphore circuit using the remix circom compiler. This will generate artifacts. | ||
|
||
To learn more on RLN and how it works - check out [documentation](https://rate-limiting-nullifier.github.io/rln-docs/). | ||
#### 2) execute the file `run_setup.ts`: | ||
|
||
This step generate a verification key that can be used for generating proof, it will also generate a Solidity contract for on-chain verification. | ||
|
||
Note that this section should only be used for development purposes as this way of running the setup is heavily centralized (although some pieces of this script can be used to achieve that). | ||
|
||
This generates a verification key (`./zk/build/verification_key.json`) and artifacts from the setup (`./zk/build/zk_setup.txt`). | ||
|
||
#### 3) execute the file `run_verification.ts`: | ||
|
||
This script: | ||
|
||
- create a list of identity commitments and add it to a `IncrementalMerkleTree`. The tree is used to generate a merkle proof that a specified identity is actually in the tree (see`tree.createProof(0)`). | ||
|
||
- generate a witness and a proof of execution with `messageId`equal to 0. | ||
|
||
- generate a witness and a proof of execution with `messageId`equal to 0. | ||
|
||
- generating 2 proofs (two different messages) with the same `messageId` reveal the two points of the polynomial necessary to deduct the `identitySecret` (using `shamirRecovery`). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
## CIRCOM ZKP SEMAPHORE WORKSPACE | ||
|
||
Welcome to the Remix Circom ZKP Semaphore Workspace. | ||
|
||
The workspace comprises two main directories: | ||
|
||
### circuits: Contains sample semaphore contracts. These can be compiled to generate a witness using 'Circom ZKP Compiler' plugin. | ||
|
||
### scripts: Provides a sample script designed for a trusted setup using snarkjs. This script also aids in generating Solidity code, which is essential for on-chain deployment. | ||
|
||
### first steps: | ||
|
||
#### 1) compile the semaphore circuit using the remix circom compiler. This will generate artifacts. | ||
|
||
#### 2) execute the file `run_setup.ts`: | ||
This step generate a verification key that can be used for generating proof, it will also generate a Solidity contract for on-chain verification. | ||
Note that this section should only be used for development purposes as this way of running the setup is heavily centralized (although some pieces of this script can be used to achieve that). | ||
This generates a verification key (`./zk/build/verification_key.json`) and artifacts from the setup (`./zk/build/zk_setup.txt`). | ||
|
||
#### 3) execute the file `run_verification.ts`: | ||
This script: | ||
- create a list of identity commitments and add it to a `IncrementalMerkleTree`. The tree is used to generate a merkle proof that a specified identity is actually in the tree (see`tree.createProof(0)`). | ||
- generate a witness and a proof of execution. | ||
- verify that the proof is valid `(snarkjs.groth16.verify)` | ||
- ultimately verify that the hash generated by the circom compiler is the same as the root hash for the Tree. `(proof1.root.toString() === publicSignals[0]`). This assert that the identity provided to the circuit is actually part of that semaphore group. |
10 changes: 0 additions & 10 deletions
10
libs/remix-ws-templates/src/templates/semaphore/README.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters