Skip to content

Commit d286a8f

Browse files
authored
Merge pull request #213 from semaphore-protocol/dev
Semaphore v3 Former-commit-id: 39a40f5
2 parents f1aced7 + 729ba41 commit d286a8f

File tree

117 files changed

+20586
-5146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+20586
-5146
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
DEFAULT_NETWORK=hardhat
22
TREE_DEPTH=20
3+
ALL_SNARK_ARTIFACTS=true
34
REPORT_GAS=false
45
BACKEND_PRIVATE_KEY=
56
INFURA_API_KEY=

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ coverage
99
coverage.json
1010

1111
# hardhat
12+
artifacts
1213
cache
14+
typechain-types
1315

1416
# types
1517
types
@@ -30,3 +32,6 @@ docs
3032
npm-debug.log*
3133
yarn-debug.log*
3234
yarn-error.log*
35+
36+
# packages
37+
cli-template-*

.github/workflows/production.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- main
77

8+
env:
9+
TREE_DEPTH: 20
10+
ALL_SNARK_ARTIFACTS: false
11+
812
jobs:
913
style:
1014
runs-on: ubuntu-latest

.github/workflows/pull-requests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: pull-requests
33
on:
44
pull_request:
55

6+
env:
7+
TREE_DEPTH: 20
8+
ALL_SNARK_ARTIFACTS: false
9+
610
jobs:
711
style:
812
runs-on: ubuntu-latest

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ docs/*
7070
# Hardhat
7171
artifacts
7272
cache
73+
typechain-types
74+
packages/contracts/deployed-contracts/undefined.json
75+
packages/contracts/deployed-contracts/hardhat.json
76+
packages/contracts/deployed-contracts/localhost.json
7377

7478
# Stores VSCode versions used for testing VSCode extensions
7579
.vscode-test

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ coverage
99
coverage.json
1010

1111
# hardhat
12+
artifacts
1213
cache
14+
typechain-types
15+
packages/contracts/deployed-contracts/undefined.json
16+
packages/contracts/deployed-contracts/hardhat.json
17+
packages/contracts/deployed-contracts/localhost.json
1318

1419
# types
1520
types

README.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<img alt="Github license" src="https://img.shields.io/github/license/semaphore-protocol/semaphore.svg?style=flat-square">
1818
</a>
1919
<a href="https://github.com/semaphore-protocol/semaphore/actions?query=workflow%3Aproduction">
20-
<img alt="GitHub Workflow test" src="https://img.shields.io/github/workflow/status/semaphore-protocol/semaphore/production?label=test&style=flat-square&logo=github">
20+
<img alt="GitHub Workflow test" src="https://img.shields.io/github/actions/workflow/status/semaphore-protocol/semaphore/production.yml?branch=main&label=test&style=flat-square&logo=github">
2121
</a>
2222
<a href="https://coveralls.io/github/semaphore-protocol/semaphore">
2323
<img alt="Coveralls" src="https://img.shields.io/coveralls/github/semaphore-protocol/semaphore?style=flat-square&logo=coveralls">
@@ -61,9 +61,7 @@
6161
| Semaphore is a protocol, designed to be a simple and generic privacy layer for Ethereum DApps. Using zero knowledge, Ethereum users can prove their membership of a group and send signals such as votes or endorsements without revealing their original identity. |
6262
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
6363

64-
The core of the Semaphore protocol is in the [circuit logic](/packages/circuits/scheme.png). However Semaphore also provides [Solidity contracts](/packages/contracts) (NPM: `@semaphore-protocol/contracts`) and JavaScript libraries to make the steps for offchain proof creation and onchain verification easier. To learn more about Semaphore visit [semaphore.appliedzkp.org](https://semaphore.appliedzkp.org).
65-
66-
You can find Semaphore V1 on [`version/1.0.0`](https://github.com/semaphore-protocol/semaphore/tree/version/1.0.0).
64+
The core of the Semaphore protocol is in the [circuit logic](/packages/circuits/scheme.png). However Semaphore also provides [Solidity contracts](/packages/contracts) and JavaScript libraries to make the steps for offchain proof creation and onchain verification easier. To learn more about Semaphore visit [semaphore.appliedzkp.org](https://semaphore.appliedzkp.org).
6765

6866
---
6967

@@ -200,6 +198,25 @@ You can find Semaphore V1 on [`version/1.0.0`](https://github.com/semaphore-prot
200198
</a>
201199
</td>
202200
</tr>
201+
<tr>
202+
<td>
203+
<a href="/packages/cli">
204+
@semaphore-protocol/cli
205+
</a>
206+
</td>
207+
<td>
208+
<!-- NPM version -->
209+
<a href="https://npmjs.org/package/@semaphore-protocol/cli">
210+
<img src="https://img.shields.io/npm/v/@semaphore-protocol/cli.svg?style=flat-square" alt="NPM version" />
211+
</a>
212+
</td>
213+
<td>
214+
<!-- Downloads -->
215+
<a href="https://npmjs.org/package/@semaphore-protocol/cli">
216+
<img src="https://img.shields.io/npm/dm/@semaphore-protocol/cli.svg?style=flat-square" alt="Downloads" />
217+
</a>
218+
</td>
219+
</tr>
203220
<tbody>
204221

205222
</table>

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"scripts": {
1010
"build:libraries": "yarn workspaces foreach run build",
1111
"compile:contracts": "yarn workspace contracts compile",
12-
"download:snark-artifacts": "ts-node scripts/download-snark-artifacts.ts",
12+
"download:snark-artifacts": "rimraf snark-artifacts && ts-node scripts/download-snark-artifacts.ts",
1313
"test": "yarn test:libraries && yarn test:contracts",
1414
"test:libraries": "jest --coverage",
1515
"test:contracts": "yarn workspace contracts test:coverage",
@@ -53,7 +53,6 @@
5353
"@typescript-eslint/eslint-plugin": "^5.9.1",
5454
"@typescript-eslint/parser": "^5.9.1",
5555
"babel-jest": "^27.4.6",
56-
"circomlibjs": "^0.0.8",
5756
"commitizen": "^4.2.4",
5857
"cz-conventional-changelog": "^3.3.0",
5958
"dotenv": "^16.0.2",
@@ -71,7 +70,7 @@
7170
"rollup": "^2.64.0",
7271
"ts-node": "^10.4.0",
7372
"tslib": "^2.3.1",
74-
"typescript": "^4.5.4"
73+
"typescript": "^4.7.0"
7574
},
7675
"config": {
7776
"commitizen": {

packages/circuits/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<p align="center">
2+
<h1 align="center">
3+
Semaphore circuits
4+
</h1>
5+
<p align="center">Semaphore circuits to create and verify zero-knowledge proofs.</p>
6+
</p>
7+
8+
<p align="center">
9+
<a href="https://github.com/semaphore-protocol">
10+
<img src="https://img.shields.io/badge/project-Semaphore-blue.svg?style=flat-square">
11+
</a>
12+
<a href="https://github.com/semaphore-protocol/semaphore/blob/main/LICENSE">
13+
<img alt="Github license" src="https://img.shields.io/github/license/semaphore-protocol/semaphore.svg?style=flat-square">
14+
</a>
15+
</p>
16+
17+
<div align="center">
18+
<h4>
19+
<a href="https://github.com/semaphore-protocol/semaphore/blob/main/CONTRIBUTING.md">
20+
👥 Contributing
21+
</a>
22+
<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
23+
<a href="https://github.com/semaphore-protocol/semaphore/blob/main/CODE_OF_CONDUCT.md">
24+
🤝 Code of conduct
25+
</a>
26+
<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
27+
<a href="https://github.com/semaphore-protocol/semaphore/contribute">
28+
🔎 Issues
29+
</a>
30+
<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
31+
<a href="https://discord.gg/6mSdGHnstH">
32+
🗣️ Chat &amp; Support
33+
</a>
34+
</h4>
35+
</div>
36+
37+
To learn more about circuits visit [semaphore.appliedzkp.org](https://semaphore.appliedzkp.org/docs/technical-reference/circuits).

packages/circuits/semaphore.circom

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ template CalculateNullifierHash() {
4343
out <== poseidon.out;
4444
}
4545

46-
// nLevels must be < 32.
46+
// The current Semaphore smart contracts require nLevels <= 32 and nLevels >= 16.
4747
template Semaphore(nLevels) {
4848
signal input identityNullifier;
4949
signal input identityTrapdoor;

0 commit comments

Comments
 (0)