Compare commits

...

613 Commits

Author SHA1 Message Date
cedoor
9858ba6a30 chore: v4.0.0-beta
Former-commit-id: a11e6e43be32e6ad431a6f573e7bab354c802bde
2024-02-28 19:40:41 +00:00
Cedoor
89fd8a7681 Merge pull request #672 from semaphore-protocol/docs/fix-broken-links
Fix broken links on V2 documentation

Former-commit-id: 17fe1f78fa
2024-02-28 19:37:40 +00:00
Cedoor
6e2cd546f5 Merge pull request #671 from semaphore-protocol/ci/docs
Build libraries before generating docs

Former-commit-id: 2d81f205a8
2024-02-28 19:36:24 +00:00
cedoor
09655719d5 docs(docs): fix broken links
Former-commit-id: 88c34622d0
2024-02-28 19:35:18 +00:00
Cedoor
fab5c3d6f4 Merge pull request #659 from semaphore-protocol/chore/v4-website
Update Semaphore code and links in the website

Former-commit-id: 8602771aa2
2024-02-28 19:26:30 +00:00
cedoor
dd57c27b63 ci: build libraries before generating docs
Former-commit-id: e8b58e03a5
2024-02-28 19:20:00 +00:00
Cedoor
a4fba4ed85 Merge pull request #480 from semaphore-protocol/feat/semaphore-v4
Semaphore V4

Former-commit-id: 0d8c322dff
2024-02-28 19:07:48 +00:00
Cedoor
fa772876ed Merge pull request #668 from semaphore-protocol/chore/new-openzeppelin-version
New OpenZeppelin version

Former-commit-id: e0bda47229
2024-02-28 19:04:49 +00:00
Vivian Plasencia
c6f6b69cbb docs(contracts): remove code comment
Former-commit-id: 4905b81205
2024-02-28 19:58:21 +01:00
cedoor
da7accec9c chore(contracts): update openzeppelin dev dependency version
re #662


Former-commit-id: 05684921e8
2024-02-28 18:54:39 +00:00
Cedoor
fdfabbb3f2 Merge pull request #666 from semaphore-protocol/docs/fix-typedoc-links
Correct TypeDoc links

Former-commit-id: 7691d3724e
2024-02-28 18:51:47 +00:00
Cedoor
146bdacb2b Merge pull request #665 from semaphore-protocol/docs/group
More documentation on group lib code

Former-commit-id: 1a85ed1897
2024-02-28 18:50:58 +00:00
Cedoor
b038f925e5 Merge pull request #669 from semaphore-protocol/docs/contracts
Add code comments to contracts

Former-commit-id: fe1cb7e46a
2024-02-28 18:41:47 +00:00
Vivian Plasencia
b07aee03d4 fix(contracts): remove comment line that was causing an error when compiling contracts
Former-commit-id: 49cd4534b1
2024-02-28 19:30:34 +01:00
Vivian Plasencia
9cbb5a1c18 docs(contracts): update code comments
Former-commit-id: b0dd7e0d67
2024-02-28 19:25:57 +01:00
Vivian Plasencia
e028644973 style(contracts): style code with prettier
Former-commit-id: 3db7dc41f8
2024-02-28 19:18:00 +01:00
Vivian Plasencia
6703ff08c2 docs(contracts): add code comments to contracts
Former-commit-id: ecd046ce7f
2024-02-28 19:17:12 +01:00
Cedoor
7119ee4904 Merge pull request #667 from semaphore-protocol/chore/yarn-v4
Upgrade Yarn to v4

Former-commit-id: 524e3461fc
2024-02-28 16:22:32 +00:00
cedoor
4fabf7ce9c chore: upgrade yarn to v4
re #662


Former-commit-id: 74806d4426
2024-02-28 16:04:50 +00:00
cedoor
e2e4ee5254 style(data): format code with prettier
Former-commit-id: 09aa138fee
2024-02-28 15:37:07 +00:00
cedoor
b8e22aef4e docs: fix typedoc links
Former-commit-id: 794a8093a9
2024-02-28 15:29:21 +00:00
cedoor
75628f3958 docs(group): add more documentation to code
The commit adds more documentation to the group package functions and updates the TypeDoc link.

re #483


Former-commit-id: cf2355ff55
2024-02-28 15:12:42 +00:00
Cedoor
24157b7586 Merge pull request #664 from semaphore-protocol/docs/proof
More documentation on proof lib code

Former-commit-id: 2c144fc9e5
2024-02-28 14:39:38 +00:00
Cedoor
d9fdc4ee12 Merge pull request #661 from semaphore-protocol/docs/circuits
More documentation on Circom code

Former-commit-id: 308ffda7d3
2024-02-28 14:35:04 +00:00
cedoor
89882f3b8b docs(circuits): minor improvements on doc comments
re #483


Former-commit-id: c3389b6b99
2024-02-28 14:34:16 +00:00
Cedoor
30234960ca Update packages/circuits/semaphore.circom
Co-authored-by: Vivian Plasencia <v.pcalana@gmail.com>
Former-commit-id: bb293165d6
2024-02-28 13:29:46 +00:00
Cedoor
275dd501eb Update packages/proof/src/generate-proof.ts
Co-authored-by: Vivian Plasencia <v.pcalana@gmail.com>
Former-commit-id: 7a61311922
2024-02-28 13:26:45 +00:00
cedoor
f36bb460af docs(identity): fix jsdoc link syntax
Former-commit-id: 2e3b78a8fb
2024-02-28 13:22:21 +00:00
Cedoor
1bfa09926b Merge pull request #663 from semaphore-protocol/docs/identity
More documentation on Identity lib code

Former-commit-id: 143c628672
2024-02-28 12:54:31 +00:00
cedoor
c88c151e8d docs(circuits): revert order of hash pre-images on comments
re #483


Former-commit-id: b5acd41543
2024-02-28 12:53:24 +00:00
cedoor
ac71302781 docs(circuits): add link to identity package
re #483


Former-commit-id: cf65ec4aeb
2024-02-28 12:51:43 +00:00
cedoor
44afe68a37 chore: update lockfile
Former-commit-id: b2f6db95df
2024-02-28 12:48:56 +00:00
cedoor
51efe510a4 docs(identity): add links to zk-kit types
re #483


Former-commit-id: 0034f5f1a8
2024-02-28 12:45:10 +00:00
cedoor
165ee6f469 docs(circuits): add more documentation to secret signal
re #483


Former-commit-id: 23476c30dd
2024-02-28 12:36:36 +00:00
cedoor
d7d31423bb chore: update lockfile
Former-commit-id: 2f95c20d72
2024-02-28 12:24:08 +00:00
cedoor
a81edc09b0 docs(identity): add more documentation to code
The commit adds more documentation to the proof package functions and updates the TypeDoc link.

re #483


Former-commit-id: f3ee07c034
2024-02-28 12:22:32 +00:00
Cedoor
c98326e078 Merge pull request #652 from semaphore-protocol/ref/cli-template-monorepo-ethers
Update `cli-template-monorepo-ethers`

Former-commit-id: f50e78bd65
2024-02-28 11:47:52 +00:00
cedoor
8617657bff docs(identity): add more documentation to code
The commit adds more documentation to the Identity class and update the TypeDoc link. It also
removes the class method to verify signatures as the static method can be used instead.

re #483


Former-commit-id: b4c2887cf1
2024-02-28 11:16:49 +00:00
cedoor
57f135e305 chore: add npm script to test specific libs
Former-commit-id: b914dceb86
2024-02-28 11:14:28 +00:00
Cedoor
8d4b3a6c9e Merge pull request #653 from semaphore-protocol/ref/cli-template-monorepo-subgraph
Update `cli-template-monorepo-subgraph`

Former-commit-id: 3533876a1c
2024-02-28 10:54:31 +00:00
Vivian Plasencia
7616cd64e5 Merge branch 'feat/semaphore-v4' into ref/cli-template-monorepo-subgraph
Former-commit-id: 251bccab45
2024-02-28 11:35:24 +01:00
Vivian Plasencia
dbfc34df39 Merge branch 'feat/semaphore-v4' into ref/cli-template-monorepo-ethers
Former-commit-id: f61503205a
2024-02-28 11:32:15 +01:00
Vivian Plasencia
f348495d9c refactor(cli-template-contracts-hardhat): fix semaphore version in tests
Former-commit-id: 8437547f1a
2024-02-28 11:17:05 +01:00
Vivian Plasencia
27fc8e6b75 refactor(cli-template-monorepo-subgraph): update tsconfig contracts
Former-commit-id: 129d5059fa
2024-02-28 11:10:19 +01:00
Vivian Plasencia
b59ba20463 refactor(cli-template-contracts-hardhat): update tsconfig in contracts
Former-commit-id: e02a81ea11
2024-02-28 11:08:19 +01:00
Vivian Plasencia
bbc2b15058 refactor(cli-template-monorepo-ethers): fix semaphore version in tests
Former-commit-id: b3f20b6b7f
2024-02-28 11:01:21 +01:00
Vivian Plasencia
d45fd99cf2 refactor(cli-template-monorepo-subgraph): fix semaphore version
Former-commit-id: 446139215d
2024-02-28 10:59:50 +01:00
Vivian Plasencia
cf5937998f refactor(cli-template-monorepo-ethers): fix semaphore dependencies
Former-commit-id: 6640210700
2024-02-28 10:56:33 +01:00
Cedoor
e848bb6136 Merge pull request #651 from semaphore-protocol/ref/cli-template-contracts-hardhat
Update `cli-template-contracts-hardhat`

Former-commit-id: 0eb16c2aca
2024-02-28 09:47:24 +00:00
Vivian Plasencia
9282405a0b refactor(cli-template-contracts-hardhat): update tsconfig file
Former-commit-id: 5d47e99b73
2024-02-28 10:44:52 +01:00
Vivian Plasencia
067ddfd1be refactor: update yarn lock file
Former-commit-id: a8ffd7674b
2024-02-28 09:05:14 +01:00
Vivian Plasencia
444b4fa791 Merge branch 'ref/cli-template-contracts-hardhat' of https://github.com/semaphore-protocol/semaphore into ref/cli-template-contracts-hardhat
Former-commit-id: 76c80bef7d
2024-02-28 09:04:02 +01:00
vplasencia
a9b535f96e refactor(cli-template-contracts-hardhat): update configs
Former-commit-id: 46c2e52f22
2024-02-28 08:59:23 +01:00
vplasencia
f1a5262e34 style(cli-template-contracts-hardhat): add spaces to the end of files
Former-commit-id: 9b982f787f
2024-02-28 08:59:23 +01:00
vplasencia
1e6473bfc9 refactor(cli-template-contracts-hardhat): update cli contracts hardhat template
Former-commit-id: f6f8c9bc6e
2024-02-28 08:58:28 +01:00
vplasencia
4c9bf61170 refactor(cli-templates-monorepo-subgraph): update gitignore files
Former-commit-id: 29b2d762fc
2024-02-28 08:41:24 +01:00
vplasencia
245ede6a89 refactor(cli-template-monorepo-ethers): update gitignore files
Former-commit-id: f2653c9dbd
2024-02-28 08:38:48 +01:00
vplasencia
6315011a8e refactor(cli-template-monorepo-ethers): update eslintignore
Former-commit-id: d55f37f132
2024-02-27 23:27:19 +01:00
vplasencia
4ca4172a1f refactor(cli-template-monorepo-subgraph): update variable name
Former-commit-id: 8527317331
2024-02-27 23:23:06 +01:00
vplasencia
3a70a732c4 refactor(cli-template-monorepo-subgraph): remove unused env example file
Former-commit-id: 0bd8cf8e97
2024-02-27 23:20:12 +01:00
vplasencia
7a5afad2a5 refactor(cli-template-monorepo-subgraph): update configs
Former-commit-id: 4307411436
2024-02-27 23:16:33 +01:00
vplasencia
58affaadea refactor(cli-templates-monorepo-ethers): update configs
Former-commit-id: 70e465c7fe
2024-02-27 23:01:34 +01:00
vplasencia
64c5a35570 refactor(cli-template-contracts-hardhat): update configs
Former-commit-id: fe43cb4cd1
2024-02-27 22:20:26 +01:00
cedoor
491d949c52 docs(circuits): add documentation to circuits
This commit add more documentation to the Semaphore circuits, with the aim of providing an overview
of the code used and to refer to other resources for futher information.

re #483


Former-commit-id: de12d471c0
2024-02-27 20:01:54 +00:00
Cedoor
9af6153026 Merge pull request #655 from semaphore-protocol/docs/v4-beta
New V4-beta documentation

Former-commit-id: 90163748cf
2024-02-27 16:14:01 +00:00
Cedoor
0581607649 Merge pull request #660 from zkfriendly/feat/semaphore-v4
Adds `getGroupMembers` & `getGroupValidatedProofs` functions to `SemaphoreSubgraph`

Former-commit-id: 5aae5659f1
2024-02-27 16:13:03 +00:00
zkFriendly
1922f64f7c refactor(data): remove unnecessary ?? []
Former-commit-id: d84c9ceca6
2024-02-27 17:01:45 +01:00
cedoor
a00ea5434c chore(website): update identity description
re #658


Former-commit-id: f7d0bcf39e
2024-02-26 22:41:11 +00:00
Cedoor
6e66085293 Update apps/website/src/app/learn/page.tsx
Co-authored-by: Vivian Plasencia <v.pcalana@gmail.com>
Former-commit-id: 95a7a84f74
2024-02-26 22:26:43 +00:00
Cedoor
85fd006209 Update apps/website/src/app/learn/page.tsx
Co-authored-by: Vivian Plasencia <v.pcalana@gmail.com>
Former-commit-id: 861a64368e
2024-02-26 22:26:27 +00:00
zkFriendly
8f3d2e5455 feat(data): add getGroupValidatedProofs to SemaphoreSubgraph
Former-commit-id: 9f6c62f620
2024-02-26 17:40:29 +01:00
zkFriendly
5d4c592c3b feat(data): add getGroupMembers to SemaphoreSubgraph
Former-commit-id: 8f73965b95
2024-02-26 17:32:00 +01:00
cedoor
f2be01ecdd chore(website): update semaphore code and links
re #658


Former-commit-id: 2466e9b5c0
2024-02-26 12:29:34 +00:00
Cedoor
a0f6e0db13 Merge pull request #657 from semaphore-protocol/ref/pack-unpack-proof
Integrate `packGroth16Proof` and `unpackGroth16Proof` into Semaphore v4

Former-commit-id: 7af787a7de
2024-02-26 11:52:30 +00:00
vplasencia
95aad1a154 refactor(proof): integrate pack unpack groth16 proof
Former-commit-id: d28448624a
2024-02-26 12:38:01 +01:00
Cedoor
ff47c8ba0b Merge pull request #650 from semaphore-protocol/ref/cli
Update CLI code and dependencies

Former-commit-id: a2f3a6bbfe
2024-02-26 10:51:33 +00:00
cedoor
5390830e41 docs(docs): update boilerplate links
Former-commit-id: 38f4b91192
2024-02-26 10:30:21 +00:00
cedoor
f4bfe0ca2f chore(docs): set V4-beta as default version
Former-commit-id: b6d68817c2
2024-02-26 10:25:22 +00:00
cedoor
3c38e393f6 docs(docs): update V4-beta docs links
Former-commit-id: 324219f72e
2024-02-26 10:24:48 +00:00
cedoor
ba6df1d6fd docs(docs): update V3 github links
Former-commit-id: 79248dd06c
2024-02-26 10:24:24 +00:00
vplasencia
cb607be9b5 style(cli-template-monorepo-subgraph): add space to the end of files
Former-commit-id: a9994c24e3
2024-02-26 01:55:18 +01:00
vplasencia
2074dbf15f style(cli-template-monorepo-subgraph): format code with prettier
Former-commit-id: db438f947c
2024-02-26 01:49:44 +01:00
vplasencia
d4b41fcef6 refactor(cli-template-monorepo-subgraph): update the cli monorepo subgraph template
Former-commit-id: e39e57d33f
2024-02-26 01:48:37 +01:00
vplasencia
90447781b9 chore: update yarn lock file
Former-commit-id: 04fc12e10f
2024-02-26 00:49:51 +01:00
vplasencia
f292155979 style(cli-template-monorepo-ethers): add a space to the end of files
Former-commit-id: fa1ebffcb1
2024-02-26 00:44:44 +01:00
vplasencia
10f922cbf6 style(cli-template-monorepo-ethers): format code with prettier
Former-commit-id: 32acbeabb4
2024-02-26 00:35:28 +01:00
vplasencia
5450809424 refactor(cli-template-monorepo-ethers): update cli monorepo ethers template
Former-commit-id: f62b68285f
2024-02-26 00:33:52 +01:00
vplasencia
18bc5d9bb9 style(cli-template-contracts-hardhat): add spaces to the end of files
Former-commit-id: 7860fcfa50
2024-02-25 23:48:50 +01:00
vplasencia
0171f03008 refactor(cli-template-contracts-hardhat): update cli contracts hardhat template
Former-commit-id: 05c57f51b3
2024-02-25 23:36:58 +01:00
vplasencia
58cf5d117c refactor(cli): update cli code and dependencies
Former-commit-id: 19bb248857
2024-02-25 16:04:06 +01:00
cedoor
3e8e4a0b07 docs(docs): update v4 alpha docs to v4 beta
Former-commit-id: f31bfd9148
2024-02-23 13:18:10 +00:00
Cedoor
a3ac2f3382 Merge pull request #643 from semaphore-protocol/feat/utils-pkg
New `utils` package with functions two check types

Former-commit-id: 6f1b279e1e
2024-02-20 17:08:26 +00:00
cedoor
2592d477dc chore: update lockfile
Former-commit-id: 7bc25c2052
2024-02-19 16:40:27 +00:00
cedoor
f5faea9673 build(utils): set correct file extensions
Former-commit-id: 4e03ae7949
2024-02-19 16:38:48 +00:00
cedoor
778338b176 refactor(proof): add functions to check types
Former-commit-id: 3ef0553694
2024-02-19 13:13:01 +00:00
cedoor
1b9b45296c feat(utils): add functions to check bigint types
Former-commit-id: eb2fba2be0
2024-02-19 12:55:40 +00:00
cedoor
42acccce4f feat(utils): add functions to check object types
Former-commit-id: 85bed72535
2024-02-19 12:45:05 +00:00
cedoor
75530e6ee4 feat(utils): create new utils package
Former-commit-id: 785f955b2a
2024-02-19 12:38:08 +00:00
cedoor
9b4b278972 chore: remove stableVersion auto-generated field
Former-commit-id: 0dbf5f64da
2024-02-15 20:05:00 +00:00
cedoor
2679040263 chore: v4.0.0-alpha.8
Former-commit-id: 85d61e678e
2024-02-15 20:03:14 +00:00
Cedoor
f5e997d8a3 Merge pull request #636 from semaphore-protocol/refactor/download-artifacts
0-dependency script to download SNARK artifacts

Former-commit-id: a8322fd95c
2024-02-15 19:29:28 +00:00
Cedoor
3542352286 Merge pull request #634 from semaphore-protocol/refactor/conditional-exports
`ethers` conditional exports

Former-commit-id: 256d00b9e4
2024-02-15 19:11:19 +00:00
Cedoor
a1a5dd90a3 Merge pull request #630 from semaphore-protocol/fix/ethers-providers
New `ethers``s provider parameters

Former-commit-id: ad65d58ce2
2024-02-15 19:08:17 +00:00
cedoor
cb4fe9d22f chore(circuits): update imt dependency
Former-commit-id: 42fe7dc0e3
2024-02-15 16:48:31 +00:00
cedoor
f8283f1ae9 refactor(proof): create 0-dependency download script
re #635


Former-commit-id: 1dfb6d656e
2024-02-15 16:15:24 +00:00
cedoor
5a3c4f169f refactor: use ethers conditional exports
re #632


Former-commit-id: 22d391d4f1
2024-02-15 15:17:23 +00:00
cedoor
2699451caa chore(data): move test file to tests folder
Former-commit-id: 169445a63d
2024-02-15 15:14:51 +00:00
cedoor
c8d7c49beb chore(group): remove console.log
Former-commit-id: 16c8dfe1d3
2024-02-15 15:14:15 +00:00
cedoor
81603e4017 chore: upgrade jest to v29
re #633


Former-commit-id: 38a9bc1f35
2024-02-15 15:14:01 +00:00
Cedoor
4634be1ba5 Merge pull request #631 from semaphore-protocol/chore/docs-font
Set local "DM Sans" font

Former-commit-id: 2bab9acfd8
2024-02-15 10:06:15 +00:00
cedoor
3c1b83b82d style: format code with prettier
Former-commit-id: 1f5c078097
2024-02-14 18:30:28 +00:00
cedoor
6572e6c121 chore(docs): set local font
Former-commit-id: 8cc6597a06
2024-02-14 18:24:21 +00:00
cedoor
2264cd6556 fix(data): update provider parameters
Former-commit-id: ffb464ce3d
2024-02-14 17:46:09 +00:00
Cedoor
9e39cc1013 chore: update pull_request_template.md
Former-commit-id: 6103f3ced2
2024-02-13 09:11:59 +00:00
Cedoor
9a098ddca7 Merge pull request #628 from semaphore-protocol/fix/docs-font
Set right `font-family` property

Former-commit-id: 48bdbd4850
2024-02-12 20:22:58 +00:00
cedoor
a015ed9af7 chore: remove stableVersion auto-generated field
Former-commit-id: 4d1eb7d2e1
2024-02-12 17:45:18 +00:00
cedoor
05a6db4f99 chore: v4.0.0-alpha.7
Former-commit-id: d25b26bf81
2024-02-12 17:43:34 +00:00
cedoor
5df6476e4d fix(docs): set right font-family prop
Former-commit-id: 1483bef99f
2024-02-12 17:32:01 +00:00
Cedoor
6bd973fdea chore: update issue templates
Former-commit-id: f53aa88dd9
2024-02-12 16:54:13 +00:00
Cedoor
f1f353d250 Merge pull request #626 from semaphore-protocol/feat/export-group
New Group `export`/`import` methods

Former-commit-id: f44b0b1938
2024-02-12 16:09:05 +00:00
Cedoor
5c3c6555c5 Merge pull request #625 from semaphore-protocol/fix/sepolia-testnets
Update `ethers` dependency

Former-commit-id: c765f1fa70
2024-02-12 15:08:22 +00:00
cedoor
12557ac56b feat(group): add export/import methods
Former-commit-id: 1af0b407aa
2024-02-12 12:18:10 +00:00
cedoor
434149b16a fix(data): update ethers dependency
Former-commit-id: 52d92fe13c
2024-02-12 10:48:19 +00:00
Cedoor
9691c0a88f Update CONTRIBUTING.md
Former-commit-id: 39d59abaaa
2024-02-10 15:26:07 +00:00
cedoor
d426ff9bf2 refactor(proof): create function to convert to bigint
Former-commit-id: f63f28af81
2024-02-10 15:26:07 +00:00
cedoor
a6a16e2dd8 docs(proof): update usage sections
Former-commit-id: cb0b3a075a
2024-02-10 15:26:07 +00:00
cedoor
ec8c28a017 feat(proof): support message/scope as strings
Former-commit-id: 2df3ff3c93
2024-02-10 15:26:07 +00:00
cedoor
f65636d1d7 refactor(group): empty group root return 0
Former-commit-id: 67d9459e2f
2024-02-10 15:26:07 +00:00
cedoor
574f5a03f3 chore: remove stableVersion auto-generated field
Former-commit-id: 88e0af185c
2024-02-10 15:26:07 +00:00
cedoor
b810ee571c chore: v4.0.0-alpha.6
Former-commit-id: cba7d371a6
2024-02-10 15:26:07 +00:00
cedoor
72f672e584 fix(core): add full import path in esm modules
Former-commit-id: 1c562685c8
2024-02-10 15:26:07 +00:00
cedoor
376c718e50 chore: remove stableVersion auto-generated field
Former-commit-id: 768917746c
2024-02-10 15:26:07 +00:00
cedoor
53313199b8 chore: v4.0.0-alpha.5
Former-commit-id: 72e168e9c3
2024-02-10 15:26:07 +00:00
cedoor
a94ba7e7b5 build: fix default exports
Former-commit-id: ce801fb988
2024-02-10 15:26:07 +00:00
cedoor
2c4f32af98 style(contracts): format code with prettier
Former-commit-id: 53d062e538
2024-02-10 15:26:07 +00:00
cedoor
a96c7db540 refactor(contracts): update scripts to save deployed contract addresses
Former-commit-id: a05d73609a
2024-02-10 15:26:07 +00:00
cedoor
3a312eed5c chore: remove all fullProof occurrences
Former-commit-id: 6d4b7bbfb4
2024-02-10 15:26:07 +00:00
Cedoor
0115fd7c33 Update packages/identity/package.json
Co-authored-by: Vivian Plasencia <v.pcalana@gmail.com>
Former-commit-id: 52848e06f3
2024-02-10 15:26:07 +00:00
cedoor
18acd376e0 chore: update ts, rollup dependencies
Former-commit-id: 7804dde809
2024-02-10 15:26:07 +00:00
cedoor
9be60b133f chore(cli): use semaphore core package
Former-commit-id: 588b835eff
2024-02-10 15:26:07 +00:00
cedoor
fd5f7bf8c6 feat(core): create core package
Former-commit-id: c244402e37
2024-02-10 15:26:07 +00:00
cedoor
34498db202 chore(cli): update cli monorepo template app descriptions
Former-commit-id: 644c4e9be7
2024-02-10 15:26:07 +00:00
cedoor
1846b5f05d chore(cli): replace localhost with 127.0.0.1
Former-commit-id: 237bfc3186
2024-02-10 15:26:07 +00:00
cedoor
155604ee0b chore(cli): sync monorepo templates with boilerplate
Former-commit-id: fcfc224994
2024-02-10 15:26:07 +00:00
Cedoor
441d2b1f3b chore(circuits): update circuit scheme
Former-commit-id: 2c83ceccf8
2024-02-10 15:26:07 +00:00
Cedoor
5e19c57ade chore(circuits): update circuit scheme
Former-commit-id: 8b0a69db7f
2024-02-10 15:26:07 +00:00
Cedoor
e38a84de9e chore(circuits): add circuit scheme
Former-commit-id: 65d7514d37
2024-02-10 15:26:07 +00:00
cedoor
636b7c062b chore: remove stableVersion auto-generated field
Former-commit-id: b7cbd9bf19
2024-02-10 15:26:07 +00:00
cedoor
f820aff127 chore: v4.0.0-alpha.4
Former-commit-id: 2ba98ea78f
2024-02-10 15:26:07 +00:00
cedoor
bf3af771cc fix(data): update semaphore contract abi
Former-commit-id: af9657fad3
2024-02-10 15:26:07 +00:00
cedoor
6a87363981 chore: remove stableVersion auto-generated field
Former-commit-id: 045e0329a9
2024-02-10 15:26:07 +00:00
cedoor
f2b5c66d9a chore: v4.0.0-alpha.3
Former-commit-id: 2ba3b0378f
2024-02-10 15:26:07 +00:00
cedoor
4aea83b35f build(identity): include poseidon code in bundle
Former-commit-id: e5825f1f58
2024-02-10 15:26:07 +00:00
cedoor
d7d6e593c3 chore: remove stableVersion auto-generated field
Former-commit-id: 8185515cff
2024-02-10 15:26:07 +00:00
cedoor
6bbfc925fb chore: v4.0.0-alpha.2
Former-commit-id: 5d8b27d844
2024-02-10 15:26:07 +00:00
cedoor
e849cd5e33 docs: update shields license labels
re #466


Former-commit-id: 089bcde930
2024-02-10 15:26:07 +00:00
cedoor
3ab09e5821 build: fix bundle paths
Former-commit-id: dffd8a2fd1
2024-02-10 15:26:07 +00:00
cedoor
f09daf8f8b build(identity): config rollup to handle browser bundle
re #481


Former-commit-id: 12cc55c7d6
2024-02-10 15:26:07 +00:00
cedoor
4c9f03f2ea feat(contracts): add function to get group admin
re #574


Former-commit-id: 2cc9b868ee
2024-02-10 15:26:07 +00:00
cedoor
61f84b606f fix(cli): add check for groups with 1 member
Former-commit-id: 0fb44214de
2024-02-10 15:26:07 +00:00
Sam Wellander
15e01818d4 chore(cli): change create command message
converts all `npm` commands to `yarn` commands

re #592


Former-commit-id: a0cce4aba7
2024-02-10 15:26:07 +00:00
cedoor
a62aa89d0a chore: remove stableVersion auto-generated field
Former-commit-id: b44caa5a38
2024-02-10 15:26:07 +00:00
cedoor
4510147627 chore: v4.0.0-alpha.1
Former-commit-id: e0e3fdf1e4
2024-02-10 15:26:07 +00:00
cedoor
fc1c170a18 refactor(proof): add merkle proof parameter
Former-commit-id: c62de79c53
2024-02-10 15:26:07 +00:00
cedoor
a59d59e40e chore(proof): replace zk-kit groth16 with snarkjs
Former-commit-id: fc06fd45ba
2024-02-10 15:26:07 +00:00
cedoor
2873208a82 refactor(proof): remove folder creation before downloading artifacts
re #582


Former-commit-id: aa954ec40b
2024-02-10 15:26:07 +00:00
cedoor
3cf6787bb9 chore(contracts): create script to add mock data on testnets
Former-commit-id: 3b17acccea
2024-02-10 15:26:07 +00:00
cedoor
fd95d3e0e6 style: format code with prettier
Former-commit-id: 40549c5271
2024-02-10 15:26:07 +00:00
cedoor
c6bfadbfa2 refactor: rename proof with points
Former-commit-id: 4fcfe5cac1
2024-02-10 15:26:07 +00:00
cedoor
a623a5a7b0 refactor(contracts): create SemaphoreProof struct
Former-commit-id: 111bf43066
2024-02-10 15:26:07 +00:00
cedoor
e2365668bd chore: remove stableVersion auto-generated field
Former-commit-id: da0d13b1d4
2024-02-10 15:26:07 +00:00
cedoor
bdc95a3f36 chore: remove stableVersion auto-generated field
Former-commit-id: 6537e7b954
2024-02-10 15:26:07 +00:00
cedoor
c327656552 chore: v4.0.0-alpha
Former-commit-id: c1b52ee9bc
2024-02-10 15:26:07 +00:00
cedoor
7b8b17a4a9 test(data): update ethers tests
Former-commit-id: bc6d173be9
2024-02-10 15:26:07 +00:00
cedoor
396443b711 style(cli): update cli templates' contract artifacts
Former-commit-id: 4713643fc0
2024-02-10 15:26:07 +00:00
cedoor
18ce15d07b chore(cli): update cli monorepo templates
Former-commit-id: dfe2fed235
2024-02-10 15:26:07 +00:00
cedoor
a4ee95ca81 refactor(identity): convert priv key buffer to bigint
Former-commit-id: c286153ede
2024-02-10 15:26:07 +00:00
cedoor
f3789cbccc chore(contracts): update proof pkg var names
Former-commit-id: f6d7aef5a7
2024-02-10 15:26:07 +00:00
cedoor
c52120bd3b refactor(proof): include merkle depth in the proof
Former-commit-id: 0668fd3819
2024-02-10 15:26:07 +00:00
cedoor
9b5fa8e4e6 chore(hardhat): update hardhat package dependencies
Former-commit-id: 8a6333e683
2024-02-10 15:26:07 +00:00
cedoor
64f1b580a7 chore(cli): update contracts-hardhat template
Former-commit-id: fa6de7773b
2024-02-10 15:26:07 +00:00
cedoor
3ba8cd91e8 fix: adjust cli and data packages
Former-commit-id: a1e1955847
2024-02-10 15:26:07 +00:00
cedoor
9ca04ffd50 refactor(subgraph): update merkle tree var name
Former-commit-id: 99efa63b5a
2024-02-10 15:26:07 +00:00
cedoor
67bab077a7 chore: update cli and data packages
Former-commit-id: 1ce913c4bd
2024-02-10 15:26:07 +00:00
cedoor
646d1f425d refactor(subgraph): set correct type for tree depth
Former-commit-id: c506975187
2024-02-10 15:26:07 +00:00
cedoor
83989422db revert(contracts): re-add script to verify contracts
Former-commit-id: 07ecafec1d
2024-02-10 15:26:06 +00:00
cedoor
82c97d8b15 chore(subgraph): update docker compose file
Former-commit-id: 887c51f629
2024-02-10 15:26:06 +00:00
cedoor
185e9a27a9 refactor(contracts): improve task to deploy
Former-commit-id: 3a5dc842f6
2024-02-10 15:26:06 +00:00
cedoor
781b3fff51 style(subgraph): format code with prettier
Former-commit-id: 72ab89f2ff
2024-02-10 15:26:06 +00:00
cedoor
99977eb96a chore(subgraph): update subgraph with new contract events
re #543


Former-commit-id: 50bf86d800
2024-02-10 15:26:06 +00:00
cedoor
143259ff66 style(contracts): format code with prettier
Former-commit-id: 8e3cbc1162
2024-02-10 15:26:06 +00:00
cedoor
eebb372229 chore(contracts): deploy contracts on sepolia
Former-commit-id: 79a6181933
2024-02-10 15:26:06 +00:00
cedoor
94a3983c0a perf(contracts): merge verifiers
Former-commit-id: b55b38304a
2024-02-10 15:26:06 +00:00
cedoor
c97dc39963 chore: update env file
Former-commit-id: c166f4f635
2024-02-10 15:26:06 +00:00
cedoor
1b6c140d70 chore(contracts): add open-zeppelin deployer
Former-commit-id: 6ee1686210
2024-02-10 15:26:06 +00:00
cedoor
ddf4ff6faf style: format code with prettier
Former-commit-id: c371b393fc
2024-02-10 15:26:06 +00:00
cedoor
61566e9423 test(data): temporary comment tests for sepolia testnets
Former-commit-id: 2aa3672b66
2024-02-10 15:26:06 +00:00
cedoor
6fcc95e029 chore: improve scripts to clean repo
Former-commit-id: 012650a43e
2024-02-10 15:26:06 +00:00
cedoor
2bac205863 style(subgraph): format code with prettier
Former-commit-id: ee53aaed29
2024-02-10 15:26:06 +00:00
cedoor
258edd8ba4 chore: remove goerli from supported networks
re #352


Former-commit-id: 3d6bcc2745
2024-02-10 15:26:06 +00:00
cedoor
71d7793b7e style(contracts): format code with prettier
Former-commit-id: 5a7b313bc3
2024-02-10 15:26:06 +00:00
cedoor
b131b135c7 refactor(proof): support multi tree depths (1-12)
Former-commit-id: d0843a9ee7
2024-02-10 15:26:06 +00:00
cedoor
4146d558fe chore(contracts): remove base contracts
Former-commit-id: 2f471fb06c
2024-02-10 15:26:06 +00:00
cedoor
d04b5e8b25 refactor(contracts): update tests, tasks and scripts
Former-commit-id: 540006b660
2024-02-10 15:26:06 +00:00
cedoor
2805d616a8 refactor(contracts): add 1 verifier for each tree depth
Former-commit-id: 1edda7ead5
2024-02-10 15:26:06 +00:00
cedoor
4450ec1939 refactor(circuits): rename privateKey with secret
Former-commit-id: 256dfff019
2024-02-10 15:26:06 +00:00
vplasencia
32f37cdaee docs(contracts): add code docs for the members added event
Former-commit-id: a0414962d5
2024-02-10 15:26:06 +00:00
vplasencia
c653e5e0be test(contracts): remove skip tests
Former-commit-id: a8fc33712a
2024-02-10 15:26:06 +00:00
vplasencia
45d4f340be refactor(contracts): optimize gas
Former-commit-id: 1da980e48f
2024-02-10 15:26:06 +00:00
vplasencia
0e4a60c8d2 test(contracts): update add members test
Former-commit-id: eff91efbc6
2024-02-10 15:26:06 +00:00
vplasencia
35291cb1c5 chore(contracts): update imt version
Former-commit-id: d3fc247bb0
2024-02-10 15:26:06 +00:00
vplasencia
f9cf442609 chore(contracts): update zk-kit imt version
Former-commit-id: 5797e2c145
2024-02-10 15:26:06 +00:00
vplasencia
d0fcdac77d feat(contracts): add many members using new event
Former-commit-id: f80b84981e
2024-02-10 15:26:06 +00:00
cedoor
b124456a79 ci: remove unnecessary cache actions from workflows
Former-commit-id: f98577585a
2024-02-10 15:26:06 +00:00
cedoor
2423bb966a feat(contracts): add new function to verify proofs without nullifiers
Former-commit-id: bc86539c1c
2024-02-10 15:26:06 +00:00
cedoor
660395b594 chore(circuits): udpate zk-kit dependency
Former-commit-id: 75d9542635
2024-02-10 15:26:06 +00:00
cedoor
205fff7147 chore(contracts): update solidity version
Former-commit-id: 9bb72aa7d4
2024-02-10 15:26:06 +00:00
cedoor
4d714385a4 test(proof): add longer timeout for generiting proofs
Former-commit-id: 172fb02a97
2024-02-10 15:26:06 +00:00
cedoor
bd1687474a chore(contracts): downgrade prettier & solhint packages
Former-commit-id: 0defd9d22d
2024-02-10 15:26:06 +00:00
cedoor
f70c9463f4 refactor(contracts): update script to verify contracts
Former-commit-id: 0dae4c8140
2024-02-10 15:26:06 +00:00
cedoor
7dad2b67b8 chore(contracts): removed unused snarkjs templates
Former-commit-id: 5da6fcdd2f
2024-02-10 15:26:06 +00:00
cedoor
5a44daf58d chore(contracts): update solidity and hardhat versions
Former-commit-id: ebd33484ed
2024-02-10 15:26:06 +00:00
Jeeiii
f30daa5a6b docs: add missing external references for EdDSA and Poseidon
Former-commit-id: 464b7910f3
2024-02-10 15:26:06 +00:00
Jeeiii
7a4c4bfcae fix: typo for ISemaphore contract interface custom error
Former-commit-id: 54c2fa4b15
2024-02-10 15:26:06 +00:00
Jeeiii
eaba98441d chore: update copyright year
Former-commit-id: 2e0e139265
2024-02-10 15:26:06 +00:00
Jeeiii
4d141773b6 refactor: update npm types for node up to latest NodeJS LTS version (20)
Former-commit-id: c8f6a9c3c2
2024-02-10 15:26:06 +00:00
Jeeiii
c6f8b33c85 build: move github actions to V4 along with new NodeJS LTS version (20)
Former-commit-id: 1d4f38be6d
2024-02-10 15:26:06 +00:00
Jeeiii
7023db71b4 fix: use merkleTreeSize instead of merkleTreeDepth to support groups with one member
Former-commit-id: ede1d17c2e
2024-02-10 15:26:06 +00:00
Cedoor
669a746805 Update packages/proof/README.md
Co-authored-by: Giacomo <giacomo.corrias7@gmail.com>
Former-commit-id: 103e1e24fc
2024-02-10 15:26:06 +00:00
cedoor
2a7dea10d2 refactor(circuits): update merkle proof variable names
Former-commit-id: 7c33fc72ce
2024-02-10 15:26:06 +00:00
cedoor
df2002166c fix(proof): set correct var name
Former-commit-id: f77b20b85f
2024-02-10 15:26:06 +00:00
cedoor
ab3d65f2bf refactor(circuits): update variable name
Former-commit-id: d833f83ee9
2024-02-10 15:26:06 +00:00
cedoor
57df6a2964 chore(proof): create env bundles
Former-commit-id: 4ecf0d8e30
2024-02-10 15:26:06 +00:00
cedoor
6c797d85b5 docs: update readme files
Former-commit-id: fd50008299
2024-02-10 15:26:06 +00:00
cedoor
d60a44713e refactor(contracts): fix eslint warnings
Former-commit-id: 6f22d452d8
2024-02-10 15:26:06 +00:00
cedoor
ef389af160 chore: move test files outside src
Former-commit-id: 5ea78cdccb
2024-02-10 15:26:06 +00:00
cedoor
b1d2e2affb refactor(hardhat): update hardhat pkg tasks
Former-commit-id: cb4ad7d24d
2024-02-10 15:26:06 +00:00
cedoor
c0d135c900 refactor(heyauthn): update tests and doc
Former-commit-id: a41e405825
2024-02-10 15:26:06 +00:00
cedoor
bb7b3fa9a3 refactor(contracts): move access logic to group contract
Former-commit-id: 16e5f27d10
2024-02-10 15:26:06 +00:00
cedoor
b4ab189185 refactor: hash message and scope
Former-commit-id: 4e46427746
2024-02-10 15:26:06 +00:00
cedoor
6e9ebe1fcb fix(contracts): reverse proof b points
Former-commit-id: 032e0ee0d8
2024-02-10 15:26:06 +00:00
cedoor
36c366df63 chore(proof): update zk-kit groth16 pkg version
Former-commit-id: 458181e866
2024-02-10 15:26:06 +00:00
cedoor
45e4c59001 refactor: update verifiers
Former-commit-id: 8874b22a35
2024-02-10 15:26:06 +00:00
cedoor
143678f40a feat(contracts): update contracts with new imt
Former-commit-id: eb00f164c8
2024-02-10 15:26:06 +00:00
cedoor
d64a44f835 refactor(contracts): remove extension contracts
Former-commit-id: 714cfd2fd4
2024-02-10 15:26:06 +00:00
cedoor
05d14ca80e chore: update env variables
Former-commit-id: 325d515df0
2024-02-10 15:26:06 +00:00
cedoor
6ce24e2067 feat(proof): update proof package with new circuit
Former-commit-id: 0594071d49
2024-02-10 15:26:06 +00:00
cedoor
3caf2ed692 refactor(identity): update commitment variable name
Former-commit-id: 2284ef4b8a
2024-02-10 15:26:06 +00:00
cedoor
e8008aa9e1 feat(group): update group with lean-imt
Former-commit-id: b6a43db5b2
2024-02-10 15:26:06 +00:00
cedoor
c0946f4fbd refactor(identity): add identity commitment attribute
Former-commit-id: 6606fe83d2
2024-02-10 15:26:06 +00:00
cedoor
79b3dcc630 feat(identity): update identity with eddsa
Former-commit-id: 7e0ab11b7a
2024-02-10 15:26:06 +00:00
cedoor
782a8d5c97 chore(circuits): update circom configuration
re #357


Former-commit-id: cdb319d755
2024-02-10 15:26:06 +00:00
cedoor
3208a5cc39 ci: add circuit tests to workflows
re #357


Former-commit-id: 875afb5383
2024-02-10 15:26:06 +00:00
cedoor
c4f4212a55 feat(circuits): update semaphore circuits
re #357


Former-commit-id: 58cfdf7d6b
2024-02-10 15:26:06 +00:00
cedoor
73217208ae style: format code with prettier
Former-commit-id: 3866734abb
2024-02-10 15:25:51 +00:00
Cedoor
42beff4980 docs: update pull_request_template.md
Former-commit-id: c6b9c585d1
2024-02-10 15:21:09 +00:00
Cedoor
bae5020048 Merge pull request #623 from semaphore-protocol/chore/cookies
Matomo script for cookies

Former-commit-id: 2d59691f0e
2024-02-08 19:05:40 +00:00
cedoor
cba6b7e432 chore: add matomo script for cookies
Former-commit-id: 3a1f0782fc
2024-02-08 16:39:26 +00:00
Cedoor
d0e77fcadf Merge pull request #613 from dicethedev/dev-dice/add-new-videos
Added the new videos

Former-commit-id: ca72abb83a
2024-02-08 10:59:21 +00:00
dicethedev
a54a2cc8b0 updated-changes
Former-commit-id: e06c133667
2024-02-08 08:54:00 +01:00
Blessing Samuel
316c5a63b9 Update apps/website/src/data/videos.json
Co-authored-by: Vivian Plasencia <v.pcalana@gmail.com>
Former-commit-id: 8db22976fd
2024-02-07 17:22:08 +01:00
Blessing Samuel
044db31d2b Update apps/website/src/data/videos.json
Co-authored-by: Vivian Plasencia <v.pcalana@gmail.com>
Former-commit-id: 3e845d5bd1
2024-02-07 17:21:37 +01:00
Blessing Samuel
589a19a388 Update apps/website/src/data/videos.json
Co-authored-by: Vivian Plasencia <v.pcalana@gmail.com>
Former-commit-id: 98a259d788
2024-02-07 17:21:28 +01:00
Blessing Samuel
a3d21c1243 Update apps/website/src/data/videos.json
Co-authored-by: Vivian Plasencia <v.pcalana@gmail.com>
Former-commit-id: 72db6c619a
2024-02-07 17:21:11 +01:00
Cedoor
375352d28a Merge pull request #604 from semaphore-protocol/docs/v4-alpha
V4-alpha documentation

Former-commit-id: b33b64fc1d
2024-02-07 15:37:48 +00:00
dicethedev
bdb285528f Added the new videos
Former-commit-id: a954119d48
2024-02-06 11:34:14 +01:00
cedoor
f25fcab110 fix(docs): add key prop to list items
Former-commit-id: c0aaa39781
2024-01-31 16:18:45 +00:00
cedoor
a3bf9ab78f docs(docs): fix remaining wrong links
Former-commit-id: a99e0df25d
2024-01-31 16:11:17 +00:00
cedoor
862f87ae0b chore(docs): fetch deployed contract addresses
Former-commit-id: 4b6c75cbad
2024-01-31 16:05:31 +00:00
cedoor
b2c4025e58 docs(docs): update subgraph doc
Former-commit-id: ac04c66783
2024-01-31 14:16:35 +00:00
cedoor
8a013e6eef chore(docs): manage navbar item visibility from css
Former-commit-id: f283d135b1
2024-01-31 14:16:35 +00:00
cedoor
4fff8f164c docs(docs): add glossary term: trusted-setup
Former-commit-id: 9849921cc8
2024-01-31 14:16:35 +00:00
cedoor
e5c85f0358 docs(docs): update contracts doc
Former-commit-id: c066f120d9
2024-01-31 14:16:35 +00:00
cedoor
12f2b22cda docs(docs): fix typo
Former-commit-id: 14de49c7cf
2024-01-31 14:16:35 +00:00
cedoor
a7f3157f00 chore(docs): add new contributors
Former-commit-id: 64f8c38635
2024-01-31 14:16:35 +00:00
cedoor
99d71c2297 chore(docs): update dependencies
Former-commit-id: ec2bd4c156
2024-01-31 14:16:35 +00:00
cedoor
c0409c8d6e chore(docs): update navbar height
Former-commit-id: f399a8281f
2024-01-31 14:16:35 +00:00
cedoor
f328cf3ce7 docs(docs): update circuits doc
Former-commit-id: 6520580595
2024-01-31 14:16:35 +00:00
cedoor
dd7014b196 docs(docs): update guides
Former-commit-id: 6ccbd78323
2024-01-31 14:16:35 +00:00
cedoor
5cda3eb342 chore(docs): update sidebar items' order
Former-commit-id: 6f296bd7f1
2024-01-31 14:16:35 +00:00
cedoor
4a2e806bc1 docs(docs): update glossary
Former-commit-id: b41b3b3989
2024-01-31 14:16:35 +00:00
cedoor
ac069af22a docs(docs): update guides/identities page
Former-commit-id: 0f824efd1f
2024-01-31 14:16:35 +00:00
cedoor
b845a785a0 docs(docs): update troubleshooting page
Former-commit-id: 02aabb2cca
2024-01-31 14:16:35 +00:00
cedoor
ecacc381d4 docs(docs): fetch list of articles/videos
Former-commit-id: a008c12970
2024-01-31 14:16:35 +00:00
cedoor
b9a3be699a docs(docs): update v4 intro page
Former-commit-id: 42e73cf2aa
2024-01-31 14:16:35 +00:00
cedoor
2227d44ebd docs(docs): replace quick setup with getting started
Former-commit-id: 65c29beeec
2024-01-31 14:16:35 +00:00
cedoor
e8ef43b2fa docs(docs): update v4 faq page
Former-commit-id: f46997f174
2024-01-31 14:16:35 +00:00
cedoor
fb7b683c9e docs(docs): fetch list of articles/videos
Former-commit-id: f742023c2f
2024-01-31 14:16:35 +00:00
cedoor
4c94ab9e0f chore(docs): add website link to the navbar
Former-commit-id: 72f81d0a15
2024-01-31 14:16:35 +00:00
cedoor
a8875e3079 chore(docs): update v4 announcement
Former-commit-id: 413337fac7
2024-01-31 14:16:35 +00:00
cedoor
4588422642 chore(docs): update link to edit docs
Former-commit-id: b493ce3a9f
2024-01-31 14:16:35 +00:00
cedoor
390623ed02 chore(docs): update docs website description
Former-commit-id: 4020870d78
2024-01-31 14:16:35 +00:00
cedoor
26feae6d2c chore(docs): add v4-alpha doc
Former-commit-id: e3a144c760
2024-01-31 14:16:35 +00:00
cedoor
7f4f3743ef chore(docs): add announcement bar
Former-commit-id: bb51e29300
2024-01-31 14:16:35 +00:00
cedoor
0309211f82 chore(docs): add version dropdown to navbar
Former-commit-id: 22a55cf373
2024-01-31 14:16:35 +00:00
Cedoor
c6286da06b Merge pull request #605 from semaphore-protocol/chore/v3-code
Update code of the Learn page to latest v3

Former-commit-id: 64e2f6af28
2024-01-30 13:49:05 +00:00
cedoor
6042ab7b33 chore(website): update learn code to v3
Former-commit-id: 59dc2ec1ae
2024-01-30 12:39:53 +00:00
Cedoor
1808614af4 Merge pull request #600 from semaphore-protocol/chore/version-upgrade
Upgrade Docusaurus to V3

Former-commit-id: 4403322121
2024-01-26 17:22:50 +00:00
Cedoor
a47c8d752b Merge pull request #602 from semaphore-protocol/fix/dmsans-font-url
Set correct DMSans font URL

Former-commit-id: 3c5347e6a4
2024-01-26 17:22:22 +00:00
Cedoor
8a7bffe027 Merge pull request #601 from semaphore-protocol/chore/plurality-description
New Plurality project tagline

Former-commit-id: d51b112f61
2024-01-26 14:26:25 +00:00
cedoor
6497a941e4 fix(docs): set correct dmsans font url
Former-commit-id: 2d9ee1ebe7
2024-01-26 13:11:07 +00:00
cedoor
37a4f7d104 chore(website): update plurality project description
Former-commit-id: 3790892ce8
2024-01-26 13:01:26 +00:00
cedoor
c634b582b8 style(docs): format code with eslint
Former-commit-id: fcf0075da7
2024-01-26 12:25:46 +00:00
cedoor
d76d8287c0 chore(docs): upgrade docusaurus version
re #556


Former-commit-id: 07a93864b4
2024-01-26 12:18:53 +00:00
Cedoor
19f33e80d5 Merge pull request #589 from semaphore-protocol/docs/v3-packages
Specify package version in V3 documentation

Former-commit-id: 136591602b
2024-01-24 18:10:07 +00:00
cedoor
9ff53b1f6c docs(docs): add ^ to version
Former-commit-id: d2ef48e212
2024-01-24 17:59:10 +00:00
cedoor
38ac45f634 docs(docs): specify v3 version
Former-commit-id: b2d68a940f
2024-01-24 17:22:14 +00:00
Cedoor
d90a104c10 Merge pull request #581 from semaphore-protocol/chore/Add-Remix
docs: adding Remix to project list
Former-commit-id: e293609042
2024-01-24 10:53:46 +00:00
Andy
01f120115d docs: adding Remix to project list
Former-commit-id: 82804795f1
2024-01-23 16:04:57 -06:00
Cedoor
a986b88cc7 Merge pull request #575 from semaphore-protocol/chore/update-events
Updating upcoming events in 2024

Former-commit-id: c04605b83e
2024-01-23 18:40:10 +00:00
Andy
9d9328900e style(updating title and running prettier): updating title and running prettier
Former-commit-id: ad8a46f285
2024-01-23 12:12:34 -06:00
Andres Guzman
88e4684e53 Updating events
Former-commit-id: f5198754f9
2024-01-22 14:42:39 -06:00
Vivian Plasencia
d94e7ba221 Merge pull request #563 from semaphore-protocol/chore/carousel-card-borders
Add borders to carousel item cards

Former-commit-id: 0602554b97
2024-01-16 10:58:05 +01:00
cedoor
1bbd4387db chore(website): add borders to carousel item cards
Former-commit-id: 7ce4a6315f
2024-01-15 17:00:54 +00:00
Cedoor
e64ecdd680 Merge pull request #559 from semaphore-protocol/chore/ui-adjustments
UI adjustments in the website

Former-commit-id: 0f0df55615
2024-01-12 17:23:33 +00:00
cedoor
edfd3579a8 chore(website): change link underline color
Former-commit-id: d54bbf5cbb
2024-01-12 17:22:43 +00:00
cedoor
c6571b31f0 chore(website): center card horizontally
Former-commit-id: bf4e8be8be
2024-01-12 17:19:10 +00:00
cedoor
29be015567 chore(website): add more content to learn zk tab
Former-commit-id: 6b11553e2a
2024-01-12 16:51:40 +00:00
cedoor
883e11ea31 chore(website): remove alt property values from images
Former-commit-id: e7545897e5
2024-01-12 16:41:34 +00:00
cedoor
57cbe8298b chore(website): set correct docs links
Former-commit-id: eb3d731120
2024-01-12 14:12:00 +00:00
cedoor
d8d3c17e13 chore(website): change link underline color
Former-commit-id: 969d17862f
2024-01-12 12:14:19 +00:00
cedoor
87f01fa004 chore(website): make some ui adjustments
re #558


Former-commit-id: 55ca431de0
2024-01-12 12:07:22 +00:00
Cedoor
dcac32401f Merge pull request #557 from semaphore-protocol/chore/docs-minor-ui-issues
Fixed minor UI issues on docs

Former-commit-id: 0181e9b0e3
2024-01-12 10:53:43 +00:00
cedoor
9db1c36be4 chore(website): fix header font size in build page
Former-commit-id: 064e9fcf3f
2024-01-11 18:50:24 +00:00
cedoor
3786b4f721 style(docs): format code with prettier
Former-commit-id: 4dbe4b13a6
2024-01-11 16:09:34 +00:00
cedoor
236c6f7ae6 chore(docs): fix minor ui issues
Former-commit-id: 9c710c15fd
2024-01-11 15:31:59 +00:00
Cedoor
d84a245547 Merge pull request #554 from semaphore-protocol/chore/button-colors
New theme colors and button style

Former-commit-id: a9d55bd866
2024-01-11 14:04:42 +00:00
cedoor
439ba48c33 chore(website): add transition properties to buttons
Former-commit-id: 9517f3add7
2024-01-11 13:29:24 +00:00
cedoor
c8c22a0a40 chore(subgraph): remove file from git
Former-commit-id: 75d6d33e3b
2024-01-11 12:58:34 +00:00
Cedoor
74d63912f3 Merge pull request #551 from semaphore-protocol/chore/carousel-divider
Divider to separate videos and articles

Former-commit-id: db3b70a575
2024-01-11 12:56:02 +00:00
cedoor
3571e03288 chore(website): update theme colors and button style
Former-commit-id: d56a73a77a
2024-01-11 12:36:15 +00:00
Cedoor
24de0587de Merge pull request #542 from semaphore-protocol/chore/subgraph
Semaphore subgraph in main repository

Former-commit-id: 2ecb7261a8
2024-01-11 11:17:20 +00:00
cedoor
e29eaf8c4d style(website): fix lint errors
Former-commit-id: e58dc5e891
2024-01-11 11:03:10 +00:00
cedoor
41a44e710f chore(subgraph): add test files automatically generated to gitignore
Former-commit-id: d023855264
2024-01-11 11:00:31 +00:00
Cedoor
754f40aad5 Merge pull request #549 from semaphore-protocol/feat/project-links
New links/icons in the project cards

Former-commit-id: 58878aff14
2024-01-11 10:53:21 +00:00
cedoor
7856b94525 chore(website): add a divider to separate videos and articles
Former-commit-id: c6bf3fda7f
2024-01-11 10:52:27 +00:00
cedoor
4d388ac631 fix(website): set right icon dimension
Former-commit-id: f0fa7d9f92
2024-01-11 10:39:32 +00:00
cedoor
e768a416bb fix(website): copy array of projects before sorting
Former-commit-id: 3fbf44238d
2024-01-10 23:03:18 +00:00
cedoor
456d85b587 fix(website): set right props in project card component
Former-commit-id: 6eba863197
2024-01-10 19:04:01 +00:00
cedoor
89185c36de feat(website): add links to project cards
Former-commit-id: 173ad736cf
2024-01-10 18:54:57 +00:00
cedoor
db41f9fea7 chore(subgraph): move subgraph to main repo
Former-commit-id: 3d57105982
2024-01-10 13:21:05 +00:00
Giacomo
10cdbb935a Merge pull request #540 from semaphore-protocol/website/reflect-prs
Reflect missing PRs on website after porting documentation to `semaphore` repository

Former-commit-id: 767df8790a
2024-01-09 16:40:05 +01:00
Jeeiii
e6ab94a314 docs: reflect changes from previous PR #113
Former-commit-id: b61e1dd61a
2024-01-09 11:52:30 +01:00
Jeeiii
c37bb31992 docs: reflect changes from previous PR #111
Former-commit-id: d28a88cf1f
2024-01-09 11:51:49 +01:00
Jeeiii
94c8666db6 docs: reflect changes from previous PR #110
Former-commit-id: d3fcac4cb4
2024-01-09 11:50:05 +01:00
vplasencia
1ab15c1c05 chore: v3.15.2
Former-commit-id: 514f309583
2024-01-08 13:11:50 +01:00
Cedoor
5fe5a92e0d Merge pull request #528 from semaphore-protocol/fix/mumbai-data-package
Replace matic with mumbai

Former-commit-id: 49f8239783
2024-01-08 12:04:21 +00:00
vplasencia
4961df9ed2 fix(data): replace matic with mumbai
Former-commit-id: edbf0ea035
2024-01-08 13:00:09 +01:00
Cedoor
5a01c220c7 Merge pull request #520 from omahs/patch-1
Fix typos

Former-commit-id: 844a664f01
2024-01-03 12:06:51 +01:00
Cedoor
b96a09c300 Merge pull request #519 from semaphore-protocol/docs/website-readme
New README file for the website

Former-commit-id: 0cf5365f65
2024-01-03 10:48:42 +01:00
omahs
82599b565b fix typo
Former-commit-id: 0bc4f0da85
2024-01-03 10:26:09 +01:00
omahs
2af6c8fbef fix typo
Former-commit-id: a811dc6d3d
2024-01-03 10:22:01 +01:00
cedoor
fd52c56cac docs(website): create readme file for the website
Former-commit-id: f2a5000a4d
2024-01-02 18:07:13 +01:00
cedoor
9cd881d276 chore(docs): remove yarn release from docs
Former-commit-id: 6d32ff6dd0
2024-01-02 18:06:47 +01:00
Cedoor
892e30d201 Merge pull request #518 from semaphore-protocol/feat/ethrome-workshop
Add ETHRome workshop

Former-commit-id: 5a322a315e
2024-01-02 11:01:50 +01:00
vplasencia
0ed72212cd feat(website): add the ethrome workshop
Former-commit-id: 49903402d1
2023-12-25 15:33:52 +01:00
Cedoor
ec006dc69a Merge pull request #489 from semaphore-protocol/website/426
Update website metadata

Former-commit-id: adcbc27fd2
2023-12-22 12:45:11 +01:00
Cedoor
75e1e87980 Merge pull request #497 from semaphore-protocol/fix/website-ui
Minor enhancements to the website

Former-commit-id: efebc5d546
2023-12-21 18:25:49 +01:00
Cedoor
4bc2ca86dd Merge pull request #495 from semaphore-protocol/chore/fix-docs
Minor enhancements to the documentation website

Former-commit-id: fbb1b062e5
2023-12-21 17:51:15 +01:00
cedoor
8a39e8486f fix(website): set right bg gradient to buttons
Former-commit-id: 08b1f47147
2023-12-21 17:49:12 +01:00
cedoor
6b6f804c62 fix(website): fix ui inaccuracies
Former-commit-id: 5818b227ed
2023-12-21 17:35:48 +01:00
Jeeiii
bea4dafca8 style: update link and docs version light theme colors
Former-commit-id: e42ae25b2a
2023-12-21 17:35:10 +01:00
Jeeiii
f3a5214239 refactor: remove highlighted line of code
Former-commit-id: 51179e9142
2023-12-21 17:08:02 +01:00
Jeeiii
0ea83f8df9 refactor: wrong link for Semaphore voting contract in V2 docs
Former-commit-id: a988a1dd34
2023-12-21 17:06:37 +01:00
Jeeiii
4667f9c0cb refactor: change from twitter to x
Former-commit-id: 08da4a3b95
2023-12-21 17:03:25 +01:00
Jeeiii
4246a71fa6 style: removed unused icons and update favicon
Former-commit-id: d42b71bd80
2023-12-21 17:03:02 +01:00
Jeeiii
4900d7d71f style: update Semaphore logo
Former-commit-id: 82d6a631b0
2023-12-21 16:48:39 +01:00
Jeeiii
0f6600b6e0 refactor: remove Learn section from footer
Former-commit-id: 9c0c126cbe
2023-12-21 16:23:22 +01:00
Cedoor
740039205c Merge pull request #493 from semaphore-protocol/chore/landing
Adapt Semaphore documentation to new Identity Kit

Former-commit-id: b4542a5e5a
2023-12-20 18:07:38 +01:00
Jeeiii
3d18f9f7b6 chore: remove CNAME
Former-commit-id: 65850a5e17
2023-12-20 18:05:25 +01:00
Jeeiii
a1b94c2f2d style: update colors according to theme
Former-commit-id: ed70f6dee5
2023-12-20 17:21:22 +01:00
Jeeiii
610b041bce style: update fonts for custom theme
Former-commit-id: e92f2f8b7e
2023-12-20 16:22:10 +01:00
Jeeiii
2f64c8c4a4 refactor: remove used by section and update twitter link
Former-commit-id: c8839acfe4
2023-12-20 15:54:11 +01:00
Jeeiii
430feee358 refactor: remove landing page and update docs url
Former-commit-id: 84530156ea
2023-12-20 15:49:48 +01:00
Cedoor
65c62281fe Merge pull request #490 from semaphore-protocol/website/454
Improve website UX

Former-commit-id: c710a462a8
2023-12-19 18:22:37 +01:00
Cedoor
76b624eb19 Merge pull request #491 from semaphore-protocol/chore/docs
Semaphore Docusaurus documentation

Former-commit-id: 8bb567bced
2023-12-19 18:05:11 +01:00
cedoor
092b5b0eb3 style(docs): fix eslint errors
Former-commit-id: d0387d6deb
2023-12-19 18:00:56 +01:00
cedoor
f54db33cbe style(docs): format docs files with prettier
Former-commit-id: 21d8c15416
2023-12-19 17:47:25 +01:00
cedoor
7cc273e01f chore(docs): add semaphore docs project
Former-commit-id: 5fac62ed44
2023-12-19 17:35:47 +01:00
Cedoor
60fd6d1f3e docs: update semaphore title
Former-commit-id: b265bc2928
2023-12-19 17:27:48 +01:00
cedoor
fbd5d96760 docs: remove projects from readme file
Former-commit-id: 8c2f32eb10
2023-12-19 16:54:00 +01:00
cedoor
f7ff4e0b04 Merge branch 'chore/website'
Former-commit-id: 28057811de
2023-12-19 16:53:09 +01:00
Cedoor
5d99ad7388 Merge pull request #478 from semaphore-protocol/website/477
Add missing link to Semaphore X account

Former-commit-id: f0cc83ee1b
2023-12-19 16:17:39 +01:00
Jeeiii
a920768b6e refactor: add missing warning when there are no projects
Former-commit-id: d1b6c5bda6
2023-12-19 15:30:25 +01:00
Jeeiii
949019ae39 refactor: display the get started and try the demo buttons higher up on the page
Former-commit-id: b7bdd83437
2023-12-19 15:06:35 +01:00
Jeeiii
216bccdaad refactor: update website metadata url
Former-commit-id: 4fcc15f303
2023-12-19 14:59:50 +01:00
Jeeiii
fd871a3dbb refactor: add X link to footer and navbar
Former-commit-id: 831a660ce9
2023-12-19 14:46:32 +01:00
Cedoor
ea4e3b63af Merge pull request #470 from semaphore-protocol/website/462
Home page exceeds page's dimensions on Chromium-based browsers

Former-commit-id: fc6f782a03
2023-12-19 14:43:16 +01:00
Jeeiii
ec711fec43 refactor: adapt to chakra ui syntax
Former-commit-id: 071479fc7d
2023-12-19 13:42:53 +01:00
Cedoor
89a85dbfb1 Merge pull request #476 from semaphore-protocol/website/423
Reflect color scheme based on design

Former-commit-id: e6a4aa7629
2023-12-15 11:35:20 +01:00
Jeeiii
4d875599b0 refactor: add missing X button
Former-commit-id: 712d6e1696
2023-12-14 14:04:41 +01:00
Jeeiii
01525a8a2f refactor: update colors
Former-commit-id: 7d5707058d
2023-12-13 19:56:06 +01:00
Cedoor
84f61004e0 Merge pull request #471 from semaphore-protocol/website/447
Static height for project `Grid`

Former-commit-id: d5339d21a9
2023-12-12 14:59:49 +00:00
Jeeiii
a233caf565 refactor: add custom scoll to view to avoid UI bumps
Former-commit-id: 557500c84c
2023-12-12 15:53:48 +01:00
Jeeiii
34f4e09b36 refactor: add auto scroll to view to avoid ui bumps
Former-commit-id: f6de9cc2f3
2023-12-12 14:59:28 +01:00
Cedoor
de4296dd14 Merge pull request #472 from semaphore-protocol/website/459
refactor: switched from single to multi selector for projects categories
Former-commit-id: dc5b2af4ab
2023-12-12 13:42:35 +00:00
Cedoor
fe968c92cd Merge pull request #473 from semaphore-protocol/website/460
Fix Tab selectors on smaller screens

Former-commit-id: cbf66a8fe8
2023-12-12 13:41:16 +00:00
Jeeiii
db9a68aeb9 refactor: back to previous Box and TabList properties
Former-commit-id: fd95c3dc90
2023-12-12 14:13:06 +01:00
Jeeiii
cc1af1bec3 refactor: missing category label
Former-commit-id: 56d7fffc73
2023-12-12 14:06:59 +01:00
Jeeiii
de6a55ffd1 fix: missing double filter logic on created by and category
Former-commit-id: a6fde2fded
2023-12-12 12:40:03 +01:00
Jeeiii
3da7e77f53 fix: remove fixed grid item height and reduce grid dimension for better scroll
Former-commit-id: c64bfe7815
2023-12-12 11:17:47 +01:00
Jeeiii
b87941c0b6 chore: pass eslint rule
Former-commit-id: 044cfb8ad4
2023-12-12 11:03:41 +01:00
Jeeiii
4600fa0b48 fix: add custom styles and overflow to avoid collapse of UI when selecting tabs on smaller screens
Former-commit-id: 975ff06a0b
2023-12-12 10:56:24 +01:00
Jeeiii
54c1b15591 refactor: switched from single to multi selector for projects categories
Former-commit-id: 6475de3a64
2023-12-12 00:46:48 +01:00
Jeeiii
a31b28180d fix: make the height of the project grid fixed to prevent upward flotation
Former-commit-id: bfaba753f3
2023-12-12 00:29:01 +01:00
Jeeiii
300cf57307 fix: missing projects page image
Former-commit-id: 66d13875f3
2023-12-12 00:12:40 +01:00
Jeeiii
ff4a739426 fix: hidden overflowX and min/max width for images
Former-commit-id: 395f3bd8c5
2023-12-11 23:54:44 +01:00
Cedoor
cf7980d933 Merge pull request #458 from semaphore-protocol/ref/update-links
Add some URLs

Former-commit-id: 2b0afdfa83
2023-11-30 10:09:28 +00:00
vplasencia
c17d52939e refactor(website): add get inspired button url in the build page
Former-commit-id: 2352616ef2
2023-11-30 00:04:27 +01:00
cedoor
f6177ea2d0 fix: grammar adjustment
Former-commit-id: b4dd8f3072
2023-11-29 17:35:00 +00:00
Cedoor
6845b74edd Merge pull request #455 from semaphore-protocol/ref/link-order
Show the latest videos and articles first on the learn page

Former-commit-id: 0b4d0f3e10
2023-11-29 17:21:58 +00:00
vplasencia
f37e13da37 feat(website): sort articles and videos by date
Former-commit-id: 0f5f7d8406
2023-11-29 18:13:33 +01:00
cedoor
c41343e510 chore(website): add group id parameter to code snippet
Former-commit-id: e19bbea0bf
2023-11-29 16:35:00 +00:00
vplasencia
c316796446 refactor(website): update button url in projects page
Former-commit-id: b34714972c
2023-11-29 13:32:50 +01:00
vplasencia
aa2382748a refactor(website): optimize social media image
Former-commit-id: dcadd9145f
2023-11-29 13:30:48 +01:00
vplasencia
ea59e0b751 refactor(website): add some urls
Former-commit-id: 65499aebb0
2023-11-28 20:10:36 +01:00
Vivian Plasencia
c0116dbe03 Merge pull request #456 from semaphore-protocol/perf/youtube-thumbnails
Youtube thumbnails instead of heavy i-frames

Former-commit-id: c32597855f
2023-11-28 17:49:09 +01:00
cedoor
6b643132ee refactor(website): update videos parameter names
Former-commit-id: 12e8b93e47
2023-11-28 16:43:38 +00:00
cedoor
6b48c48dd6 perf(website): replace youtube previews with thumbnails
re #429


Former-commit-id: 63ba4f4f39
2023-11-28 13:40:51 +00:00
vplasencia
b1d23fc24d refactor(website): show the latest videos and articles first on the learn page
Former-commit-id: c7693c50a4
2023-11-28 10:48:57 +01:00
vplasencia
5ea8f401df refactor(website): use chakra image instead of nextjs image
Former-commit-id: d3b9fcce5e
2023-11-27 11:13:29 +01:00
vplasencia
bf2b0d5edd refactor(website): use chakra image in projects page
Former-commit-id: de060e6dfb
2023-11-26 19:30:52 +01:00
cedoor
a288ed7162 chore: v3.15.1
Former-commit-id: 9e84c93198
2023-11-22 11:03:42 +00:00
Cedoor
4f73284c06 Merge pull request #452 from dcposch/main
fix: typescript type exports
Former-commit-id: d008d6233a
2023-11-22 14:01:24 +03:00
DC
bd7d3e352f fix: typescript type exports
Former-commit-id: a4109e7ea4
2023-11-16 01:03:42 +03:00
Vivian Plasencia
3506b0da91 Merge pull request #451 from semaphore-protocol/fix/learn-sections
Make learn sections responsive

Former-commit-id: f6c7b08ed2
2023-11-15 11:14:49 +03:00
Vivian Plasencia
955b87b50c Merge branch 'chore/website' into fix/learn-sections
Former-commit-id: 4ad4f150e9
2023-11-15 11:14:35 +03:00
Vivian Plasencia
2c8089b6ad Merge pull request #450 from semaphore-protocol/fix/scrolling-tabs
Add scroll bar to tabs

Former-commit-id: 3efe5c488a
2023-11-15 11:13:27 +03:00
Vivian Plasencia
044188697d Merge pull request #449 from semaphore-protocol/refactor/projects-order
Projects' list items will be ordered by name

Former-commit-id: 996a358c3c
2023-11-15 11:13:11 +03:00
cedoor
9dd7a4ea1c fix(website): make learn sections responsive
Former-commit-id: b4f141194f
2023-11-14 17:41:14 +03:00
cedoor
9104e7d52d fix(website): add scroll bar to tabs
Former-commit-id: f3608aac51
2023-11-14 16:00:45 +03:00
cedoor
715f14a774 refactor(website): change projects' list order
Former-commit-id: ce3aeb01e8
2023-11-13 11:11:02 +00:00
cedoor
e3eb20cb6c refactor(website): general refactoring
Former-commit-id: b2bb93e2e7
2023-11-10 21:05:20 +00:00
Cedoor
5dc1ecc2e9 Merge pull request #446 from semaphore-protocol/chore/eslint
New eslint rules for TSX files

Former-commit-id: cd51cc27aa
2023-11-10 13:41:27 +00:00
cedoor
f9fc8d4254 chore(website): add eslint config for tsx files
Former-commit-id: 8419513eac
2023-11-10 12:49:31 +00:00
cedoor
d937bf6b63 chore(website): add eslint config for tsx files
Former-commit-id: 3450acd707
2023-11-10 12:48:01 +00:00
Cedoor
985ab89f23 Merge pull request #443 from semaphore-protocol/chore/projects
New projects to `projects.json` file

Former-commit-id: 270ba6bdee
2023-11-10 12:02:16 +00:00
cedoor
64da55ddf6 chore(website): add missing taglines to projects
Former-commit-id: 24139d72c3
2023-11-10 12:01:40 +00:00
Cedoor
d96b64544a Merge pull request #440 from semaphore-protocol/ref/responsive-build-page
Add responsive design to build page

Former-commit-id: 7c661348e1
2023-11-09 19:46:39 +00:00
Cedoor
bf9624225b Merge pull request #435 from semaphore-protocol/ref/responsive-learn-page
Add responsive design to learn page

Former-commit-id: 4df0e40e94
2023-11-09 19:45:57 +00:00
vplasencia
a41c394664 refactor(website): update font size for responsive design
Former-commit-id: 799b7655f3
2023-11-09 20:18:45 +01:00
vplasencia
cb2a20a038 refactor(website): update tools card height
Former-commit-id: 3b7542e518
2023-11-09 19:30:11 +01:00
vplasencia
5f579b0ebb refactor(website): update action card button style
Former-commit-id: 075e8f42ff
2023-11-09 18:51:53 +01:00
vplasencia
18d214f19c refactor(website): change font style
Former-commit-id: 2d974cf813
2023-11-09 18:46:30 +01:00
Cedoor
8b9a34a2f0 Merge pull request #445 from semaphore-protocol/fix/carousel
Load Carousel items only after the breakpoint is defined

Former-commit-id: 173d051962
2023-11-09 16:55:20 +00:00
cedoor
a1a33faa32 fix(website): add size to use effect dependencies
Former-commit-id: ac339ea15f
2023-11-09 16:52:46 +00:00
cedoor
a9797add7d fix(website): keep project list numbers in the same position
Former-commit-id: 0a6164cf17
2023-11-09 16:39:30 +00:00
Cedoor
942259c295 Merge pull request #444 from semaphore-protocol/chore/events
New events in the `events.json`

Former-commit-id: 3130933be2
2023-11-09 16:35:56 +00:00
cedoor
bd9d31c525 fix(website): show carousel after breakpoint loads
Former-commit-id: e17fbb4aec
2023-11-09 16:30:02 +00:00
cedoor
411070fa01 fix(website): set correct project property name
Former-commit-id: f2fdb8e555
2023-11-09 16:21:22 +00:00
cedoor
f338315dad fix(website): set correct project property name
Former-commit-id: 47bd6f37a3
2023-11-09 16:19:50 +00:00
cedoor
d6e2ce7639 refactor(website): add links to events
Former-commit-id: 55e8eef27f
2023-11-09 16:12:13 +00:00
cedoor
4e130e5690 fix(website): add functions to project list buttons
Former-commit-id: 44a16cf1c9
2023-11-09 16:08:40 +00:00
cedoor
b3b86c1b8c chore(website): update events.json
Former-commit-id: 2bcc5046b6
2023-11-09 16:03:02 +00:00
cedoor
93425518aa chore(website): add new projects to json file
Former-commit-id: 820398321b
2023-11-09 15:34:22 +00:00
Cedoor
0dd58aef60 Merge pull request #442 from semaphore-protocol/refactor/fixed-navbar
Make navbar position fixed

Former-commit-id: 18b7e7f7af
2023-11-09 13:37:10 +00:00
cedoor
65972fb6cc refactor(website): make navbar position fixed
Former-commit-id: 1e3dacfb8a
2023-11-09 12:15:16 +00:00
Cedoor
417aad3108 Merge pull request #441 from semaphore-protocol/feat/links-build-page
Add links in the website build page

Former-commit-id: bb1ff3bca9
2023-11-09 11:10:00 +00:00
vplasencia
ce34d6469d refactor(website): update copy code button style
Former-commit-id: 3979f341e7
2023-11-09 09:33:29 +01:00
vplasencia
48a362c874 refactor(website): update action card padding
Former-commit-id: 736825549e
2023-11-09 09:16:28 +01:00
vplasencia
d00ff8c117 refactor(website): make the image responsive
Former-commit-id: e0269736e8
2023-11-09 09:12:11 +01:00
vplasencia
0d45520cfe refactor(website): update links in the website build page
Former-commit-id: 98e0b95305
2023-11-09 08:49:06 +01:00
vplasencia
3bfc369993 style(website): style code with prettier
Former-commit-id: 1fbb437bc7
2023-11-09 01:23:35 +01:00
vplasencia
fc70ae7023 refactor(website): make the build page responsive
Former-commit-id: 491bfe53c4
2023-11-09 01:22:40 +01:00
vplasencia
f92efbe9bb style(website): format code with prettier
Former-commit-id: c70f162df9
2023-11-08 23:26:26 +01:00
vplasencia
6dbc70ec31 refactor(website): create scrollable list for videos and articles
Former-commit-id: 075cdb8c78
2023-11-08 23:25:44 +01:00
vplasencia
93c3dab706 chore(website): merge branch 'chore/website' into ref/responsive-learn-page
Former-commit-id: f21c77713a
2023-11-08 22:00:54 +01:00
Vivian Plasencia
003dece6a8 Merge pull request #439 from semaphore-protocol/chore/optimized-images
Compressed JPG images instead of big PNGs 

Former-commit-id: 962bcc9fbe
2023-11-08 21:58:40 +01:00
vplasencia
ea764c26d4 chore(website): merge branch 'chore/website' into ref/responsive-learn-page
Former-commit-id: e0332f1cb6
2023-11-08 21:57:26 +01:00
cedoor
592d20de41 chore(website): replace png images with optimized jpg
Former-commit-id: 4b3974ba2e
2023-11-08 20:46:02 +00:00
Vivian Plasencia
552d3d9818 Merge pull request #436 from semaphore-protocol/fix/menu-links
The navbar menu closes after clicking on links

Former-commit-id: cd3c29b20a
2023-11-08 21:23:22 +01:00
Vivian Plasencia
06d43db986 Merge pull request #433 from semaphore-protocol/refactor/carousel
Merge Carousel components

Former-commit-id: 81e21b0875
2023-11-08 21:23:10 +01:00
cedoor
8c795462f4 fix(website): set correct array length
Former-commit-id: e660f1fb75
2023-11-08 18:04:07 +00:00
cedoor
14229ce663 refactor(website): close navbar menu after clicking on links
Former-commit-id: 3581bc27f3
2023-11-08 17:46:49 +00:00
vplasencia
dd0a3496e6 refactor(website): run prettier
Former-commit-id: 0bf21313f2
2023-11-08 18:06:13 +01:00
vplasencia
97572c9fa7 refactor(website): add responsive design to learn page
Former-commit-id: 48b6d856b7
2023-11-08 17:57:37 +01:00
cedoor
a1f3942ca0 refactor(website): merge carousel components
Former-commit-id: 2935055b31
2023-11-08 16:05:54 +00:00
Cedoor
58460f9c8b Merge pull request #431 from semaphore-protocol/perf/background-images
NextJS background images

Former-commit-id: c04fcda9f5
2023-11-08 12:05:39 +00:00
Vivian Plasencia
f322606796 Merge pull request #430 from semaphore-protocol/ref/website-metadata-img
Update website metadata image

Former-commit-id: 8841b8a43a
2023-11-08 12:58:18 +01:00
cedoor
b6a4e94639 perf(website): set nextjs background images
Former-commit-id: fbb1443a0e
2023-11-08 11:57:01 +00:00
vplasencia
1889a2ee81 refactor(website): update metadata image url
Former-commit-id: 75b9b47433
2023-11-08 12:20:30 +01:00
Cedoor
09b9d0c823 Merge pull request #428 from semaphore-protocol/ref/website-metadata
Change website metadata

Former-commit-id: c5625dbf47
2023-11-08 10:32:56 +00:00
vplasencia
5a4dd10c9f fix(website): change website metadata
Former-commit-id: 5b49f68352
2023-11-08 10:18:15 +01:00
Vivian Plasencia
c9649ade7e Merge pull request #425 from semaphore-protocol/feat/website-metadata
Add website metadata

Former-commit-id: bd37d627c8
2023-11-07 23:17:01 +01:00
Vivian Plasencia
8ae90258cd Merge pull request #424 from semaphore-protocol/chore/pse-icon
Add PSE icon to the button in the "Projects" page

Former-commit-id: dca26b8d90
2023-11-07 23:16:48 +01:00
vplasencia
3a52151fbd feat(website): add website metadata
Former-commit-id: 5d4802ab50
2023-11-07 23:00:21 +01:00
cedoor
d7e131a65f refactor(website): add default color to pse icon
Former-commit-id: 2038826587
2023-11-07 17:53:13 +00:00
cedoor
3f8d894738 chore(website): add pse icon to projects button
Former-commit-id: 22902253f2
2023-11-07 17:49:50 +00:00
cedoor
34278097ca refactor(website): remove paragraph from semaphore features
Former-commit-id: b556784b7f
2023-11-07 17:40:59 +00:00
cedoor
6c5d0cee40 chore(website): add missing links to footers
Former-commit-id: c50c89bba8
2023-11-07 17:36:27 +00:00
Cedoor
85d45e276b Merge pull request #413 from semaphore-protocol/feat/learn-page
Create Website Learn page

Former-commit-id: 64a69de24a
2023-11-07 16:48:01 +00:00
Cedoor
a67197aa20 Merge pull request #417 from semaphore-protocol/refactor/responsive
Responsive navbar

Former-commit-id: 07b633d683
2023-11-07 16:33:08 +00:00
Cedoor
650638e505 Merge pull request #418 from semaphore-protocol/refactor/responsive-footer
Responsive footer

Former-commit-id: a091ba3f46
2023-11-07 16:32:27 +00:00
Cedoor
abb227ce9d Update apps/website/src/components/Navbar.tsx
Co-authored-by: Vivian Plasencia <v.pcalana@gmail.com>
Former-commit-id: e739a9abb0
2023-11-07 16:12:27 +00:00
vplasencia
91c8970d02 fix(website): update carousels
Former-commit-id: b841a1e632
2023-11-07 17:10:15 +01:00
vplasencia
fd1d440220 refactor(website): update carousels and other improvements
Former-commit-id: aa253ef1cc
2023-11-07 16:37:32 +01:00
cedoor
f43e70ae36 refactor(website): make footbar responsive
Former-commit-id: b3d35b7d8e
2023-11-07 12:50:27 +00:00
cedoor
9c7b38184e refactor(website): make navbar responsive
Former-commit-id: b71ae4c5d9
2023-11-07 12:34:02 +00:00
vplasencia
219cc63362 chore(website): merge chore/website into feat/learn-page
Former-commit-id: 84910bd7b8
2023-11-07 11:44:46 +01:00
Cedoor
ba62335f9c Merge pull request #415 from semaphore-protocol/feat/carousel-animation
Carousel animations

Former-commit-id: 19b0b46cf2
2023-11-07 10:03:28 +00:00
vplasencia
41768ac76f fix(website): add key prop to the elem
Former-commit-id: fde257ba94
2023-11-06 23:28:13 +01:00
cedoor
11baf59360 feat(website): create new carousel with animation
Former-commit-id: bd3a16a23e
2023-11-06 22:18:44 +00:00
vplasencia
bd478f8892 feat(website): create the learn page
Former-commit-id: 630ed623d3
2023-11-06 18:51:10 +01:00
Vivian Plasencia
64fd89bac2 Merge pull request #412 from semaphore-protocol/refactor/responsive
Responsive home page

Former-commit-id: 4b78701fca
2023-11-06 16:46:51 +01:00
cedoor
ccbcba02fa fix(website): update projects json path
Former-commit-id: fca872cff7
2023-11-06 15:16:09 +00:00
cedoor
26b61c2c44 refactor(website): make home page responsive
Former-commit-id: e926024151
2023-11-06 13:22:43 +00:00
Cedoor
3dc47cffa6 Merge pull request #411 from semaphore-protocol/chore/hosted-images
Cloudflare R2 hosted images

Former-commit-id: 2367484fb0
2023-11-06 11:04:17 +00:00
Cedoor
03b96f397a Merge pull request #410 from semaphore-protocol/fix/external-links
Proper external links

Former-commit-id: 5596299e2f
2023-11-06 11:03:54 +00:00
Cedoor
df677c4755 Merge branch 'chore/website' into fix/external-links
Former-commit-id: 66e0f8907e
2023-11-06 11:03:48 +00:00
Cedoor
ecf9b0ee4c Merge pull request #409 from semaphore-protocol/feat/projects-page
Projects page

Former-commit-id: accf640d50
2023-11-06 11:02:59 +00:00
cedoor
1dd580e14d chore(website): add hosted images
Former-commit-id: 8b4b7287ea
2023-11-05 14:04:46 +00:00
cedoor
1cd3e97359 refactor(website): update element position
Former-commit-id: 528902ea57
2023-11-05 13:57:32 +00:00
cedoor
5b8311d4d4 chore(website): remove projects image from repo
Former-commit-id: 7ce7b5bf3f
2023-11-05 13:55:24 +00:00
cedoor
961cb76666 fix(website): set isExternal property
Former-commit-id: 6c8b98edee
2023-11-03 18:37:18 +00:00
cedoor
dcd55f0e28 refactor(website): make projects page responsive
Former-commit-id: 52326b079d
2023-11-03 18:24:41 +00:00
cedoor
2bd369e278 feat(website): create projects page
Former-commit-id: 90a08c6765
2023-11-03 17:21:18 +00:00
Cedoor
b31bb0df42 Merge pull request #408 from semaphore-protocol/fix/build-page
fix(website): fix build page for production

Former-commit-id: f4aacf6d1a
2023-10-30 15:49:41 +00:00
vplasencia
8b9df3a93f fix(website): fix build page for production
Former-commit-id: 8a2e34d1db
2023-10-30 14:57:53 +01:00
cedoor
bed3de0818 fix(website): update import order
Former-commit-id: 860b4bf39a
2023-10-30 13:17:48 +00:00
cedoor
487cb093e8 fix(website): add missing import
Former-commit-id: 2a5da821db
2023-10-30 13:01:16 +00:00
Cedoor
46e216dc66 Merge pull request #397 from semaphore-protocol/feat/build-page
Create website build page

Former-commit-id: 1e3d62303f
2023-10-30 12:55:09 +00:00
Cedoor
d68f4f87b1 Merge pull request #402 from semaphore-protocol/refactor/links
NextJS links

Former-commit-id: 05a48471d6
2023-10-30 12:53:16 +00:00
Cedoor
25267b81dc Merge branch 'chore/website' into refactor/links
Former-commit-id: d7087f83ab
2023-10-30 12:53:07 +00:00
Cedoor
f4c12e34d4 Merge pull request #405 from semaphore-protocol/perf/use-client
`use-client` directive in right components

Former-commit-id: 23af0ad4ed
2023-10-30 12:49:37 +00:00
Cedoor
1656263997 Merge pull request #400 from semaphore-protocol/refactor/image
NextJS `Image` component

Former-commit-id: b77db6c579
2023-10-30 12:48:27 +00:00
cedoor
e2cf110e54 refactor(website): remove nextjs links from the external ones
Former-commit-id: 685909847a
2023-10-30 12:45:30 +00:00
vplasencia
f873d5a234 refactor(website): change image name
Former-commit-id: 41e7a648a4
2023-10-30 13:30:18 +01:00
cedoor
b14bdfd79d perf(website): move use-client to specific component
Former-commit-id: a59cbfe27a
2023-10-30 12:20:53 +00:00
vplasencia
7f92a63ed9 refactor(website): merge branch 'chore/website' into feat/build-page
Former-commit-id: dc0b7e485f
2023-10-30 13:19:12 +01:00
vplasencia
e241bfc00e refactor(website): use nextjs image instead of chakra ui image
Former-commit-id: a5e91d34c9
2023-10-30 13:14:09 +01:00
cedoor
118bbee442 refactor(website): use NextJS links
Former-commit-id: 370369aec2
2023-10-30 12:12:16 +00:00
cedoor
11e9845c89 refactor(website): use nextjs image component
Former-commit-id: 37b3031b17
2023-10-30 11:27:02 +00:00
Cedoor
e3d10acd3f Merge pull request #394 from semaphore-protocol/feat/home-page
Feat/home page

Former-commit-id: 20f118aafe
2023-10-30 10:30:53 +00:00
vplasencia
e3430d79e9 feat(website): add build page
Former-commit-id: 0c06bab619
2023-10-30 11:18:52 +01:00
cedoor
0188e4fd15 refactor(website): use carousel component in home page
Former-commit-id: a64be88aff
2023-10-29 18:09:19 +00:00
cedoor
02d52030d9 refactor(website): create component for carousel
Former-commit-id: 0ba766afa6
2023-10-29 18:08:01 +00:00
cedoor
b78be41001 chore(website): add link to projects page
Former-commit-id: 218b672865
2023-10-29 17:40:45 +00:00
cedoor
18559e159d chore(website): update footer links
Former-commit-id: ecb7e13757
2023-10-29 17:40:20 +00:00
cedoor
079b4970f4 refactor(website): update hero section buttons
Former-commit-id: b67f64af78
2023-10-29 17:34:49 +00:00
cedoor
301a43e386 feat(website): create carousel for projects
#371


Former-commit-id: 31b135c860
2023-10-25 14:00:52 +01:00
cedoor
5ab69011e0 feat(website): add community section
Former-commit-id: 2e0d5830b5
2023-10-24 22:55:06 +01:00
cedoor
12ecec7f27 feat(website): add features section
#371


Former-commit-id: 288b017e35
2023-10-24 17:03:26 +01:00
cedoor
809bc9b5df feat(website): add project section
#371


Former-commit-id: 3dc3f9c66a
2023-10-24 16:17:24 +01:00
cedoor
c3846b2222 feat(website): add hero section
#371


Former-commit-id: 76f3e65765
2023-10-24 15:47:39 +01:00
Cedoor
8bc2b0d94a Merge pull request #391 from semaphore-protocol/feat/website-add-white-card
Add Action Card

Former-commit-id: ad43680c57
2023-10-22 11:52:49 +01:00
vplasencia
27437d91a7 feat(website): add action card
Former-commit-id: 4f54c21f99
2023-10-21 18:10:37 +02:00
Cedoor
566e0b64bc Merge pull request #390 from semaphore-protocol/feat/footer
Website Footer component

Former-commit-id: bb55a62d86
2023-10-20 17:00:14 +01:00
Cedoor
951ed0b408 Merge pull request #389 from semaphore-protocol/feat/navbar
Website Navbar component

Former-commit-id: 2d236566d8
2023-10-20 16:59:44 +01:00
cedoor
d13f75ccc6 refactor(website): move container component to layout
Former-commit-id: ce6242dc48
2023-10-20 16:19:11 +01:00
cedoor
376798a0b9 feat(website): create footer component
Former-commit-id: 026dbdeee0
2023-10-20 16:13:23 +01:00
cedoor
f145d8ac24 refactor(website): add navlink variant to all navbar links
Former-commit-id: 7ca4fb969f
2023-10-20 16:11:21 +01:00
cedoor
bde2d1026a feat(website): create navbar component
Former-commit-id: 09de5d18b5
2023-10-20 12:55:50 +01:00
vplasencia
5e685abddb refactor(website): update video card component
Former-commit-id: fca4d048b9
2023-10-20 13:04:23 +02:00
Cedoor
6b33929595 Merge pull request #388 from semaphore-protocol/feat/website-add-cards
Add website cards

Former-commit-id: 7982c95316
2023-10-20 11:46:44 +01:00
vplasencia
902ef72aeb feat(website): add card components
Former-commit-id: e634cd7d2f
2023-10-20 11:50:00 +02:00
Cedoor
be521730d2 Merge pull request #387 from semaphore-protocol/feat/website-add-more-icons
Add more website icons 

Former-commit-id: 473435966b
2023-10-19 12:38:02 +01:00
vplasencia
fce35830d0 feat(website): add more icons
Former-commit-id: 746b3ab718
2023-10-19 12:20:28 +02:00
Cedoor
8f5f75a3ac Merge pull request #386 from semaphore-protocol/feat/website-add-icons
Add icons

Former-commit-id: cf0a9b11d9
2023-10-18 15:53:32 +01:00
vplasencia
89497dc288 refactor(website): suppress hydration warning
Former-commit-id: b0819117bc
2023-10-18 16:42:32 +02:00
vplasencia
ea2dfc0779 feat(website): add icons
Former-commit-id: 8c85a395fa
2023-10-18 16:39:24 +02:00
Cedoor
0a181c1a9c Merge pull request #385 from semaphore-protocol/fix/type-name
Replace the `FullProof` type with the `SemaphoreProof` type in the packages contracts tests

Former-commit-id: 94259e1865
2023-10-18 13:11:30 +01:00
vplasencia
37ad6e4aa7 fix(contracts): update variable types
Former-commit-id: aed7ab10ff
2023-10-18 13:58:43 +02:00
cedoor
7a574e1d61 chore(website): configure chakra theme
Former-commit-id: 262ef6f846
2023-10-18 12:27:58 +01:00
cedoor
ea13b38b87 chore(website): init next.js project
Former-commit-id: fd8e737384
2023-10-17 23:43:27 +01:00
cedoor
2ec36d4097 chore(proof): update zk-kit groth16 dependency
Former-commit-id: f5637a87b3
2023-10-12 15:54:43 -07:00
cedoor
88c3facbb7 chore: v3.15.0
Former-commit-id: c56577f2d8
2023-10-12 15:53:02 -07:00
cedoor
2fc40bf710 refactor(proof): replace groth16 functions with groth16 pkg
Former-commit-id: dd08ba1198
2023-10-12 15:52:23 -07:00
cedoor
78dcb705c5 chore: v3.14.0
Former-commit-id: 091eb436ae
2023-10-11 19:16:55 -07:00
cedoor
3c75453e69 perf(proof): use cached curve rather than a new one
Former-commit-id: 60dc748fe7
2023-10-11 19:16:23 -07:00
cedoor
e48099b0f1 chore: v3.13.0
Former-commit-id: 36958e019c
2023-10-11 18:55:50 -07:00
cedoor
64e313a541 refactor(proof): move snarkjs code inside proof pkg
Former-commit-id: 40e4769a78
2023-10-11 18:55:22 -07:00
cedoor
662c3b5af4 docs(proof): update readme file
Former-commit-id: c1466d17ae
2023-10-11 13:56:29 -07:00
cedoor
f0ffd47fae chore: v3.12.3
Former-commit-id: b088b71502
2023-10-11 13:51:23 -07:00
cedoor
c636317c2e chore(proof): create 1 proof bundle per env
Former-commit-id: 3bdb5e2585
2023-10-11 13:50:46 -07:00
cedoor
41a2f2f7cb chore: v3.12.2
Former-commit-id: ab4d6e5358
2023-10-11 11:13:28 -07:00
cedoor
c591cc48e9 fix(hardhat): set correct circomlibjs dependency version
Former-commit-id: 8f408e2124
2023-10-11 11:13:08 -07:00
cedoor
b2a33eaf58 chore: v3.12.1
Former-commit-id: 38b2eb9e83
2023-10-11 10:48:48 -07:00
cedoor
8b419a024b chore: update snarkjs and circomlibjs types versions
Former-commit-id: b156568f8e
2023-10-11 10:48:19 -07:00
cedoor
1e53e6fc49 chore: v3.12.0
Former-commit-id: 32b6ac4f14
2023-10-11 09:52:16 -07:00
Cedoor
f9dd755b63 Merge pull request #368 from semaphore-protocol/chore/new-snarkjs-version
New SnarkJS dependency version

Former-commit-id: ac632db341
2023-10-11 11:50:58 -05:00
cedoor
78edf03771 chore(proof): update snarkjs dependency version
Former-commit-id: 395c60259b
2023-10-10 11:38:51 -07:00
Cedoor
70b9bb0ddc Merge pull request #363 from semaphore-protocol/chore/snarkjs-circomlibjs-types
New Snarkjs/Circomlibjs type definitions

Former-commit-id: f212684cf2
2023-09-21 17:50:36 +01:00
cedoor
a6bb9bba73 chore: add snarkjs and circomlibjs type definitions
re #362


Former-commit-id: ebe3628561
2023-09-21 17:40:24 +01:00
Cedoor
8cc9d7feae Merge pull request #349 from aguzmant103/main
Adding Bandada to project list

Former-commit-id: 4280bff004
2023-09-21 17:39:56 +01:00
Cedoor
f72d228e51 Merge branch 'main' into main
Former-commit-id: daf558955b
2023-09-21 17:39:47 +01:00
cedoor
e6d30cdb7a Merge branch 'dev'
Former-commit-id: 715b1f8ac5
2023-09-13 19:23:56 +01:00
Cedoor
841ed4bbd9 Merge pull request #361 from semaphore-protocol/chore/typedoc
New typedoc configuration

Former-commit-id: 437fa9a682
2023-09-13 19:23:26 +01:00
cedoor
437ade277a chore: update lockfile
Former-commit-id: 222153e5a7
2023-09-13 17:59:43 +01:00
cedoor
fb66869a3c chore: update typedoc configuration
re #360


Former-commit-id: 7ac640cda7
2023-09-13 17:53:53 +01:00
cedoor
8afa2252e2 chore: v3.11.1
Former-commit-id: 05704e35c9
2023-09-12 14:59:34 +01:00
Cedoor
7af714bb98 Merge pull request #359 from semaphore-protocol/fix/semaphore-ethers
Check address value before setting it in `SemaphoreEthers` class

Former-commit-id: 91429e01f0
2023-09-12 14:58:15 +01:00
cedoor
c434f8af5b style(data): remove console log
re #358


Former-commit-id: 729764dd1c
2023-09-12 14:57:51 +01:00
cedoor
9fec16129b fix(data): check address value before setting it
fix #358


Former-commit-id: 20f28318d0
2023-09-12 14:33:02 +01:00
Cedoor
482b64d031 Merge pull request #356 from semaphore-protocol/ref/improve-error-messages
Improve error messages

Former-commit-id: e1f66a7d80
2023-09-04 17:56:58 +02:00
vplasencia
7163e6f460 refactor(cli): improve error messages
Former-commit-id: d420484f49
2023-09-04 17:50:59 +02:00
cedoor
5d2e1ca5a3 chore: update pse domain
Former-commit-id: 6f7dd99ddb
2023-09-01 12:48:43 +02:00
aguzmant103
031229939a Adding Bandada to project list
Former-commit-id: 09e062d291
2023-08-22 12:42:32 -06:00
cedoor
9d24c8184a chore: v3.11.0
Former-commit-id: 478e6fa382
2023-08-21 16:24:13 +02:00
cedoor
ae359322e9 test(data): add test for identityCommitment filter
Former-commit-id: 7a07dda628
2023-08-21 16:23:10 +02:00
Cedoor
33998d90f7 Merge pull request #346 from semaphore-protocol/chore/snarkjs-version
New snarkjs version

Former-commit-id: 44acbf806f
2023-08-21 16:13:47 +02:00
Cedoor
d9de7c1033 Merge pull request #347 from semaphore-protocol/refactor/proof-exports
`MerkleProof` type to exports

Former-commit-id: ac555f59a1
2023-08-21 16:13:37 +02:00
cedoor
120f99b416 refactor(proof): add MerkleProof type to exports
re #337


Former-commit-id: 8afa314891
2023-08-21 13:24:16 +02:00
Cedoor
b95cb17135 Merge pull request #338 from wslyvh/main
New filter option to query groups based on identity commitment

Former-commit-id: 7467aac9e7
2023-08-21 13:18:51 +02:00
cedoor
507c252d36 chore(proof): update snarkjs version
re #339


Former-commit-id: 82ad9a543b
2023-08-21 13:17:33 +02:00
wslyvh
82db6a1eb7 feat: add identitycommitment as groups filter
Allow to filter on identity commitments when getting subgraph groups


Former-commit-id: 369257d40b
2023-08-14 10:05:19 +02:00
cedoor
c60ab38882 docs: add new project to readme file
Former-commit-id: 7d26d4e66c
2023-08-02 12:00:53 +02:00
Cedoor
cba5940f36 Merge pull request #336 from semaphore-protocol/docs/add-project
Add StealthComms to the projects file

Former-commit-id: e5bcd18045
2023-08-02 11:57:42 +02:00
vplasencia
110e3de844 docs: change tagline
Former-commit-id: 763663ca3e
2023-08-02 10:47:09 +02:00
vplasencia
f60e85335d docs: fix typo
Former-commit-id: a786f10ba5
2023-08-02 10:40:06 +02:00
vplasencia
ef4cef65cd docs: fix typo
Former-commit-id: 44177ce5b7
2023-08-02 10:35:07 +02:00
vplasencia
f69534683d docs: add a new project to the projects file
Former-commit-id: 8552640cd0
2023-08-02 10:25:25 +02:00
cedoor
4d849b48c2 chore: v3.10.1
Former-commit-id: 41181c63d2
2023-05-17 10:56:59 +01:00
cedoor
531e16e0d7 fix(group): make members bigint types
Former-commit-id: d1d309ac3a
2023-05-17 10:46:40 +01:00
584 changed files with 22851 additions and 7621 deletions

View File

@@ -1,8 +1,10 @@
DEFAULT_NETWORK=hardhat
TREE_DEPTH=20
ALL_SNARK_ARTIFACTS=true
TREE_DEPTH=10
REPORT_GAS=false
BACKEND_PRIVATE_KEY=
INFURA_API_KEY=
COINMARKETCAP_API_KEY=
ETHERSCAN_API_KEY=
DEFENDER_KEY=
DEFENDER_SECRET=
CREATE2_SALT=1234

View File

@@ -22,7 +22,15 @@ circuits
# production
dist
build
docs
/docs
# subgraph
subgraph.template.yaml
generated
# Docusaurus cache and generated files
.docusaurus
.cache-loader
# misc
.DS_Store
@@ -35,3 +43,5 @@ yarn-error.log*
# packages
cli-template-*
!apps/website/src/app/build

View File

@@ -3,7 +3,7 @@
"env": {
"es6": true
},
"extends": ["airbnb-base", "airbnb-typescript/base", "plugin:jest/recommended", "plugin:jest/style", "prettier"],
"extends": ["airbnb", "airbnb-typescript/base", "plugin:jest/recommended", "plugin:jest/style", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
@@ -12,6 +12,12 @@
},
"plugins": ["@typescript-eslint", "jest"],
"rules": {
"react/require-default-props": "off",
"react/jsx-props-no-spreading": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-filename-extension": [1, { "extensions": [".tsx"] }],
"import/prefer-default-export": "off",
"import/extensions": "off",
"no-underscore-dangle": "off",
"import/no-extraneous-dependencies": "off",
"no-bitwise": "off",

View File

@@ -0,0 +1,17 @@
---
name: "♻️ Refactoring"
about: 'about: Suggest any improvements for this project'
title: ''
labels: 'refactoring :recycle:'
assignees: ''
---
**Describe the improvement you're thinking about**
A clear and concise description of what you think could improve the code.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions you've considered.
**Additional context**
Add any other context or screenshots about the improvement request here.

View File

@@ -1,24 +1,40 @@
<!-- Please refer to our contributing documentation for any questions on submitting a pull request -->
<!--- Provide a general summary of your changes in the Title above -->
<!-- Please refer to our CONTRIBUTING documentation for any questions on submitting a pull request. -->
<!-- Provide a general summary of your changes in the Title above. -->
## Description
<!--- Describe your changes in detail -->
<!-- Describe your changes in detail. -->
<!-- You may want to answer some of the following questions: -->
<!-- What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...) -->
<!-- What is the current behavior?** (You can also link to an open issue here) -->
<!-- What is the new behavior (if this is a feature change)? -->
<!-- Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?) -->
## Related Issue
## Related Issue(s)
<!--- This project accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
<!--- Please link to the issue here: -->
<!-- This project accepts pull requests related to open issues. -->
<!-- If suggesting a new feature or change, please discuss it in an issue first. -->
<!-- If fixing a bug, there should be an issue describing it with steps to reproduce. -->
<!-- Please link to the issue(s) here -->
## Does this introduce a breaking change?
- [ ] Yes
- [ ] No
<!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. -->
<!-- Closes # -->
<!-- Fixes # -->
## Other information
<!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. -->
<!-- Feel free to remove this section if you will not use it. -->
## Checklist
<!-- Please check if the PR fulfills these requirements. -->
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have run `yarn prettier` and `yarn lint` without getting any errors
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules

View File

@@ -10,29 +10,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 16.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 20
cache: yarn
- name: Install dependencies
run: yarn
- name: Build libraries
run: yarn build:libraries
- name: Generate doc website
run: yarn docs
@@ -40,7 +31,5 @@ jobs:
uses: crazy-max/ghaction-github-pages@v2.5.0
with:
build_dir: docs
jekyll: false
fqdn: js.semaphore.appliedzkp.org
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -6,33 +6,20 @@ on:
- main
env:
TREE_DEPTH: 20
ALL_SNARK_ARTIFACTS: false
TREE_DEPTH: 10
jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 16.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 20
cache: yarn
- name: Install dependencies
run: yarn
@@ -43,40 +30,60 @@ jobs:
- name: Build libraries
run: yarn build:libraries
- name: Build subgraph
run: yarn build:subgraph
- name: Run Prettier
run: yarn prettier
- name: Run Eslint
run: yarn lint
test-subgraph:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- name: Install dependencies
run: yarn
- name: Build subgraph
run: yarn build:subgraph
- name: Test subgraph
run: yarn test:subgraph
test:
runs-on: ubuntu-latest
strategy:
matrix:
type:
- circuits
- libraries
- contracts
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 20
cache: yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
# https://github.com/iden3/circuits/blob/8fffb6609ecad0b7bcda19bb908bdb544bdb3cf7/.github/workflows/main.yml#L18-L22
- name: Setup Circom deps
run: sudo apt-get update && sudo apt-get install -y wget nlohmann-json3-dev libgmp-dev nasm g++ build-essential
- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Setup Circom
run: wget https://github.com/iden3/circom/releases/latest/download/circom-linux-amd64 && sudo mv ./circom-linux-amd64 /usr/bin/circom && sudo chmod +x /usr/bin/circom
- name: Install dependencies
run: yarn
@@ -84,10 +91,11 @@ jobs:
- name: Build libraries
run: yarn build:libraries
- name: Test contracts and libraries
- name: Test libraries, contracts and circuits
run: yarn test:${{ matrix.type }}
- name: Coveralls
if: matrix.type != 'circuits'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -4,33 +4,20 @@ on:
pull_request:
env:
TREE_DEPTH: 20
ALL_SNARK_ARTIFACTS: false
TREE_DEPTH: 10
jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 16.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 20
cache: yarn
- name: Install dependencies
run: yarn
@@ -41,6 +28,9 @@ jobs:
- name: Build libraries
run: yarn build:libraries
- name: Build subgraph
run: yarn build:subgraph
- name: Run Prettier
run: yarn prettier
@@ -51,25 +41,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 20
cache: yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
# https://github.com/iden3/circuits/blob/8fffb6609ecad0b7bcda19bb908bdb544bdb3cf7/.github/workflows/main.yml#L18-L22
- name: Setup Circom deps
run: sudo apt-get update && sudo apt-get install -y wget nlohmann-json3-dev libgmp-dev nasm g++ build-essential
- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Setup Circom
run: wget https://github.com/iden3/circom/releases/latest/download/circom-linux-amd64 && sudo mv ./circom-linux-amd64 /usr/bin/circom && sudo chmod +x /usr/bin/circom
- name: Install dependencies
run: yarn
@@ -77,5 +62,8 @@ jobs:
- name: Build libraries
run: yarn build:libraries
- name: Test contracts and libraries
- name: Build subgraph
run: yarn build:subgraph
- name: Test contracts, libraries, circuits and subgraph
run: yarn test

View File

@@ -13,27 +13,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 20
cache: yarn
- name: Install dependencies
run: yarn

11
.gitignore vendored
View File

@@ -63,17 +63,16 @@ node_modules/
# Production
build
dist
docs/*
!docs/CNAME
!docs/index.html
/docs
# Docusaurus cache and generated files
.docusaurus
.cache-loader
# Hardhat
artifacts
cache
typechain-types
packages/contracts/deployed-contracts/undefined.json
packages/contracts/deployed-contracts/hardhat.json
packages/contracts/deployed-contracts/localhost.json
# Stores VSCode versions used for testing VSCode extensions
.vscode-test

View File

@@ -12,24 +12,26 @@ coverage.json
artifacts
cache
typechain-types
packages/contracts/deployed-contracts/undefined.json
packages/contracts/deployed-contracts/hardhat.json
packages/contracts/deployed-contracts/localhost.json
# circuits
circuits
# contracts
Verifier*.sol
# production
dist
build
docs
/docs
# subgraph
subgraph.template.yaml
generated
# github
.github/ISSUE_TEMPLATE
# Docusaurus cache and generated files
.docusaurus
.cache-loader
# mdx file
*.mdx
# misc
.DS_Store
*.pem
@@ -44,4 +46,6 @@ snark-artifacts
# Next.js
.next/
public
public
!apps/website/src/app/build

View File

@@ -1 +0,0 @@
87de4f440a77841135f97a187e09140c6d4e6ae2

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
b3cadff6efb37a12712d12c2553ec703dbcaa4dd

View File

@@ -0,0 +1 @@
738adce5914a0e193f2e1255e4dcf7042256a1c1

View File

@@ -1,11 +1,9 @@
checksumBehavior: update
compressionLevel: mixed
enableGlobalCache: false
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"
yarnPath: .yarn/releases/yarn-3.2.1.cjs
yarnPath: .yarn/releases/yarn-4.1.0.cjs

View File

@@ -28,7 +28,7 @@ Pull requests are great if you want to add a feature or fix a bug. Here's a quic
6. Commit your changes.
7. Push to your fork and submit a pull request on our `dev` branch. Please provide us with some explanation of why you made the changes you made. For new features make sure to explain a standard use case to us.
7. Push to your fork and submit a pull request on our `main` branch. Please provide us with some explanation of why you made the changes you made. For new features make sure to explain a standard use case to us.
## CI (Github Actions) Tests
@@ -93,7 +93,6 @@ Just as in the subject, use the imperative, present tense: "change" not "changed
### Branch rules
- There must be a `main` branch, used only for the releases.
- There must be a `dev` branch, used to merge all the branches under it.
- Avoid long descriptive names for long-lived branches.
- Use kebab-case (no CamelCase).
- Use grouping tokens (words) at the beginning of your branch names (in a similar way to the `type` of commit).

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2022 Ethereum Foundation
Copyright (c) 2024 Ethereum Foundation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

186
README.md
View File

@@ -1,11 +1,10 @@
<p align="center">
<h1 align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/semaphore-protocol/website/blob/main/static/img/semaphore-icon-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="https://github.com/semaphore-protocol/website/blob/main/static/img/semaphore-icon.svg">
<img width="40" alt="Semaphore icon." src="https://github.com/semaphore-protocol/website/blob/main/static/img/semaphore-icon.svg">
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/semaphore-protocol/.github/blob/main/assets/semaphore-logo-light.svg">
<source media="(prefers-color-scheme: light)" srcset="https://github.com/semaphore-protocol/.github/blob/main/assets/semaphore-logo-dark.svg">
<img width="250" alt="Semaphore icon" src="https://github.com/semaphore-protocol/.github/blob/main/assets/semaphore-logo-dark.svg">
</picture>
Semaphore
</h1>
</p>
@@ -52,7 +51,7 @@
🔎 Issues
</a>
<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
<a href="https://semaphore.appliedzkp.org/discord">
<a href="https://semaphore.pse.dev/discord">
🗣️ Chat &amp; Support
</a>
</h4>
@@ -61,7 +60,7 @@
| 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. |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
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).
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.pse.dev](https://semaphore.pse.dev).
## 📦 Packages
@@ -70,6 +69,25 @@ The core of the Semaphore protocol is in the [circuit logic](/packages/circuits/
<th>Version</th>
<th>Downloads</th>
<tbody>
<tr>
<td>
<a href="/packages/core">
@semaphore-protocol/core
</a>
</td>
<td>
<!-- NPM version -->
<a href="https://npmjs.org/package/@semaphore-protocol/core">
<img src="https://img.shields.io/npm/v/@semaphore-protocol/core.svg?style=flat-square" alt="NPM version" />
</a>
</td>
<td>
<!-- Downloads -->
<a href="https://npmjs.org/package/@semaphore-protocol/core">
<img src="https://img.shields.io/npm/dm/@semaphore-protocol/core.svg?style=flat-square" alt="Downloads" />
</a>
</td>
</tr>
<tr>
<td>
<a href="/packages/contracts">
@@ -94,7 +112,7 @@ The core of the Semaphore protocol is in the [circuit logic](/packages/circuits/
<a href="/packages/identity">
@semaphore-protocol/identity
</a>
<a href="https://js.semaphore.appliedzkp.org/identity">
<a href="https://js.semaphore.pse.dev/modules/_semaphore_protocol_identity">
(docs)
</a>
</td>
@@ -116,7 +134,7 @@ The core of the Semaphore protocol is in the [circuit logic](/packages/circuits/
<a href="/packages/group">
@semaphore-protocol/group
</a>
<a href="https://js.semaphore.appliedzkp.org/group">
<a href="https://js.semaphore.pse.dev/modules/_semaphore_protocol_group">
(docs)
</a>
</td>
@@ -138,7 +156,7 @@ The core of the Semaphore protocol is in the [circuit logic](/packages/circuits/
<a href="/packages/proof">
@semaphore-protocol/proof
</a>
<a href="https://js.semaphore.appliedzkp.org/proof">
<a href="https://js.semaphore.pse.dev/modules/_semaphore_protocol_proof">
(docs)
</a>
</td>
@@ -160,7 +178,7 @@ The core of the Semaphore protocol is in the [circuit logic](/packages/circuits/
<a href="/packages/data">
@semaphore-protocol/data
</a>
<a href="https://js.semaphore.appliedzkp.org/data">
<a href="https://js.semaphore.pse.dev/modules/_semaphore_protocol_data">
(docs)
</a>
</td>
@@ -215,12 +233,34 @@ The core of the Semaphore protocol is in the [circuit logic](/packages/circuits/
</a>
</td>
</tr>
<tr>
<td>
<a href="/packages/utils">
@semaphore-protocol/utils
</a>
<a href="https://js.semaphore.pse.dev/modules/_semaphore_protocol_utils">
(docs)
</a>
</td>
<td>
<!-- NPM version -->
<a href="https://npmjs.org/package/@semaphore-protocol/utils">
<img src="https://img.shields.io/npm/v/@semaphore-protocol/utils.svg?style=flat-square" alt="NPM version" />
</a>
</td>
<td>
<!-- Downloads -->
<a href="https://npmjs.org/package/@semaphore-protocol/utils">
<img src="https://img.shields.io/npm/dm/@semaphore-protocol/utils.svg?style=flat-square" alt="Downloads" />
</a>
</td>
</tr>
<tr>
<td>
<a href="/packages/heyauthn">
@semaphore-protocol/heyauthn
</a>
<a href="https://js.semaphore.appliedzkp.org/heyauthn">
<a href="https://js.semaphore.pse.dev/modules/_semaphore_protocol_heyauthn">
(docs)
</a>
</td>
@@ -240,130 +280,6 @@ The core of the Semaphore protocol is in the [circuit logic](/packages/circuits/
<tbody>
</table>
## 💡 Projects
The following are some of the internal and external projects that use Semaphore. If you want to include your project, open an [issue](https://github.com/semaphore-protocol/semaphore/issues/new?assignees=&labels=documentation++%F0%9F%93%96&template=----project.md&title=) or create a PR by adding the project information to the `projects.json` file.
<table>
<th>Project</th>
<th>Description</th>
<th>Links</th>
<tbody>
<tr>
<td>
<a href="https://explorer.semaphore.appliedzkp.org">
Semaphore Explorer
</a>
</td>
<td>
Semaphore explorer for on-chain groups.
</td>
<td>
<a href="https://github.com/semaphore-protocol/explorer">
Github
</a>|
<a href="https://semaphore.appliedzkp.org/discord">
Discord
</a>
</td>
</tr>
<tr>
<td>
<a href="https://discord.com/api/oauth2/authorize?client_id=1082429985496772628&permissions=1024&scope=bot">
Semaphore Discord Bot
</a>
</td>
<td>
A Discord bot for Semaphore.
</td>
<td>
<a href="https://github.com/semaphore-protocol/discord-bot">
Github
</a>|
<a href="https://semaphore.appliedzkp.org/discord">
Discord
</a>
</td>
</tr>
<tr>
<td>
<a href="https://developer.unirep.io">
Unirep
</a>
</td>
<td>
Private and nonrepudiable reputation system based on ZKP.
</td>
<td>
<a href="https://github.com/Unirep">
Github
</a>|
<a href="https://discord.gg/VzMMDJmYc5">
Discord
</a>
</td>
</tr>
<tr>
<td>
<a href="https://zk-proof-of-humanity.vercel.app">
ZK Proof of Humanity
</a>
</td>
<td>
A project to allows humans, registered in Proof of Humanity, to prove their humanity without doxing.
</td>
<td>
<a href="https://github.com/elmol/zk-proof-of-humanity">
Github
</a>
</td>
</tr>
<tr>
<td>
Plurality
</td>
<td>
An Identity Lego Building Block for dapp creators that lets them identify their users without</br> using any third-party KYC provider or other middlemen, whilst preserving the privacy of users.
</td>
<td>
<a href="https://github.com/Web3-Plurality">
Github
</a>
</td>
</tr>
<tr>
<td>
<a href="https://zerotherapy.vercel.app">
ZeroTherapy
</a>
</td>
<td>
AMA privacy application built with Semaphore.
</td>
<td>
<a href="https://github.com/Pushpit07/ZeroTherapy">
Github
</a>
</td>
</tr>
<tr>
<td>
<a href="https://bq2.netlify.app/">
Block Qualified
</a>
</td>
<td>
On-chain and privacy preserving education platform built on Semaphore.
</td>
<td>
<a href="https://github.com/0xdeenz/bq2">
Github
</a>
</td>
</tr>
<tbody>
</table>
## 🛠 Install
Clone this repository:

72
apps/docs/README.md Normal file
View File

@@ -0,0 +1,72 @@
<p align="center">
<h1 align="center">
Semaphore Docs
</h1>
<p align="center">The official documentation of Semaphore.</p>
</p>
<p align="center">
<a href="https://github.com/semaphore-protocol" target="_blank">
<img src="https://img.shields.io/badge/project-Semaphore-blue.svg?style=flat-square">
</a>
<a href="https://github.com/semaphore-protocol/semaphore/blob/main/LICENSE">
<img alt="Github license" src="https://img.shields.io/github/license/semaphore-protocol/semaphore.svg?style=flat-square">
</a>
<a href="https://eslint.org/">
<img alt="Linter eslint" src="https://img.shields.io/badge/linter-eslint-8080f2?style=flat-square&logo=eslint" />
</a>
<a href="https://prettier.io/">
<img alt="Code style prettier" src="https://img.shields.io/badge/code%20style-prettier-f8bc45?style=flat-square&logo=prettier" />
</a>
</p>
<div align="center">
<h4>
<a href="https://github.com/semaphore-protocol/semaphore/blob/main/CONTRIBUTING.md">
👥 Contributing
</a>
<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
<a href="https://github.com/semaphore-protocol/semaphore/blob/main/CODE_OF_CONDUCT.md">
🤝 Code of conduct
</a>
<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
<a href="https://github.com/semaphore-protocol/semaphore/contribute">
🔎 Issues
</a>
<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
<a href="https://semaphore.pse.dev/discord">
🗣️ Chat &amp; Support
</a>
</h4>
</div>
| This repository contains the code for the Semaphore documentation published at [docs.semaphore.pse.dev](https://docs.semaphore.pse.dev). It uses Markdown syntax and the [Docusaurus](https://docusaurus.io/) site generator. |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
## 📜 Usage
### Start the website
To generate the HTML and start the site, run:
```sh
yarn start
```
Visit the Semaphore docs site in your browser at [http://localhost:3000](http://localhost:3000).
### Build
```
yarn build
```
The `build` command generates static content into the `build` directory that can be served by any static content hosting service.
### Deploy
```
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
```
If you use GitHub pages for hosting, this command lets you build the website and push to the `gh-pages` branch.

View File

@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve("@docusaurus/core/lib/babel/preset")]
}

View File

@@ -0,0 +1,127 @@
import type * as Preset from "@docusaurus/preset-classic"
import type { Config } from "@docusaurus/types"
import { themes } from "prism-react-renderer"
const lightCodeTheme = themes.oneLight
const darkCodeTheme = themes.oneDark
const config: Config = {
title: "Semaphore",
tagline: "Semaphore documentation and guides.",
url: "https://docs.semaphore.pse.dev/",
baseUrl: "/",
favicon: "/img/favicon.ico",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
organizationName: "semaphore-protocol",
projectName: "semaphore",
trailingSlash: false,
plugins: ["docusaurus-plugin-sass"],
i18n: {
defaultLocale: "en",
locales: ["en", "es"]
},
headTags: [
{
tagName: "link",
attributes: {
rel: "preconnect",
href: "https://psedev.matomo.cloud"
}
},
{
tagName: "script",
innerHTML: `
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://psedev.matomo.cloud/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '10']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src='//cdn.matomo.cloud/psedev.matomo.cloud/matomo.js'; s.parentNode.insertBefore(g,s);
})();
`,
attributes: {}
}
],
presets: [
[
"classic",
{
docs: {
routeBasePath: "/",
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://github.com/semaphore-protocol/semaphore/edit/main/apps/docs",
includeCurrentVersion: false
},
theme: {
customCss: [require.resolve("./src/css/custom.scss")]
}
} satisfies Preset.Options
]
],
themeConfig: {
announcementBar: {
id: "semaphore-v4-beta",
content:
'<b>Semaphore V4-beta is out 🎉 <a href="/V4-beta/getting-started">Try it out</a> and let us know for any feedback on <a href="https://semaphore.pse.dev/discord" target="_blank">Discord</a> or <a href="https://github.com/orgs/semaphore-protocol/discussions" target="_blank">Github</a>!</b>',
backgroundColor: "#dde6fc",
textColor: "#000000"
},
navbar: {
logo: {
alt: "Semaphore Logo",
src: "img/semaphore-logo.svg"
},
items: [
{
type: "docsVersionDropdown",
position: "left",
dropdownActiveClassDisabled: true
},
{
label: "Whitepaper",
to: "https://docs.semaphore.pse.dev/whitepaper-v1.pdf",
position: "left",
className: "whitepaper-v1"
},
{
label: "Github",
href: "https://github.com/semaphore-protocol",
position: "right"
},
{
label: "Website",
href: "https://semaphore.pse.dev",
position: "right"
},
{
type: "localeDropdown",
position: "right"
}
]
},
colorMode: {
defaultMode: "light",
// Should we use the prefers-color-scheme media-query,
// using user system preferences, instead of the hardcoded defaultMode
respectPrefersColorScheme: true
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: ["solidity", "bash", "typescript"]
},
algolia: {
appId: "6P229KVKCB",
apiKey: "879bb5b002b6370f181f0f79f5c2afe2",
indexName: "semaphoreliedzkp",
contextualSearch: true
}
} satisfies Preset.ThemeConfig
}
export default config

397
apps/docs/i18n/en/code.json Normal file
View File

@@ -0,0 +1,397 @@
{
"jumbotron.title": {
"message": "Signal anonymously"
},
"jumbotron.description": {
"message": "Using zero knowledge, Semaphore allows Ethereum users to prove their membership of a group and send signals such as votes or endorsements without revealing their original identity."
},
"quick-setup.button": {
"message": "Quick setup"
},
"boilerplate.button": {
"message": "Boilerplate"
},
"components.description": {
"message": "Building an Ethereum dApp? Semaphore components make it simple to add a privacy layer!"
},
"components.button.solidity": {
"message": "Solidity contract"
},
"components.button.circuits": {
"message": "zkSNARK circuits"
},
"components.button.libraries": {
"message": "JavaScript libraries"
},
"section.identities.title": {
"message": "Semaphore identities"
},
"section.identities.description": {
"message": "Given to all Semaphore group members, it is comprised of three parts: identity commitment, trapdoor, and nullifier."
},
"section.identities.link": {
"message": "Create Semaphore identities"
},
"section.identities.box1.title": {
"message": "Private values"
},
"section.identities.box1.description": {
"message": "Trapdoor and nullifier values are the private values of the Semaphore identity. To avoid fraud, the owner must keep both values secret."
},
"section.identities.box2.title": {
"message": "Public values"
},
"section.identities.box2.description": {
"message": "Semaphore uses the Poseidon hash function to create the identity commitment from the identity private values. Identity commitments can be made public, similarly to Ethereum addresses."
},
"section.identities.box3.title": {
"message": "Generate identities"
},
"section.identities.box3.description": {
"message": "Semaphore identities can be generated deterministically or randomly. Deterministic identities can be generated from the hash of a secret message."
},
"section.groups.title": {
"message": "Semaphore groups"
},
"section.groups.description": {
"message": "Semaphore groups are binary incremental Merkle trees that store the public identity commitment of each member."
},
"section.groups.link": {
"message": "Curate Semaphore groups"
},
"section.groups.box1.title": {
"message": "Merkle trees"
},
"section.groups.box1.description": {
"message": "Each leaf contains an identity commitment for a user. The identity commitment proves that the user is a group member without revealing the private identity of the user."
},
"section.groups.box2.title": {
"message": "Types of groups"
},
"section.groups.box2.description": {
"message": "Groups can be created and managed in a decentralized fashion with Semaphore contracts or off-chain with our JavaScript libraries."
},
"section.groups.box3.title": {
"message": "Group management"
},
"section.groups.box3.description": {
"message": "Users can join and leave groups by themselves, or an admin can add and remove them. Admins can be centralized authorities, Ethereum accounts, multi-sig wallets or smart contracts."
},
"section.proofs.title": {
"message": "Semaphore proofs"
},
"section.proofs.description": {
"message": "Semaphore group members can anonymously prove that they are part of a group and that they are generating their own proofs and signals."
},
"section.proofs.link": {
"message": "Generate Semaphore proofs"
},
"section.proofs.box1.title": {
"message": "Membership"
},
"section.proofs.box1.description": {
"message": "Only users who are part of a group can generate a valid proof for that group."
},
"section.proofs.box2.title": {
"message": "Signals"
},
"section.proofs.box2.description": {
"message": "Group users can anonymously broadcast signals such as votes or endorsements without revealing their original identity."
},
"section.proofs.box3.title": {
"message": "Verifiers"
},
"section.proofs.box3.description": {
"message": "Semaphore proofs can be verified with Semaphore contracts on-chain or with our JavaScript libraries off-chain."
},
"theme.ErrorPageContent.title": {
"message": "This page crashed.",
"description": "The title of the fallback page when the page crashed"
},
"theme.ErrorPageContent.tryAgain": {
"message": "Try again",
"description": "The label of the button to try again when the page crashed"
},
"theme.NotFound.title": {
"message": "Page Not Found",
"description": "The title of the 404 page"
},
"theme.NotFound.p1": {
"message": "We could not find what you were looking for.",
"description": "The first paragraph of the 404 page"
},
"theme.NotFound.p2": {
"message": "Please contact the owner of the site that linked you to the original URL and let them know their link is broken.",
"description": "The 2nd paragraph of the 404 page"
},
"theme.admonition.note": {
"message": "note",
"description": "The default label used for the Note admonition (:::note)"
},
"theme.admonition.tip": {
"message": "tip",
"description": "The default label used for the Tip admonition (:::tip)"
},
"theme.admonition.danger": {
"message": "danger",
"description": "The default label used for the Danger admonition (:::danger)"
},
"theme.admonition.info": {
"message": "info",
"description": "The default label used for the Info admonition (:::info)"
},
"theme.admonition.caution": {
"message": "caution",
"description": "The default label used for the Caution admonition (:::caution)"
},
"theme.BackToTopButton.buttonAriaLabel": {
"message": "Scroll back to top",
"description": "The ARIA label for the back to top button"
},
"theme.blog.archive.title": {
"message": "Archive",
"description": "The page & hero title of the blog archive page"
},
"theme.blog.archive.description": {
"message": "Archive",
"description": "The page & hero description of the blog archive page"
},
"theme.blog.paginator.navAriaLabel": {
"message": "Blog list page navigation",
"description": "The ARIA label for the blog pagination"
},
"theme.blog.paginator.newerEntries": {
"message": "Newer Entries",
"description": "The label used to navigate to the newer blog posts page (previous page)"
},
"theme.blog.paginator.olderEntries": {
"message": "Older Entries",
"description": "The label used to navigate to the older blog posts page (next page)"
},
"theme.blog.post.paginator.navAriaLabel": {
"message": "Blog post page navigation",
"description": "The ARIA label for the blog posts pagination"
},
"theme.blog.post.paginator.newerPost": {
"message": "Newer Post",
"description": "The blog post button label to navigate to the newer/previous post"
},
"theme.blog.post.paginator.olderPost": {
"message": "Older Post",
"description": "The blog post button label to navigate to the older/next post"
},
"theme.blog.post.plurals": {
"message": "One post|{count} posts",
"description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.blog.tagTitle": {
"message": "{nPosts} tagged with \"{tagName}\"",
"description": "The title of the page for a blog tag"
},
"theme.tags.tagsPageLink": {
"message": "View All Tags",
"description": "The label of the link targeting the tag list page"
},
"theme.colorToggle.ariaLabel": {
"message": "Switch between dark and light mode (currently {mode})",
"description": "The ARIA label for the navbar color mode toggle"
},
"theme.colorToggle.ariaLabel.mode.dark": {
"message": "dark mode",
"description": "The name for the dark color mode"
},
"theme.colorToggle.ariaLabel.mode.light": {
"message": "light mode",
"description": "The name for the light color mode"
},
"theme.docs.breadcrumbs.home": {
"message": "Home page",
"description": "The ARIA label for the home page in the breadcrumbs"
},
"theme.docs.breadcrumbs.navAriaLabel": {
"message": "Breadcrumbs",
"description": "The ARIA label for the breadcrumbs"
},
"theme.docs.DocCard.categoryDescription": {
"message": "{count} items",
"description": "The default description for a category card in the generated index about how many items this category includes"
},
"theme.docs.paginator.navAriaLabel": {
"message": "Docs pages navigation",
"description": "The ARIA label for the docs pagination"
},
"theme.docs.paginator.previous": {
"message": "Previous",
"description": "The label used to navigate to the previous doc"
},
"theme.docs.paginator.next": {
"message": "Next",
"description": "The label used to navigate to the next doc"
},
"theme.docs.tagDocListPageTitle.nDocsTagged": {
"message": "One doc tagged|{count} docs tagged",
"description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.docs.tagDocListPageTitle": {
"message": "{nDocsTagged} with \"{tagName}\"",
"description": "The title of the page for a docs tag"
},
"theme.docs.versionBadge.label": {
"message": "Version: {versionLabel}"
},
"theme.docs.versions.unreleasedVersionLabel": {
"message": "This is unreleased documentation for {siteTitle} {versionLabel} version.",
"description": "The label used to tell the user that he's browsing an unreleased doc version"
},
"theme.docs.versions.unmaintainedVersionLabel": {
"message": "This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.",
"description": "The label used to tell the user that he's browsing an unmaintained doc version"
},
"theme.docs.versions.latestVersionSuggestionLabel": {
"message": "For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).",
"description": "The label used to tell the user to check the latest version"
},
"theme.docs.versions.latestVersionLinkLabel": {
"message": "latest version",
"description": "The label used for the latest version suggestion link label"
},
"theme.common.editThisPage": {
"message": "Edit this page",
"description": "The link label to edit the current page"
},
"theme.common.headingLinkTitle": {
"message": "Direct link to heading",
"description": "Title for link to heading"
},
"theme.lastUpdated.atDate": {
"message": " on {date}",
"description": "The words used to describe on which date a page has been last updated"
},
"theme.lastUpdated.byUser": {
"message": " by {user}",
"description": "The words used to describe by who the page has been last updated"
},
"theme.lastUpdated.lastUpdatedAtBy": {
"message": "Last updated{atDate}{byUser}",
"description": "The sentence used to display when a page has been last updated, and by who"
},
"theme.navbar.mobileVersionsDropdown.label": {
"message": "Versions",
"description": "The label for the navbar versions dropdown on mobile view"
},
"theme.tags.tagsListLabel": {
"message": "Tags:",
"description": "The label alongside a tag list"
},
"theme.AnnouncementBar.closeButtonAriaLabel": {
"message": "Close",
"description": "The ARIA label for close button of announcement bar"
},
"theme.blog.sidebar.navAriaLabel": {
"message": "Blog recent posts navigation",
"description": "The ARIA label for recent posts in the blog sidebar"
},
"theme.CodeBlock.copied": {
"message": "Copied",
"description": "The copied button label on code blocks"
},
"theme.CodeBlock.copyButtonAriaLabel": {
"message": "Copy code to clipboard",
"description": "The ARIA label for copy code blocks button"
},
"theme.CodeBlock.copy": {
"message": "Copy",
"description": "The copy button label on code blocks"
},
"theme.CodeBlock.wordWrapToggle": {
"message": "Toggle word wrap",
"description": "The title attribute for toggle word wrapping button of code block lines"
},
"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": {
"message": "Toggle the collapsible sidebar category '{label}'",
"description": "The ARIA label to toggle the collapsible sidebar category"
},
"theme.navbar.mobileLanguageDropdown.label": {
"message": "Languages",
"description": "The label for the mobile language switcher dropdown"
},
"theme.TOCCollapsible.toggleButtonLabel": {
"message": "On this page",
"description": "The label used by the button on the collapsible TOC component"
},
"theme.blog.post.readMore": {
"message": "Read More",
"description": "The label used in blog post item excerpts to link to full blog posts"
},
"theme.blog.post.readMoreLabel": {
"message": "Read more about {title}",
"description": "The ARIA label for the link to full blog posts from excerpts"
},
"theme.blog.post.readingTime.plurals": {
"message": "One min read|{readingTime} min read",
"description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.docs.sidebar.collapseButtonTitle": {
"message": "Collapse sidebar",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.sidebar.collapseButtonAriaLabel": {
"message": "Collapse sidebar",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.sidebar.closeSidebarButtonAriaLabel": {
"message": "Close navigation bar",
"description": "The ARIA label for close button of mobile sidebar"
},
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": {
"message": "← Back to main menu",
"description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"
},
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
"message": "Toggle navigation bar",
"description": "The ARIA label for hamburger menu button of mobile navigation"
},
"theme.docs.sidebar.expandButtonTitle": {
"message": "Expand sidebar",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.docs.sidebar.expandButtonAriaLabel": {
"message": "Expand sidebar",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.common.skipToMainContent": {
"message": "Skip to main content",
"description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation"
},
"theme.tags.tagsPageTitle": {
"message": "Tags",
"description": "The title of the tag list page"
},
"footer.left.title": {
"message": "About"
},
"footer.left.description": {
"message": "Semaphore is part of Privacy & Scaling Explorations (PSE), a multidisciplinary team supported by the Ethereum Foundation. PSE explores new use cases for zero knowledge proofs and other cryptographic primitives."
},
"footer.right.learn.title": {
"message": "Learn"
},
"footer.right.learn.link1": {
"message": "Github"
},
"footer.right.learn.link2": {
"message": "Docs"
},
"footer.right.connect.title": {
"message": "Connect"
},
"footer.right.connect.link1": {
"message": "Discord"
},
"footer.right.connect.link2": {
"message": "X (Twitter)"
},
"footer.copyright": {
"message": "Copyright © 2024 Ethereum Foundation"
}
}

View File

@@ -0,0 +1,6 @@
{
"version.label": {
"message": "V1",
"description": "The label for version V1"
}
}

View File

@@ -0,0 +1,18 @@
{
"version.label": {
"message": "V2",
"description": "The label for version V2"
},
"sidebar.mySidebar.category.Guides": {
"message": "Guides",
"description": "The label for category Guides in sidebar mySidebar"
},
"sidebar.mySidebar.category.Use cases": {
"message": "Use cases",
"description": "The label for category Use cases in sidebar mySidebar"
},
"sidebar.mySidebar.category.Technical reference": {
"message": "Technical reference",
"description": "The label for category Technical reference in sidebar mySidebar"
}
}

View File

@@ -0,0 +1,14 @@
{
"version.label": {
"message": "V3",
"description": "The label for version V3"
},
"sidebar.mySidebar.category.Guides": {
"message": "Guides",
"description": "The label for category Guides in sidebar mySidebar"
},
"sidebar.mySidebar.category.Technical reference": {
"message": "Technical reference",
"description": "The label for category Technical reference in sidebar mySidebar"
}
}

View File

@@ -0,0 +1,11 @@
{
"item.label.Whitepaper": {
"message": "Whitepaper"
},
"item.label.Documentation": {
"message": "Documentation"
},
"item.label.Github": {
"message": "Github"
}
}

397
apps/docs/i18n/es/code.json Normal file
View File

@@ -0,0 +1,397 @@
{
"jumbotron.title": {
"message": "Señaliza de forma anónima"
},
"jumbotron.description": {
"message": "Utilizando zero knowledge (conocimiento cero), Semaphore permite a los usuarios de Ethereum demostrar su membresía en un grupo y enviar señales como votos o reconocimientos sin revelar su identidad original."
},
"quick-setup.button": {
"message": "Configuración rápida"
},
"boilerplate.button": {
"message": "Boilerplate"
},
"components.description": {
"message": "¿Está desarrollando una dApp en Ethereum? ¡Los componentes Semaphore permiten agregar una capa de privacidad de forma sencilla!"
},
"components.button.solidity": {
"message": "Contrato en Solidity"
},
"components.button.circuits": {
"message": "Circuitos zkSNARK"
},
"components.button.libraries": {
"message": "Librerías JavaScript"
},
"section.identities.title": {
"message": "Identidades Semaphore"
},
"section.identities.description": {
"message": "Otorgada a todos los miembros de un grupo Semaphore, está compuesta por tres partes: identity commitment (compromiso de identidad), trapdoor, y nullifier."
},
"section.identities.link": {
"message": "Crear identidades Semaphore"
},
"section.identities.box1.title": {
"message": "Valores privados"
},
"section.identities.box1.description": {
"message": "Los valores trapdoor y nullifier son los valores privados de una identidad Semaphore. Para evitar fraude, la persona dueña debe mantener ambos valores en secreto."
},
"section.identities.box2.title": {
"message": "Valores públicos"
},
"section.identities.box2.description": {
"message": "Semaphore utiliza la función hash Poseidon para crear el identtity commitment a partir de los valores privados. Los identity commitments se pueden compartir públicamente, de forma similar a las direcciones Ethereum."
},
"section.identities.box3.title": {
"message": "Generar identidades"
},
"section.identities.box3.description": {
"message": "Las identidades Semaphore pueden generarse de forma determinística o aleatoria. Las identidades determinísticas se pueden generar a partir del hash de un mensaje secreto."
},
"section.groups.title": {
"message": "Grupos Semaphore"
},
"section.groups.description": {
"message": "Los grupos Semaphore son árboles de Merkle binarios e incrementales que almacenan el identity commitment público de cada miembro."
},
"section.groups.link": {
"message": "Curaduría de grupos Semaphore"
},
"section.groups.box1.title": {
"message": "Árboles de Merkle"
},
"section.groups.box1.description": {
"message": "Cada hoja contiene el identity commitment de un usuario. El identity commitment demuestra que el usuario es miembro de un grupo sin revelar la identidad privada del usuario."
},
"section.groups.box2.title": {
"message": "Tipos de grupos"
},
"section.groups.box2.description": {
"message": "Los grupos pueden crearse y administrarse de forma descentralizada con contratos Semaphore o off-chain (fuera de la cadena) con nuestras librerías en JavaScript."
},
"section.groups.box3.title": {
"message": "Administración de grupos"
},
"section.groups.box3.description": {
"message": "Los usuarios pueden unirse y abandonar un grupo por si solos, o un administrador puede agregarles o removerles. Los administradores pueden ser autoridades centralizadas, cuentas Ethereum, carteras multi-sig o smart contracts (contratos inteligentes)."
},
"section.proofs.title": {
"message": "Pruebas Semaphore"
},
"section.proofs.description": {
"message": "Los miembros de un grupo Semaphore pueden demostrar de forma anónima que pertenecen a un grupo y que ellos están generando sus propias pruebas y señales."
},
"section.proofs.link": {
"message": "Generar pruebas Semaphore"
},
"section.proofs.box1.title": {
"message": "Membresía"
},
"section.proofs.box1.description": {
"message": "Únicamente los usuarios que forman parte de un grupo pueden generar una prueba válida para ese grupo."
},
"section.proofs.box2.title": {
"message": "Señales"
},
"section.proofs.box2.description": {
"message": "Los usuarios del grupo pueden transmitir señales anónimamente, como votos o reconocimientos, sin revelar su identidad original."
},
"section.proofs.box3.title": {
"message": "Verificadores"
},
"section.proofs.box3.description": {
"message": "Las pruebas Semaphore pueden verificarse on-chain (dentro de la cadena) con contratos en Solidity o off-chain con nuestras librerías en JavaScript."
},
"theme.ErrorPageContent.title": {
"message": "Esta página no está funcionando.",
"description": "The title of the fallback page when the page crashed"
},
"theme.ErrorPageContent.tryAgain": {
"message": "Intente de nuevo",
"description": "The label of the button to try again when the page crashed"
},
"theme.NotFound.title": {
"message": "Página No Encontrada",
"description": "The title of the 404 page"
},
"theme.NotFound.p1": {
"message": "No pudimos encontrar lo que buscaba.",
"description": "The first paragraph of the 404 page"
},
"theme.NotFound.p2": {
"message": "Comuníquese con el dueño del sitio que lo vinculó a la URL original y hágale saber que su vínculo está roto.",
"description": "The 2nd paragraph of the 404 page"
},
"theme.admonition.note": {
"message": "nota",
"description": "The default label used for the Note admonition (:::note)"
},
"theme.admonition.tip": {
"message": "tip",
"description": "The default label used for the Tip admonition (:::tip)"
},
"theme.admonition.danger": {
"message": "peligro",
"description": "The default label used for the Danger admonition (:::danger)"
},
"theme.admonition.info": {
"message": "información",
"description": "The default label used for the Info admonition (:::info)"
},
"theme.admonition.caution": {
"message": "precaución",
"description": "The default label used for the Caution admonition (:::caution)"
},
"theme.BackToTopButton.buttonAriaLabel": {
"message": "Volver al principio",
"description": "The ARIA label for the back to top button"
},
"theme.blog.archive.title": {
"message": "Archivo",
"description": "The page & hero title of the blog archive page"
},
"theme.blog.archive.description": {
"message": "Archivo",
"description": "The page & hero description of the blog archive page"
},
"theme.blog.paginator.navAriaLabel": {
"message": "Navegación por la página de la lista de blogs ",
"description": "The ARIA label for the blog pagination"
},
"theme.blog.paginator.newerEntries": {
"message": "Entradas más recientes",
"description": "The label used to navigate to the newer blog posts page (previous page)"
},
"theme.blog.paginator.olderEntries": {
"message": "Entradas más antiguas",
"description": "The label used to navigate to the older blog posts page (next page)"
},
"theme.blog.post.paginator.navAriaLabel": {
"message": "Barra de paginación de publicaciones del blog",
"description": "The ARIA label for the blog posts pagination"
},
"theme.blog.post.paginator.newerPost": {
"message": "Publicación más reciente",
"description": "The blog post button label to navigate to the newer/previous post"
},
"theme.blog.post.paginator.olderPost": {
"message": "Publicación más antigua",
"description": "The blog post button label to navigate to the older/next post"
},
"theme.blog.post.plurals": {
"message": "Una publicación|{count} publicaciones",
"description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.blog.tagTitle": {
"message": "{nPosts} etiquetados con \"{tagName}\"",
"description": "The title of the page for a blog tag"
},
"theme.tags.tagsPageLink": {
"message": "Ver todas las etiquetas",
"description": "The label of the link targeting the tag list page"
},
"theme.colorToggle.ariaLabel": {
"message": "Cambiar entre el modo día y noche (actualmente en {mode})",
"description": "The ARIA label for the navbar color mode toggle"
},
"theme.colorToggle.ariaLabel.mode.dark": {
"message": "modo noche",
"description": "The name for the dark color mode"
},
"theme.colorToggle.ariaLabel.mode.light": {
"message": "modo día",
"description": "The name for the light color mode"
},
"theme.docs.breadcrumbs.home": {
"message": "Página de inicio",
"description": "The ARIA label for the home page in the breadcrumbs"
},
"theme.docs.breadcrumbs.navAriaLabel": {
"message": "Breadcrumbs",
"description": "The ARIA label for the breadcrumbs"
},
"theme.docs.DocCard.categoryDescription": {
"message": "{count} items",
"description": "The default description for a category card in the generated index about how many items this category includes"
},
"theme.docs.paginator.navAriaLabel": {
"message": "Navegación de páginas de documentos",
"description": "The ARIA label for the docs pagination"
},
"theme.docs.paginator.previous": {
"message": "Anterior",
"description": "The label used to navigate to the previous doc"
},
"theme.docs.paginator.next": {
"message": "Siguiente",
"description": "The label used to navigate to the next doc"
},
"theme.docs.tagDocListPageTitle.nDocsTagged": {
"message": "Un documento etiquetado|{count} documentos etiquetados",
"description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.docs.tagDocListPageTitle": {
"message": "{nDocsTagged} con \"{tagName}\"",
"description": "The title of the page for a docs tag"
},
"theme.docs.versionBadge.label": {
"message": "Versión: {versionLabel}"
},
"theme.docs.versions.unreleasedVersionLabel": {
"message": "Esta es documentación sin liberar para {siteTitle} {versionLabel} versión.",
"description": "The label used to tell the user that he's browsing an unreleased doc version"
},
"theme.docs.versions.unmaintainedVersionLabel": {
"message": "Esta es documentación para {siteTitle} {versionLabel}, que ya no se mantiene activamente.",
"description": "The label used to tell the user that he's browsing an unmaintained doc version"
},
"theme.docs.versions.latestVersionSuggestionLabel": {
"message": "Para la documentación actualizada, vea {latestVersionLink} ({versionLabel}).",
"description": "The label used to tell the user to check the latest version"
},
"theme.docs.versions.latestVersionLinkLabel": {
"message": "última versión",
"description": "The label used for the latest version suggestion link label"
},
"theme.common.editThisPage": {
"message": "Editar esta página",
"description": "The link label to edit the current page"
},
"theme.common.headingLinkTitle": {
"message": "Enlace directo al encabezado",
"description": "Title for link to heading"
},
"theme.lastUpdated.atDate": {
"message": " en {date}",
"description": "The words used to describe on which date a page has been last updated"
},
"theme.lastUpdated.byUser": {
"message": " por {user}",
"description": "The words used to describe by who the page has been last updated"
},
"theme.lastUpdated.lastUpdatedAtBy": {
"message": "Última actualización{atDate}{byUser}",
"description": "The sentence used to display when a page has been last updated, and by who"
},
"theme.navbar.mobileVersionsDropdown.label": {
"message": "Versiones",
"description": "The label for the navbar versions dropdown on mobile view"
},
"theme.tags.tagsListLabel": {
"message": "Etiquetas:",
"description": "The label alongside a tag list"
},
"theme.AnnouncementBar.closeButtonAriaLabel": {
"message": "Cerrar",
"description": "The ARIA label for close button of announcement bar"
},
"theme.blog.sidebar.navAriaLabel": {
"message": "Navegación de publicaciones recientes",
"description": "The ARIA label for recent posts in the blog sidebar"
},
"theme.CodeBlock.copied": {
"message": "Copiado",
"description": "The copied button label on code blocks"
},
"theme.CodeBlock.copyButtonAriaLabel": {
"message": "Copiar código al portapapeles",
"description": "The ARIA label for copy code blocks button"
},
"theme.CodeBlock.copy": {
"message": "Copiar",
"description": "The copy button label on code blocks"
},
"theme.CodeBlock.wordWrapToggle": {
"message": "Toggle word wrap",
"description": "The title attribute for toggle word wrapping button of code block lines"
},
"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": {
"message": "Toggle the collapsible sidebar category '{label}'",
"description": "The ARIA label to toggle the collapsible sidebar category"
},
"theme.navbar.mobileLanguageDropdown.label": {
"message": "Idiomas",
"description": "The label for the mobile language switcher dropdown"
},
"theme.TOCCollapsible.toggleButtonLabel": {
"message": "En esta página",
"description": "The label used by the button on the collapsible TOC component"
},
"theme.blog.post.readMore": {
"message": "Leer Más",
"description": "The label used in blog post item excerpts to link to full blog posts"
},
"theme.blog.post.readMoreLabel": {
"message": "Lea más de {title}",
"description": "The ARIA label for the link to full blog posts from excerpts"
},
"theme.blog.post.readingTime.plurals": {
"message": "Lectura de un minuto|{readingTime} min de lectura",
"description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.docs.sidebar.collapseButtonTitle": {
"message": "Colapsar barra lateral",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.sidebar.collapseButtonAriaLabel": {
"message": "Colapsar barra lateral",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.sidebar.closeSidebarButtonAriaLabel": {
"message": "Cerrar la barra de navegación",
"description": "The ARIA label for close button of mobile sidebar"
},
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": {
"message": "← Volver al menú principal",
"description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"
},
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
"message": "Alternar la barra de navegación",
"description": "The ARIA label for hamburger menu button of mobile navigation"
},
"theme.docs.sidebar.expandButtonTitle": {
"message": "Expandir barra lateral",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.docs.sidebar.expandButtonAriaLabel": {
"message": "Expandir barra lateral",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.common.skipToMainContent": {
"message": "Saltar al contenido principal",
"description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation"
},
"theme.tags.tagsPageTitle": {
"message": "Etiquetas",
"description": "The title of the tag list page"
},
"footer.left.title": {
"message": "Acerca de"
},
"footer.left.description": {
"message": "Semaphore es parte de Privacy & Scaling Explorations (PSE), un equipo multidisciplinario apoyado por la Fundación Ethereum. PSE explora nuevos casos de uso para pruebas de conocimiento cero (ZKPs) y otras bases criptográficas."
},
"footer.right.learn.title": {
"message": "Aprender"
},
"footer.right.learn.link1": {
"message": "Github"
},
"footer.right.learn.link2": {
"message": "Docs"
},
"footer.right.connect.title": {
"message": "Conecta con nosotros"
},
"footer.right.connect.link1": {
"message": "Discord"
},
"footer.right.connect.link2": {
"message": "X (Twitter)"
},
"footer.copyright": {
"message": "Copyright © 2024 Ethereum Foundation"
}
}

View File

@@ -0,0 +1,6 @@
{
"version.label": {
"message": "V1",
"description": "The label for version V1"
}
}

View File

@@ -0,0 +1,17 @@
---
sidebar_position: 8
---
# Security audit
The [Ethereum Foundation](https://ethereum.org/) and [POA
Network](https://www.poa.network/) commissioned [ABDK
Consulting](https://www.abdk.consulting) to audit the source code of Semaphore
as well as relevant circuits in
[circomlib](https://github.com/iden3/circomlib), which contains components
which the Semaphore zk-SNARK uses.
The summary of the audit results can be found
[here](https://github.com/appliedzkp/semaphore/tree/master/audit). After three
rounds of fixes, all security and performance issues were fixed, and the few
remaining issues are minor and do not affect security.

View File

@@ -0,0 +1,105 @@
---
sidebar_position: 5
---
# Contract API
## Constructor
**Contract ABI**:
`constructor(uint8 _treeLevels, uint232 _firstExternalNullifier)`
- `_treeLevels`: The depth of the identity tree.
- `_firstExternalNullifier`: The first identity nullifier to add.
The depth of the identity tree determines how many identity commitments may be
added to this contract: `2 ^ _treeLevels`. Once the tree is full, further
insertions will fail with the revert reason `IncrementalMerkleTree: tree is full`.
The first external nullifier will be added as an external nullifier to the
contract, and this external nullifier will be active once the deployment
completes.
## Add, deactivate, or reactivate external nullifiiers
**Contract ABI**:
`addExternalNullifier(uint232 _externalNullifier)`
Adds an external nullifier to the contract. Only the owner can do this.
This external nullifier is active once it is added.
- `_externalNullifier`: The new external nullifier to set.
`deactivateExternalNullifier(uint232 _externalNullifier)`
- `_externalNullifier`: The existing external nullifier to deactivate.
Deactivate an external nullifier. The external nullifier must already be active
for this function to work. Only the owner can do this.
`reactivateExternalNullifier(uint232 _externalNullifier)`
Reactivate an external nullifier. The external nullifier must already be
inactive for this function to work. Only the owner can do this.
- `_externalNullifier`: The deactivated external nullifier to reactivate.
## Insert identities
**Contract ABI**:
`function insertIdentity(uint256 _identityCommitment)`
- `_identity_commitment`: The user's identity commitment, which is the hash of
their public key and their identity nullifier (a random 31-byte value). It
should be the output of a Pedersen hash. It is the responsibility of the
caller to verify this.
**Off-chain `libsemaphore` helper functions**:
Use `genIdentity()` to generate an `Identity` object, and
`genIdentityCommitment(identity: Identity)` to generate the
`_identityCommitment` value to pass to the contract.
To convert `identity` to a string and back, so that you can store it in a
database or somewhere safe, use `serialiseIdentity()` and
`unSerialiseIdentity()`.
See the [Usage section on inserting
identities](./usage#insert-identities) for more information.
## Broadcast signals
**Contract ABI**:
```
broadcastSignal(
bytes memory _signal,
uint256[8] memory _proof,
uint256 _root,
uint256 _nullifiersHash,
uint232 _externalNullifier
)
```
- `_signal`: the signal to broadcast.
- `_proof`: a zk-SNARK proof (see below).
- `_root`: The root of the identity tree, where the user's identity commitment
is the last-inserted leaf.
- `_nullifiersHash`: A uniquely derived hash of the external nullifier, user's
identity nullifier, and the Merkle path index to their identity commitment.
It ensures that a user cannot broadcast a signal with the same external
nullifier more than once.
- `_externalNullifier`: The external nullifier at which the signal is
broadcast.
**Off-chain `libsemaphore` helper functions**:
Use `libsemaphore`'s `genWitness()`, `genProof()`, `genPublicSignals()` and
finally `genBroadcastSignalParams()` to generate the parameters to the
contract's `broadcastSignal()` function.
See the [Usage section on broadcasting
signals](./usage#broadcast-signals) for more information.

View File

@@ -0,0 +1,33 @@
---
sidebar_position: 9
---
# Credits
- Barry WhiteHat
- Chih Cheng Liang
- Kobi Gurkan
- Koh Wei Jie
- Harry Roberts
Many thanks to:
- ABDK Consulting
- Jordi Baylina / iden3
- POA Network
- PepperSec
- Ethereum Foundation
# Resources
[To Mixers and Beyond: presenting Semaphore, a privacy gadget built on Ethereum](https://medium.com/coinmonks/to-mixers-and-beyond-presenting-semaphore-a-privacy-gadget-built-on-ethereum-4c8b00857c9b) - Koh Wei Jie
[Privacy in Ethereum](https://www.youtube.com/watch?v=maDHYyj30kg) - Barry WhiteHat at the Taipei Ethereum Meetup
[Snarks for mixing, signaling and scaling by](https://www.youtube.com/watch?v=lv6iK9qezBY) - Barry WhiteHat at Devcon 4
[Privacy in Ethereum](https://www.youtube.com/watch?v=zBUo7G95wYE) - Barry WhiteHat at Devcon 5
[A trustless Ethereum mixer using zero-knowledge signalling](https://www.youtube.com/watch?v=GzVT16lFOHU) - Koh Wei Jie and Barry WhiteHat at Devcon 5
[Hands-on Applications of Zero-Knowledge Signalling](https://www.youtube.com/watch?v=7wd2aAN2jXI) - Koh Wei Jie at Devcon 5

View File

@@ -0,0 +1,137 @@
---
sidebar_position: 2
---
# How it works
## Inserting identities
An identity is comprised of the following information:
1. An [EdDSA](https://en.wikipedia.org/wiki/EdDSA) private key. Note that it is
_not_ an Ethereum private key.
2. An identity nullifier, whih is a random 32-byte value.
3. An identity trapdoor, whih is a random 32-byte value.
An identity commitment is the Pedersen hash of:
1. The public key associated with the identity's private key.
2. The identity nullifier.
3. The identity trapdoor.
To register an identity, the user must insert their identity commitment into
Semaphore's identity tree. They can do this by calling the Semaphore contract's
`insertIdentity(uint256 _identityCommitment)` function. See the [API
reference](./contract-api) for more information.
## Broadcasting signals
To broadcast a signal, the user must invoke this Semaphore contract function:
```
broadcastSignal(
bytes memory _signal,
uint256[8] memory _proof,
uint256 _root,
uint256 _nullifiersHash,
uint232 _externalNullifier
)
```
- `_signal`: the signal to broadcast.
- `_proof`: a zk-SNARK proof (see below).
- `_root`: The root of the identity tree, where the user's identity commitment
is the last-inserted leaf.
- `_nullifiersHash`: A uniquely derived hash of the external nullifier, user's
identity nullifier, and the Merkle path index to their identity commitment.
It ensures that a user cannot broadcast a signal with the same external
nullifier more than once.
- `_externalNullifier`: The external nullifier at which the signal is
broadcast.
To zk-SNARK proof must satisfy the constraints created by Semaphore's zk-SNARK
circuit as described below:
### The zk-SNARK circuit
The
[semaphore-base.circom](https://github.com/appliedzkp/semaphore/blob/master/circuits/circom/semaphore-base.circom)
circuit helps to prove the following:
### That the identity commitment exists in the Merkle tree
**Private inputs:**
- `identity_pk`: the user's EdDSA public key
- `identity_nullifier`: a random 32-byte value which the user should save
- `identity_trapdoor`: a random 32-byte value which the user should save
- `identity_path_elements`: the values along the Merkle path to the
user's identity commitment
- `identity_path_index[n_levels]`: the direction (left/right) per tree level
corresponding to the Merkle path to the user's identity commitment
**Public inputs:**
- `root`: The Merkle root of the identity tree
**Procedure:**
The circuit hashes the public key, identity nullifier, and identity trapdoor to
generate an **identity commitment**. It then verifies the Merkle proof against
the Merkle root and the identity commitment.
### That the signal was only broadcasted once
**Private inputs:**
- `identity_nullifier`: as above
- `identity_path_index`: as above
**Public inputs:**
- `external_nullifier`: the 29-byte external nullifier - see above
- `nullifiers_hash`: the hash of the identity nullifier, external nullifier,
and Merkle path index (`identity_path_index`)
**Procedure:**
The circuit hashes the given identity nullifier, external nullifier, and Merkle
path index, and checks that it matches the given nullifiers hash. Additionally,
the smart contract ensures that it has not previously seen this nullifiers
hash. This way, double-signalling is impossible.
### That the signal was truly broadcasted by the user who generated the proof
**Private inputs:**
- `identity_pk`: as above
- `auth_sig_r`: the `r` value of the signature of the signal
- `auth_sig_s`: the `s` value of the signature of the signal
**Public inputs:**
- `signal_hash`: the hash of the signal
- `external_nullifier`: the 29-byte external nullifier - see above
**Procedure:**
The circuit hashes the signal hash and the external nullifier, and verifies
this output against the given public key and signature. This ensures the
authenticity of the signal and prevents front-running attacks.
## Cryptographic primitives
Semaphore uses MiMC for the Merkle tree, Pedersen commmitments for the identity
commitments, Blake2 for the nullifiers hash, and EdDSA for the signature.
MiMC is a relatively new hash function. We use the recommended MiMC
construction from [Albrecht et al](https://eprint.iacr.org/2016/492.pdf), and
there is a prize to break MiMC at [http://mimchash.org](http://mimchash.org)
which has not been claimed yet.
We have also implemented a version of Semaphore which uses the Poseidon hash
function for the Merkle tree and EdDSA signature verification. This may have
better security than MiMC, allows identity insertions to save about 20% gas,
and roughly halves the proving time. Note, however, that the Poseidon-related
circuits and EVM bytecode generator have not been audited, so use it with
caution. To use it, checkout the `feat/poseidon` branch of this repository.

View File

@@ -0,0 +1,245 @@
---
sidebar_position: 6
---
# libsemaphore
[`libsemaphore`](https://www.npmjs.com/package/libsemaphore) is a helper
library for Semaphore written in Typescript. Any dApp written in Javascript or
Typescript should use it as it provides useful abstractions over common tasks
and objects, such as identities and proof generation.
Note that only v1.0.14 and above works with the Semaphore code in this
repository. v0.0.x is compatible with the pre-audited Semaphore code.
## Available types, interfaces, and functions
### Types
**`SnarkBigInt`**
A big integer type compatible with the `snarkjs` library. Note that it is not
advisable to mix variables of this type with `bigNumber`s or `BigInt`s.
Encapsulates `snarkjs.bigInt`.
**`EddsaPrivateKey`**
An [EdDSA](https://tools.ietf.org/html/rfc8032) private key which should be 32
bytes long. Encapsulates a [`Buffer`](https://nodejs.org/api/buffer.html).
**`EddsaPublicKey`**
An EdDSA public key. Encapsulates an array of `SnarkBigInt`s.
**`SnarkProvingKey`**
A proving key, which when used with a secret _witness_, generates a zk-SNARK
proof about said witness. Encapsulates a `Buffer`.
**`SnarkVerifyingKey`**
A verifying key which when used with public inputs to a zk-SNARK and a
`SnarkProof`, can prove the proof's validity. Encapsulates a `Buffer`.
**`SnarkWitness`**
The secret inputs to a zk-SNARK. Encapsulates an array of `SnarkBigInt`s.
**`SnarkPublicSignals`**
The public inputs to a zk-SNARK. Encapsulates an array of `SnarkBigInt`s.
### Interfaces
**`EddsaKeyPair`**
Encapsulates an `EddsaPublicKey` and an `EddsaPrivateKey`.
```ts
interface EddsaKeyPair {
pubKey: EddsaPublicKey
privKey: EddsaPrivateKey
}
```
**`Identity`**
Encapsulates all information required to generate an identity commitment, and
is crucial to creating `SnarkProof`s to broadcast signals.
```ts
interface Identity {
keypair: EddsaKeyPair
identityNullifier: SnarkBigInt
identityTrapdoor: SnarkBigInt
}
```
**`SnarkProof`**
Note that `broadcastSignal()` accepts a `uint256[8]` array for its `_proof`
parameter. See `genBroadcastSignalParams()`.
```ts
interface SnarkProof {
pi_a: SnarkBigInt[]
pi_b: SnarkBigInt[][]
pi_c: SnarkBigInt[]
}
```
### Functions
**`genPubKey(privKey: EddsaPrivateKey): EddsaPublicKey`**
Generates a public EdDSA key from a supplied private key. To generate a private
key, use `crypto.randomBytes(32)` where `crypto` is the built-in Node or
browser module.
**`genIdentity(): Identity`**
This is a convenience function to generate a fresh and random `Identity`. That
is, the 32-byte private key for the `EddsaKeyPair` is randomly generated, as
are the distinct 31-byte identity nullifier and the 31-byte identity trapdoor
values.
**`serialiseIdentity(identity: Identity): string`**
Converts an `Identity` into a JSON string which looks like this:
```text
["e82cc2b8654705e427df423c6300307a873a2e637028fab3163cf95b18bb172e","a02e517dfb3a4184adaa951d02bfe0fe092d1ee34438721d798db75b8db083","15c6540bf7bddb0616984fccda7e954a0fb5ea4679ac686509dc4bd7ba9c3b"]
```
You can also spell this function as `serializeIdentity`.
To convert this string back into an `Identity`, use `unSerialiseIdentity()`.
**`unSerialiseIdentity(string: serialisedId): Identity`**
Converts the `string` output of `serialiseIdentity()` to an `Identity`.
You can also spell this function as `unSerializeIdentity`.
**`genIdentityCommitment(identity: Identity): SnarkBigInt`**
Generates an identity commitment, which is the hash of the public key, the
identity nullifier, and the identity trapdoor.
**`async genProof(witness: SnarkWitness, provingKey: SnarkProvingKey): SnarkProof`**
Generates a `SnarkProof`, which can be sent to the Semaphore contract's
`broadcastSignal()` function. It can also be verified off-chain using
`verifyProof()` below.
**`genPublicSignals(witness: SnarkWitness, circuit: SnarkCircuit): SnarkPublicSignals`**
Extracts the public signals to be supplied to the contract or `verifyProof()`.
**`verifyProof(verifyingKey: SnarkVerifyingKey, proof: SnarkProof, publicSignals: SnarkPublicSignals): boolean`**
Returns `true` if the given `proof` is valid, given the correct verifying key
and public signals.
Returns `false` otherwise.
**`signMsg(privKey: EddsaPrivateKey, msg: SnarkBigInt): EdDSAMiMcSpongeSignature)`**
Encapsualtes `circomlib.eddsa.signMiMCSponge` to sign a message `msg` using private key `privKey`.
**`verifySignature(msg: SnarkBigInt, signature: EdDSAMiMcSpongeSignature, pubKey: EddsaPublicKey)`: boolean**
Returns `true` if the cryptographic `signature` of the signed `msg` is from the
private key associated with `pubKey`.
Returns `false` otherwise.
**`setupTree(levels: number, prefix: string): MerkleTree`**
Returns a Merkle tree created using
[`semaphore-merkle-tree`](https://www.npmjs.com/package/semaphore-merkle-tree)
with the same number of levels which the Semaphore zk-SNARK circuit expects.
This tree is also configured to use `MimcSpongeHasher`, which is also what the
circuit expects.
`levels` sets the number of levels of the tree. A tree with 20 levels, for
instance, supports up to 1048576 deposits.
**`genCircuit(circuitDefinition: any)`**
Returns a `new snarkjs.Circuit(circuitDefinition)`. The `circuitDefinition`
object should be the `JSON.parse`d result of the `circom` command which
converts a `.circom` file to a `.json` file.
**`async genWitness(...)`**
This function has the following signature:
```ts
const genWitness = async (
signal: string,
circuit: SnarkCircuit,
identity: Identity,
idCommitments: SnarkBigInt[] | BigInt[] | ethers.utils.BigNumber[],
treeDepth: number,
externalNullifier: SnarkBigInt,
)
```
- `signal` is the string you wish to broadcast.
- `circuit` is the output of `genCircuit()`.
- `identity` is the `Identity` whose identity commitment you want to prove is
in the set of registered identities.
- `idCommitments` is an array of registered identity commmitments; i.e. the
leaves of the tree.
- `treeDepth` is the number of levels which the Merkle tree used has
- `externalNullifier` is the current external nullifier
It returns an object as such:
- `witness`: The witness to pass to `genProof()`.
- `signal`: The computed signal for Semaphore. This is the hash of the
recipient's address, relayer's address, and fee.
- `signalHash`: The hash of the computed signal.
- `msg`: The hash of the external nullifier and the signal hash
- `signature`: The signature on the above msg.
- `tree`: The Merkle tree object after it has been updated with the identity commitment
- `identityPath`: The Merkle path to the identity commmitment
- `identityPathIndex`: The leaf index of the identity commitment
- `identityPathElements`: The elements along the above Merkle path
Only `witness` is essential to generate the proof; the other data is only
useful for debugging and additional off-chain checks, such as verifying the
signature and the Merkle tree root.
**`formatForVerifierContract = (proof: SnarkProof, publicSignals: SnarkPublicSignals`**
Converts the data in `proof` and `publicSignals` to strings and rearranges
elements of `proof.pi_b` so that `snarkjs`'s `verifier.sol` will accept it.
To be specific, it returns an object as such:
```ts
{
a: [ proof.pi_a[0].toString(), proof.pi_a[1].toString() ],
b: [
[ proof.pi_b[0][1].toString(), proof.pi_b[0][0].toString() ],
[ proof.pi_b[1][1].toString(), proof.pi_b[1][0].toString() ],
],
c: [ proof.pi_c[0].toString(), proof.pi_c[1].toString() ],
input: publicSignals.map((x) => x.toString()),
}
```
**`stringifyBigInts = (obj: any) => object`**
Encapsulates `snarkjs.stringifyBigInts()`. Makes it easy to convert `SnarkProof`s to JSON.
**`unstringifyBigInts = (obj: any) => object`**
Encapsulates `snarkjs.unstringifyBigInts()`. Makes it easy to convert JSON to `SnarkProof`s.
**`genExternalNullifier = (plaintext: string) => string`**
Each external nullifier must be at most 29 bytes large. This function
keccak-256-hashes a given `plaintext`, takes the last 29 bytes, and pads it
(from the start) with 0s, and returns the resulting hex string.

View File

@@ -0,0 +1,68 @@
---
sidebar_position: 3
---
# Quick start
Semaphore has been tested with Node 11.14.0. It will run with Node 12 LTE but
we highly recommend using Node 11.14.0 if you wish to develop on its source
code, as one of its dependencies, `script`, cannot compile when if you use Node 12.
Use [`nvm`](https://github.com/nvm-sh/nvm) to manage your Node version.
Clone this repository, install dependencies, and build the source code:
```bash
git clone git@github.com:kobigurk/semaphore.git && \
cd semaphore && \
npm i && \
npm run bootstrap && \
npm run build
```
**Note**: we use `lerna` to manage the `circuits`, `config`, and `contracts`
subpackages. Do not run `npm install` within any of these directories. Instead,
just run `npm run bootstrap` in the main directory.
Next, either download the compiled zk-SNARK circuit, proving key, and
verification key (note that these keys are for testing purposes, and not for
production, as there is no certainty that the toxic waste was securely
discarded).
To download the circuit, proving key, and verification key, run:
```bash
# Start from the base directory
./circuits/scripts/download_snarks.sh
```
To generate the above files locally instead, run:
```bash
# Start from the base directory
./circuits/scripts/build_snarks.sh
```
This process should take about 45 minutes.
Build the Solidity contracts (you need `solc` v 0.5.12 installed in your
`$PATH`):
```bash
# Start from the base directory
cd contracts && \
npm run compileSol
```
Run tests while still in the `contracts/` directory:
```bash
# The first command tests the Merkle tree contract and the second
# tests the Semaphore contract
npm run test-semaphore && \
npm run test-mt
```

View File

@@ -0,0 +1,11 @@
---
sidebar_position: 7
---
# Multi-party trusted setup
The Semaphore authors will use the [Perpetual Powers of
Tau](https://github.com/weijiekoh/perpetualpowersoftau/) ceremony and a random
beacon as phase 1 of the trusted setup.
More details about phase 2 will be released soon.

View File

@@ -0,0 +1,144 @@
---
sidebar_position: 4
---
# Usage
The Semaphore contract forms a base layer for other contracts to create
applications that rely on anonymous signaling.
First, you should ensure that the proving key, verification key, and circuit
file, which are static, be easily available to your users. These may be hosted
in a CDN or bundled with your application code.
The Semaphore team has not performed a trusted setup yet, so trustworthy
versions of these files are not available yet.
Untrusted versions of these files, however, may be obtained via the
`circuits/scripts/download_snarks.sh` script.
Next, to have full flexibility over Semaphore's mechanisms, write a Client
contract and set the owner of the Semaphore contract as the address of the
Client contract. You may also write a Client contract which deploys a Semaphore
contract in its constructor, or on the fly.
With the Client contract as the owner of the Semaphore contract, the Client
contract may call owner-only Semaphore functions such as
`addExternalNullifier()`.
## Add, deactivate, or reactivate external nullifiiers
These functions add, deactivate, and reactivate an external nullifier respectively.
As each identity can only signal once to an external nullifier, and as a signal
can only be successfully broadcasted to an active external nullifier, these
functions enable use cases where it is necessary to have multiple external
nullifiers or to activate and/or deactivate them.
Refer to the [high-level explanation of
Semaphore](https://medium.com/coinmonks/to-mixers-and-beyond-presenting-semaphore-a-privacy-gadget-built-on-ethereum-4c8b00857c9b)
for more details.
## Set broadcast permissioning
Note that `Semaphore.broadcastSignal()` is permissioned by default, so if you
wish for anyone to be able to broadcast a signal, the owner of the Semaphore
contract (either a Client contract or externally owned account) must first
invoke `setPermissioning(false)`.
See [SemaphoreClient.sol](https://github.com/appliedzkp/semaphore/blob/master/contracts/sol/SemaphoreClient.sol) for an example.
## Insert identities
To generate an identity commitment, use the `libsemaphore` functions
`genIdentity()` and `genIdentityCommitment()` Typescript (or Javascript)
functions:
```ts
const identity: Identity = genIdentity()
const identityCommitment = genIdentityCommitment(identity)
```
Be sure to store `identity` somewhere safe. The `serialiseIdentity()` function
can help with this:
`const serialisedId: string = serialiseIdentity(identity: Identity)`
It converts an `Identity` into a JSON string which looks like this:
```text
["e82cc2b8654705e427df423c6300307a873a2e637028fab3163cf95b18bb172e","a02e517dfb3a4184adaa951d02bfe0fe092d1ee34438721d798db75b8db083","15c6540bf7bddb0616984fccda7e954a0fb5ea4679ac686509dc4bd7ba9c3b"]
```
To convert this string back into an `Identity`, use `unSerialiseIdentity()`.
`const id: Identity = unSerialiseIdentity(serialisedId)`
## Broadcast signals
First obtain the leaves of the identity tree (in sequence, up to the user's
identity commitment, or more).
```ts
const leaves = <list of leaves>
```
Next, load the circuit from disk (or from a remote source):
```ts
const circuitPath = path.join(__dirname, "/path/to/circuit.json")
const cirDef = JSON.parse(fs.readFileSync(circuitPath).toString())
const circuit = genCircuit(cirDef)
```
Next, use `libsemaphore`'s `genWitness()` helper function as such:
```
const result = await genWitness(
signal,
circuit,
identity,
leaves,
num_levels,
external_nullifier,
)
```
- `signal`: a string which is the signal to broadcast.
- `circuit`: the output of `genCircuit()` (see above).
- `identity`: the user's identity as an `Identity` object.
- `leaves` the list of leaves in the tree (see above).
- `num_levels`: the depth of the Merkle tree.
- `external_nullifier`: the external nullifier at which to broadcast.
Load the proving key from disk (or from a remote source):
```ts
const provingKeyPath = path.join(__dirname, "/path/to/proving_key.bin")
const provingKey: SnarkProvingKey = fs.readFileSync(provingKeyPath)
```
Generate the proof (this takes about 30-45 seconds on a modern laptop):
```ts
const proof = await genProof(result.witness, provingKey)
```
Generate the `broadcastSignal()` parameters:
```ts
const publicSignals = genPublicSignals(result.witness, circuit)
const params = genBroadcastSignalParams(result, proof, publicSignals)
```
Finally, invoke `broadcastSignal()` with the parameters:
```ts
const tx = await semaphoreClientContract.broadcastSignal(
ethers.utils.toUtf8Bytes(signal),
params.proof,
params.root,
params.nullifiersHash,
external_nullifier,
{ gasLimit: 500000 }
)
```

View File

@@ -0,0 +1,106 @@
---
id: introduction
title: What Is Semaphore?
sidebar_position: 1
slug: /
---
## Overview
[Semaphore](https://github.com/appliedzkp/semaphore) is a zero-knowledge gadget
which allows Ethereum users to prove their membership of a set which they had
previously joined without revealing their original identity. At the same time,
it allows users to signal their endorsement of an arbitrary string. It is
designed to be a simple and generic privacy layer for Ethereum dApps. Use cases
include private voting, whistleblowing, mixers, and anonymous authentication.
Finally, it provides a simple built-in mechanism to prevent double-signalling
or double-spending.
This gadget comprises of smart contracts and
[zero-knowledge](https://z.cash/technology/zksnarks/) components which work in
tandem. The Semaphore smart contract handles state, permissions, and proof
verification on-chain. The zero-knowledge components work off-chain to allow
the user to generate proofs, which allow the smart contract to update its state
if these proofs are valid.
For a formal description of Semaphore and its underlying cryptographic
mechanisms, also see this document
[here](https://github.com/appliedzkp/semaphore/tree/master/spec).
Semaphore is designed for smart contract and dApp developers, not end users.
Developers should abstract its features away in order to provide user-friendly
privacy.
Try a simple demo [here](https://weijiekoh.github.io/semaphore-ui/) or read a
high-level description of Semaphore
[here](https://medium.com/coinmonks/to-mixers-and-beyond-presenting-semaphore-a-privacy-gadget-built-on-ethereum-4c8b00857c9b).
## Basic features
In sum, Semaphore provides the ability to:
1. Register an identity in a smart contract, and then:
2. Broadcast a signal:
- Anonymously prove that their identity is in the set of registered
identities, and at the same time:
- Publicly store an arbitrary string in the contract, if and only if that
string is unique to the user and the contracts current external
nullifier, which is a unique value akin to a topic. This means that
double-signalling the same message under the same external nullifier is
not possible.
### External nullifiers
Think of an external nullifier as a voting booth where each user may only cast
one vote. If they try to cast a second vote a the same booth, that vote is
invalid.
An external nullifier is any 29-byte value. Semaphore always starts with one
external nullifier, which is set upon contract deployment. The owner of the
Semaphore contract may add more external nullifiers, deactivate, or reactivate
existing ones.
The first time a particular user broadcasts a signal to an active external
nullifier `n`, and if the user's proof of membership of the set of registered
users is valid, the transaction will succeed. The second time she does so to
the same `n`, however, her transaction will fail.
Additionally, all signals broadcast transactions to a deactivated external
nullifier will fail.
Each client application must use the above features of Semaphore in a unique
way to achieve its privacy goals. A mixer, for instance, would use one external
nullifier as such:
| Signal | External nullifier |
| ----------------------------------------------------------------------------- | ---------------------------- |
| The hash of the recipient's address, relayer's address, and the relayer's fee | The mixer contract's address |
This allows anonymous withdrawals of funds (via a transaction relayer, who is
rewarded with a fee), and prevents double-spending as there is only one
external nullifier.
An anonymous voting app would be configured differently:
| Signal | External nullifier |
| ----------------------------------- | ------------------------ |
| The hash of the respondent's answer | The hash of the question |
This allows any user to vote with an arbitary response (e.g. yes, no, or maybe)
to any question. The user, however, can only vote once per question.
## About the code
This repository contains the code for Semaphore's contracts written in
Soliidty, and zk-SNARK circuits written in
[circom](https://github.com/iden3/circom). It also contains Typescript code to
execute tests.
The code has been audited by ABDK Consulting. Their suggested security and
efficiency fixes have been applied.
A multi-party computation to produce the zk-SNARK proving and verification keys
for Semaphore will begin in the near future.

View File

@@ -0,0 +1,18 @@
{
"version.label": {
"message": "V2",
"description": "The label for version V2"
},
"sidebar.mySidebar.category.Guides": {
"message": "Guides",
"description": "The label for category Guides in sidebar mySidebar"
},
"sidebar.mySidebar.category.Use cases": {
"message": "Use cases",
"description": "The label for category Use cases in sidebar mySidebar"
},
"sidebar.mySidebar.category.Technical reference": {
"message": "Technical reference",
"description": "The label for category Technical reference in sidebar mySidebar"
}
}

View File

@@ -0,0 +1,13 @@
---
sidebar_position: 9
---
# Credits
Semaphore V2 is the work of several people, for a complete list of contributors you can visit our [Github pages](https://github.com/semaphore-protocol/semaphore/graphs/contributors).
- [Barry WhiteHat](https://github.com/barryWhiteHat)
- [Kobi Gurkan](https://github.com/kobigurk)
- [Koh Wei Jie](https://github.com/weijiekoh)
- [Andrija Novakovic](https://github.com/akinovak)
- [Cedoor](https://github.com/cedoor)

View File

@@ -0,0 +1,35 @@
---
sidebar_position: 5
---
# Deployed contracts
## Verifiers
| Contract | Goerli | Arbitrum One |
| -------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| Verifier16.sol | [0xA525...6629](https://goerli.etherscan.io/address/0xA5253ba39381Aa99c4C2C5A4D5C2deC036d06629) | [0x6143...1609](https://arbiscan.io/address/0x6143ECd9Fd1A00EDe1046d456f8aab53a7D71609) |
| Verifier17.sol | [0xe041...01Ab](https://goerli.etherscan.io/address/0xe0418A5f8fBF051D6cbc41Ff29855Dd2a02201Ab) | [0xAc12...Fb02](https://arbiscan.io/address/0xAc12fFFE354D6446eb50dd33E683B78FED73Fb02) |
| Verifier18.sol | [0x7CdB...6797](https://goerli.etherscan.io/address/0x7CdB3336d7d7c55Bce0FB1508594C54521656797) | [0x610a...C701](https://arbiscan.io/address/0x610aeF0F2da3CD1C8bDefe4BDB434Ee146E0C701) |
| Verifier19.sol | [0xbd87...190B](https://goerli.etherscan.io/address/0xbd870921d8A5398a3314C950d1fc63b8C3AB190B) | [0x5477...FCb4](https://arbiscan.io/address/0x5477725177035bbC9d70443eb921D29749D6FCb4) |
| Verifier20.sol | [0x2a96...E099](https://goerli.etherscan.io/address/0x2a96c5696F85e3d2aa918496806B5c5a4D93E099) | [0x3fB2...3136](https://arbiscan.io/address/0x3fB2C0988a37b76e760c44e6516aF720935f3136) |
| Verifier21.sol | [0x5Ec7...67Cd](https://goerli.etherscan.io/address/0x5Ec7d851a52A2a25CEc528F42a7ACA8EcF4667Cd) | [0xDc8f...7DF8](https://arbiscan.io/address/0xDc8f6B8A42836d4566256f4c6C53131DFD127DF8) |
| Verifier22.sol | [0x919d...aA5b](https://goerli.etherscan.io/address/0x919d3d9c05FA7411e334deA5a763354fC7B6aA5b) | [0x6962...32f2](https://arbiscan.io/address/0x6962b5e706be5278eeCb01c286b50A48484632f2) |
| Verifier23.sol | [0x6391...E552](https://goerli.etherscan.io/address/0x63917b00a6dA7865bEfdd107AfC83CC2e6BDE552) | [0x41e4...dF6B](https://arbiscan.io/address/0x41e4796Bd89B4BF04013b559c93fC32E9a2BdF6B) |
| Verifier24.sol | [0xd05C...0E7D](https://goerli.etherscan.io/address/0xd05CAd7d940114c1419098EE3cEA0776ab510E7D) | [0xD528...5b60](https://arbiscan.io/address/0xD528B1D1408ab3583af4694F92b0aFEbE33d5b60) |
| Verifier25.sol | [0x6D98...5ACb](https://goerli.etherscan.io/address/0x6D9862e6140D94E932d94c8BcE74a0BDD0ea5ACb) | [0x1683...33e7](https://arbiscan.io/address/0x1683a27EF9c10c5286dB56412E1272cD0Ca733e7) |
| Verifier26.sol | [0x8c29...6c77](https://goerli.etherscan.io/address/0x8c29e0b77e32f704F03eeCE01c041192A5EB6c77) | [0x7819...4C00](https://arbiscan.io/address/0x78194bB665d1E33b97eE45B1A755c15717E94C00) |
| Verifier27.sol | [0x066c...9c4C](https://goerli.etherscan.io/address/0x066cC22f8CA2A8D90D7Ff77D8a10A27e629c9c4C) | [0x997D...6E42](https://arbiscan.io/address/0x997Dac00E6701Ef7F3518280E5a9922801126E42) |
| Verifier28.sol | [0x698F...6D15](https://goerli.etherscan.io/address/0x698F9507f504E2BD238be7da56E8D9fee60C6D15) | [0xDd3C...68c6](https://arbiscan.io/address/0xDd3C7f4cBA2467aE41c0F614A3c3E24bC80268c6) |
| Verifier29.sol | [0xbBfC...6346](https://goerli.etherscan.io/address/0xbBfC2E201C3c3c6F50063c3Edb4746c6Fcb36346) | [0xe53e...60Cd](https://arbiscan.io/address/0xe53eF12093933D5df5691EAbA3821bD1c1EB60Cd) |
| Verifier30.sol | [0x06bc...4bD1](https://goerli.etherscan.io/address/0x06bcD633988c1CE7Bd134DbE2C12119b6f3E4bD1) | [0x7FeA...340e](https://arbiscan.io/address/0x7FeA07c536ABBB0E7FB3c833376EE4EaDc21340e) |
| Verifier31.sol | [0x133b...cCFE](https://goerli.etherscan.io/address/0x133b69Ce47BF20C49368354914DF47519Ca6cCFE) | [0xe453...2178](https://arbiscan.io/address/0xe4539a592df18936202480FBe77E47DE012F2178) |
| Verifier32.sol | [0xe297...2e2D](https://goerli.etherscan.io/address/0xe2978F79cb4AF62e5C990EE5c7E12fb22ee22e2D) | [0x98c9...32F4](https://arbiscan.io/address/0x98c90845A7870e215cBd7265DDC653E6c07032F4) |
## Semaphore
| Contract | Goerli | Arbitrum One |
| ------------------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| Semaphore.sol | [0x5259...262f](https://goerli.etherscan.io/address/0x5259d32659F1806ccAfcE593ED5a89eBAb85262f) | [0x8633...A604](https://arbiscan.io/address/0x86337c87A56117f8264bbaBA70e5a522C6E8A604) |
| IncrementalBinaryTree.sol | [0x61AE...B236](https://goerli.etherscan.io/address/0x61AE89E372492e53D941DECaaC9821649fa9B236) | [0x91cD...3948](https://arbiscan.io/address/0x91cD2B8573629d00BeC72EA1188d446897BD3948) |
| PoseidonT3.sol | [0xe0A4...350F](https://goerli.etherscan.io/address/0xe0A452533853310C371b50Bd91BB9DCC8961350F) | [0xe0c8...61d0](https://arbiscan.io/address/0xe0c8d1e53D9Bfc9071F6564755FCFf6cC0dB61d0) |

View File

@@ -0,0 +1,64 @@
---
sidebar_position: 7
---
# Glossary
## Semaphore identity
The identity of a user in the Semaphore protocol.
An identity contains the following three values:
- [Identity commitment](#identity-commitment): the public value.
- Identity trapdoor and identity nullifier: secret values known only by the user.
## Semaphore group
A group is a binary incremental [Merkle tree](#merkle-tree) in which each leaf contains an [identity commitment](#identity-commitment) for a user.
The identity commitment proves that the user is a group member without revealing the Semaphore identity of the user.
Semaphore uses the **Poseidon** hash function to create Merkle trees.
For more information, see the [Poseidon website](https://www.poseidon-hash.info/).
## Identity commitment
The public [Semaphore identity](#semaphore-identity) value used in [Semaphore groups](#semaphore-group).
Semaphore uses the **Poseidon** hash function to create the identity commitment from the Semaphore identity secret values.
For more information, see the [Poseidon website](https://www.poseidon-hash.info/).
## Merkle tree
A tree in which every leaf (i.e., a node that doesn't have children) is labelled with the cryptographic hash of a data block,
and every node that isn't a leaf is labelled with the cryptographic hash of its child node labels.
In zero-knowledge protocols, Merkle trees can be used to efficiently summarize and validate large data sets.
To validate that a tree contains a specific leaf, a verifier only needs a portion of the complete data structure.
For more information, see [Merkle tree in Wikipedia](https://en.wikipedia.org/wiki/Merkle_tree).
## Nullifier
A value used to prevent double entry or double signalling.
See [Circuit nullifier hash](/technical-reference/circuits/#hash-anulador-nullifier-hash).
## Relay
A third-party who receives a fee for including relayed transactions in the blockchain (McMenamin, Daza, and Fitz. https://eprint.iacr.org/2022/155.pdf, p.3).
To preserve the anonymity of the user broadcasting a signal with Semaphore, an application may use a relayer to post the signal transaction to Ethereum on behalf of the user.
Applications may provide rewards for relayers and implement front-running prevention mechanisms, such as requiring the signals to include the relayers address, binding the
signal to that specific address (https://docs.semaphore.pse.dev/whitepaper-v1.pdf, p.6).
## Trusted setup files
The secure, verifiable parameters generated by Semaphore's trusted setup ceremony.
Semaphore uses the trusted setup files to generate and verify valid zero-knowledge proofs.
To generate or verify valid zero-knowledge proofs with Semaphore, applications must include the following Semaphore _trusted setup_ files:
- semaphore.zkey
- semaphore.wasm
- semaphore.json
For a complete list of ready-to-use files, see [trusted-setup-pse.org](https://www.trusted-setup-pse.org).
To learn more, see the [trusted setup ceremony](https://storage.googleapis.com/trustedsetup-a86f4.appspot.com/semaphore/semaphore_top_index.html).

View File

@@ -0,0 +1,4 @@
{
"label": "Guides",
"position": 2
}

View File

@@ -0,0 +1,122 @@
---
sidebar_position: 2
title: Groups
---
# Semaphore groups
<!--Working outline
- What is a group
- What do groups contain
- Identities
- Root
- What are they used for
- Create a group
- Use a group
- Add identities
- Remove identities
-->
Use Semaphore in your application or smart contract to create off-chain and on-chain groups.
A [Semaphore group](/glossary/#grupo-semaphore) contains [identity commitments](/glossary/#compromiso-de-identidad-identity-commitment) of group members.
Example uses of groups include the following:
- Poll question that attendees join to rate an event.
- Ballot that members join to vote on a proposal.
- Whistleblowers who are verified employees of an organization.
A Semaphore group is an [incremental Merkle tree](/glossary/#árbol-de-merkle-merkle-tree), and group members (i.e., identity commitments) are tree leaves.
Semaphore groups set the following two parameters:
- **Tree depth**: the maximum number of members a group can contain (`max size = 2 ^ tree depth`).
- **Zero value**: the value used to calculate the zero nodes of the incremental Merkle tree.
Learn how to work with groups.
- [**Off-chain groups**](#off-chain-groups)
- [**On-chain groups**](#on-chain-groups)
## Off-chain groups
- [Create a group](#create-a-group)
- [Add members](#add-members)
- [Remove or update members](#remove-or-update-members)
### Create a group
Use the [`@semaphore-protocol/group`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/group) library `Group` class to create an off-chain group.
#### Options
- **Tree depth**: (_default `20`_) the maximum number of members a group can contain (`max size = 2 ^ tree depth`).
- **Zero value**: (_default `BigInt(0)`_) the value for a tree node that doesn't have a member assigned.
To create a group with default _`treeDepth`_ and _`zeroValue`_, call the `Group` constructor without parameters--for example:
```ts
import { Group } from "@semaphore-protocol/group"
// Default parameters: treeDepth = 20, zeroValue = BigInt(0).
const group = new Group()
```
The following example code passes _`treeDepth`_ to create a group for `2 ^ 30 = 1073741824` members:
```ts
import { Group } from "@semaphore-protocol/group"
const group = new Group(30)
```
The following example code creates a group with a _`zeroValue`_ of `BigInt(1)`:
```ts
import { Group } from "@semaphore-protocol/group"
const group = new Group(20, BigInt(1))
```
### Add members
Use the `Group addMember` function to add a member (identity commitment) to a group--for example:
```ts
group.addMember(identityCommitment)
```
To add a batch of members to a group, pass an array to the `Group addMembers` function--for example:
```ts
group.addMembers([identityCommitment1, identityCommitment2])
```
### Remove or update members
To remove members from a group, pass the member index to the `Group removeMember` function--for example:
```ts
group.removeMember(0)
```
To update members in a group, pass the member index and the new value to the `Group updateMember` function--for example:
```ts
group.updateMember(0, 2)
```
:::caution
Removing a member from a group sets the node value to `zeroValue`.
Given that the node isn't removed, and the length of the `group.members` array doesn't change.
:::
## On-chain groups
The [`SemaphoreGroups`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts/contracts/base/SemaphoreGroups.sol) contract uses the [`IncrementalBinaryTree`](https://github.com/privacy-scaling-explorations/zk-kit/blob/main/packages/incremental-merkle-tree.sol/contracts/IncrementalBinaryTree.sol) library and provides methods to create and manage groups.
:::info
You can import `SemaphoreGroups` and other Semaphore contracts from the [`@semaphore-protocol/contracts`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts) NPM module.
:::
Alternatively, you can use an already deployed [`Semaphore`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts/contracts/Semaphore.sol) contract and use its group external functions.

View File

@@ -0,0 +1,83 @@
---
sidebar_position: 1
title: Identities
---
# Semaphore identities
In order to join a [Semaphore group](/glossary#semaphore-group), a user must first create a [Semaphore identity](/glossary#semaphore-identity).
A Semaphore identity contains two values generated with the identity:
- Identity trapdoor
- identity nullifier
To use and verify the identity, the identity owner (user) must know the trapdoor and nullifier values.
To prevent fraud, the owner should keep both values secret.
## Create identities
In your code, use the [`@semaphore-protocol/identity`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/identity) library to create a Semaphore identity _deterministically_ (from the hash of a message) or _randomly_.
- [**Create random identities**](#create-random-identities)
- [**Create deterministic identities**](#create-deterministic-identities)
### Create random identities
To create a random identity, instantiate `Identity` without any parameters--for example:
```ts
import { Identity } from "@semaphore-protocol/identity"
const { trapdoor, nullifier, commitment } = new Identity()
```
The new identity contains two random secret values: `trapdoor` and `nullifier`, and one public value: `commitment`.
The Poseidon hash of the identity nullifier and trapdoor is called the _identity secret_,
and its hash is the _identity commitment_.
An identity commitment, similarly to Ethereum addresses, is a public value used
in Semaphore groups to represent the identity of a group member. The secret values are similar to
Ethereum private keys and are used to generate Semaphore zero-knowledge proofs and authenticate signals.
### Create deterministic identities
If you pass a message as a parameter, Semaphore generates `trapdoor` and `nullifier`
from the _SHA256_ hash of the message.
The message might be a password or a message that the user cryptographically signs with a private key.
When using deterministic identities, you should always keep the message secret.
Given that the hash is deterministic, anyone with the same message can recreate the same identity.
```ts
const identity = new Identity("secret-message")
```
:::tip
Building a system to save or recover secret values of Semaphore identities is nontrivial.
You may choose to delegate such functionality to existing wallets such as Metamask--for example:
1. In Metamask, a user signs a message with the private key of their Ethereum account.
2. In your application, the user creates a deterministic identity with the signed message.
3. The user can now recreate their Semaphore identity whenever they want by signing the same message with their Ethereum account in Metamask.
:::
## Save your identities
You can output an identity as a JSON string that you can save and reuse later.
The `Identity.toString()` method generates a JSON array from an identity--for example:
```ts
console.log(identity.toString()) // View the identity trapdoor and nullifier.
// '["8255d...", "62c41..."]'
```
The array contains the trapdoor and nullifier.
To reuse the saved identity, pass the JSON to the `Identity()` constructor.
```ts
const identity2 = new Identity(identity.toString())
```

View File

@@ -0,0 +1,110 @@
---
sidebar_position: 3
title: Proofs
---
# Semaphore proofs
Learn how to use Semaphore to generate and verify zero-knowledge proofs.
Once a user joins their [Semaphore identity](/glossary#semaphore-identity) to a [Semaphore group](/glossary#semaphore-group), the user can signal anonymously with a zero-knowledge proof that proves the following:
- The user is a member of the group.
- The same user created the signal and the proof.
Developers can use Semaphore for the following:
- [**Generate a proof off-chain**](#generate-a-proof-off-chain)
- [**Verify a proof off-chain**](#verify-a-proof-off-chain)
- [**Verify a proof on-chain**](#verify-a-proof-on-chain)
## Generate a proof off-chain
Use the [`@semaphore-protocol/proof`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/proof) library to generate an off-chain proof.
To generate a proof, pass the following properties to the `generateProof` function:
- `identity`: The Semaphore identity of the user broadcasting the signal and generating the proof.
- `group`: The group to which the user belongs.
- `externalNullifier`: The value that prevents double-signaling.
- `signal`: The signal the user wants to send anonymously.
- `snarkArtifacts`: The `zkey` and `wasm` [trusted setup files](/glossary/#trusted-setup-files).
In the voting system use case, once all the voters have joined their [identities](/guides/identities#create-an-identity) to the ballot [group](/guides/groups),
a voter can generate a proof to vote for a proposal.
In the call to `generateProof`, the voting system passes the unique ballot ID (the [Merkle tree](/glossary/#merkle-tree/) root of the group) as the
`externalNullifier` to prevent the voter signaling more than once for the ballot.
The following code sample shows how to use `generateProof` to generate the voting proof:
```ts
import { generateProof } from "@semaphore-protocol/proof"
const externalNullifier = group.root
const signal = "proposal_1"
const fullProof = await generateProof(identity, group, externalNullifier, signal, {
zkeyFilePath: "./semaphore.zkey",
wasmFilePath: "./semaphore.wasm"
})
```
## Verify a proof off-chain
Use the [`@semaphore-protocol/proof`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/proof) library to verify a Semaphore proof off-chain.
To verify a proof, pass the following to the `verifyProof` function:
- _`proof`_: the Semaphore proof.
- _`verificationKey`_: the JavaScript object in the `semaphore.json` [trusted setup file](/glossary/#trusted-setup-files).
The following code sample shows how to parse the verification key object from `semaphore.json`
and verify the previously generated proof:
```ts
import { verifyProof } from "@semaphore-protocol/proof"
const verificationKey = JSON.parse(fs.readFileSync("./semaphore.json", "utf-8"))
await verifyProof(verificationKey, fullProof) // true or false.
```
`verifyProof` returns a Promise that resolves to `true` or `false`.
## Verify a proof on-chain
Use the [`SemaphoreCore`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts/contracts/base/SemaphoreCore.sol) contract to verify proofs on-chain. It uses a verifier deployed to Ethereum and provides methods hash the signal and verify a proof.
:::info
You can import `SemaphoreCore` and other Semaphore contracts from the [`@semaphore-protocol/contracts`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts) NPM module.
:::
To verify Semaphore proofs in your contract, import `SemaphoreCore` and pass the following to the `_verifyProof` internal method:
- _`signal`_: The Semaphore signal to prove.
- _`root`_: The root of the Merkle tree.
- _`nullifierHash`_: a [nullifier hash](#retrieve-a-nullifier-hash).
- _`externalNullifier`_: The external nullifier.
- _`proof`_: A [_Solidity-compatible_ Semaphore proof](#generate-a-solidity-compatible-proof).
- _`verifier`_: The verifier address.
Remember to save the `nullifierHash` on-chain to avoid double-signaling.
Alternatively, you can use an already deployed [`Semaphore`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts/Semaphore.sol) contract and use its `verifiyProof` external function.
### Generate a Solidity-compatible proof
To transform a proof to be compatible with Solidity contracts, pass the proof to the `packToSolidityProof` utility function--for example:
```ts
import { packToSolidityProof } from "@semaphore-protocol/proof"
const solidityProof = packToSolidityProof(fullProof.proof)
```
Semaphore returns a new Solidity-compatible instance of the proof.
### Retrieve a nullifier hash
To get the Semaphore proof nullifier hash, access the proof's `publicSignals.nullifierHash` property--for example:
```ts
const { nullifierHash } = fullProof.publicSignals
```

View File

@@ -0,0 +1,304 @@
---
sidebar_position: 2
---
# Quick setup
Set up a new Hardhat project with Semaphore.
Learn how to create and test an Ethereum smart contract that uses zero-knowledge
proofs to verify membership.
To check out the code used in this guide, visit the
[quick-setup](https://github.com/semaphore-protocol/quick-setup) repository.
1. [**Create a Node.js project**](#create-a-nodejs-project)
2. [**Install Hardhat**](#install-hardhat)
3. [**Install Semaphore packages**](#install-semaphore-packages)
4. [**Create the Semaphore contract**](#create-the-semaphore-contract)
5. [**Create a Hardhat task**](#create-a-hardhat-task)
6. [**Test your contracts**](#test-your-contract)
7. [**Deploy your contract**](#deploy-your-contract)
## Create a Node.js project
1. Follow the [Node.js _LTS version_](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
instructions to install `node` (Hardhat may not work with Node.js _Current_).
2. Follow the [Yarn](https://yarnpkg.com/getting-started/install) instructions
to download and install the `yarn` package manager.
3. Create a directory for the project and change to the new directory.
```bash
mkdir semaphore-example
cd semaphore-example
```
4. In your terminal, run `yarn init` to initialize the Node.js project.
## Install Hardhat
[Hardhat](https://hardhat.org/) is a development environment you can use to
compile, deploy, test, and debug Ethereum software.
Hardhat includes the Hardhat Network, a local Ethereum network for development.
1. Use `yarn` to install [Hardhat](https://hardhat.org/getting-started/):
```bash
yarn add hardhat --dev
```
2. Use `yarn` to run `hardhat` and create a JavaScript project:
```bash
yarn hardhat
# At the prompt, select "Create a JavaScript project"
# and then enter through the prompts.
```
## Install Semaphore packages
Semaphore provides contracts, JavaScript libraries and an Hardhat plugin for developers building zero-knowledge applications.
- `@semaphore-protocol/contracts` provides contracts to manage groups and verify Semaphore proofs on-chain.
- JavaScript libraries help developers build zero-knowledge applications.
- `@semaphore-protocol/hardhat` allow developers Hardhat tasks to deploy verifiers and Semaphore contracts.
To install these dependencies for your project, do the following:
1. Use `yarn` to install `@semaphore-protocol/contracts`:
```bash
yarn add @semaphore-protocol/contracts@2.6.1
```
2. Use `yarn` to install the Semaphore JavaScript libraries and the Hardhat plugin:
```bash
yarn add @semaphore-protocol/identity@2.6.1 @semaphore-protocol/group@2.6.1 @semaphore-protocol/proof@2.6.1 @semaphore-protocol/hardhat@0.1.0 --dev
```
For more detail about _Semaphore contracts_, see [Contracts](https://docs.semaphore.pse.dev/technical-reference/contracts).
To view the source of our packages, see the [semaphore](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1#-packages) repository.
## Create the Semaphore contract
Create a `Greeter` contract that uses the `Semaphore.sol` contract:
1. Rename `Lock.sol` to `Greeter.sol` and replace the content with the following:
```solidity title="./contracts/Greeter.sol"
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@semaphore-protocol/contracts/interfaces/ISemaphore.sol";
/// @title Greeter contract.
/// @dev The following code is just an example to show how Semaphore can be used.
contract Greeter {
event NewGreeting(bytes32 greeting);
event NewUser(uint256 identityCommitment, bytes32 username);
ISemaphore public semaphore;
uint256 groupId;
mapping(uint256 => bytes32) users;
constructor(address semaphoreAddress, uint256 _groupId) {
semaphore = ISemaphore(semaphoreAddress);
groupId = _groupId;
semaphore.createGroup(groupId, 20, 0, address(this));
}
function joinGroup(uint256 identityCommitment, bytes32 username) external {
semaphore.addMember(groupId, identityCommitment);
users[identityCommitment] = username;
emit NewUser(identityCommitment, username);
}
function greet(
bytes32 greeting,
uint256 merkleTreeRoot,
uint256 nullifierHash,
uint256[8] calldata proof
) external {
semaphore.verifyProof(groupId, merkleTreeRoot, greeting, nullifierHash, groupId, proof);
emit NewGreeting(greeting);
}
}
```
## Create a Hardhat task
Hardhat lets you write [tasks](https://hardhat.org/guides/create-task.html#creating-a-task)
that automate building and deploying smart contracts and dApps.
To create a task that deploys the `Greeter` contract, do the following:
1. Create a `tasks` folder and add a `./tasks/deploy.js` file that contains the following:
```javascript title="./tasks/deploy.js"
const { task, types } = require("hardhat/config")
task("deploy", "Deploy a Greeter contract")
.addOptionalParam("semaphore", "Semaphore contract address", undefined, types.address)
.addParam("group", "Group identifier", 42, types.int)
.addOptionalParam("logs", "Print the logs", true, types.boolean)
.setAction(async ({ logs, semaphore: semaphoreAddress, group: groupId }, { ethers, run }) => {
if (!semaphoreAddress) {
const { address: verifierAddress } = await run("deploy:verifier", { logs, merkleTreeDepth: 20 })
const { address } = await run("deploy:semaphore", {
logs,
verifiers: [
{
merkleTreeDepth: 20,
contractAddress: verifierAddress
}
]
})
semaphoreAddress = address
}
const Greeter = await ethers.getContractFactory("Greeter")
const greeter = await Greeter.deploy(semaphoreAddress, groupId)
await greeter.deployed()
if (logs) {
console.log(`Greeter contract has been deployed to: ${greeter.address}`)
}
return greeter
})
```
2. In your `hardhat.config.js` file, add the following:
```javascript title="./hardhat.config.js"
require("@nomiclabs/hardhat-waffle")
require("@semaphore-protocol/hardhat")
require("./tasks/deploy") // Your deploy task.
module.exports = {
solidity: "0.8.4"
}
```
## Test your contract
[`hardhat-waffle`](https://hardhat.org/plugins/nomiclabs-hardhat-waffle.html)
lets you write tests with the [Waffle](https://getwaffle.io/) test framework
and [Chai assertions](https://www.chaijs.com/).
1. Use `yarn` to install the `hardhat-waffle` plugin and dependencies for smart
contract tests:
```bash
yarn add -D @nomiclabs/hardhat-waffle 'ethereum-waffle@^3.0.0' \
@nomiclabs/hardhat-ethers 'ethers@^5.0.0' chai
```
2. Download the Semaphore [zk trusted setup files](http://www.trusted-setup-pse.org/)
and copy them to the `./static` folder.
```bash
cd static
wget http://www.trusted-setup-pse.org/semaphore/20/semaphore.zkey
wget http://www.trusted-setup-pse.org/semaphore/20/semaphore.wasm
```
Learn more about [trusted setup files](/glossary/#trusted-setup-files).
3. Rename the `Lock.js` test file to `Greeter.js` and replace the content with the following:
```javascript title="./test/Greeter.js"
const { Identity } = require("@semaphore-protocol/identity")
const { Group } = require("@semaphore-protocol/group")
const { generateProof, packToSolidityProof, verifyProof } = require("@semaphore-protocol/proof")
const { expect } = require("chai")
const { run, ethers } = require("hardhat")
describe("Greeter", function () {
let greeter
const users = []
const groupId = 42
const group = new Group()
before(async () => {
greeter = await run("deploy", { logs: false, group: groupId })
users.push({
identity: new Identity(),
username: ethers.utils.formatBytes32String("anon1")
})
users.push({
identity: new Identity(),
username: ethers.utils.formatBytes32String("anon2")
})
group.addMember(users[0].identity.generateCommitment())
group.addMember(users[1].identity.generateCommitment())
})
describe("# joinGroup", () => {
it("Should allow users to join the group", async () => {
for (let i = 0; i < group.members.length; i++) {
const transaction = greeter.joinGroup(group.members[i], users[i].username)
await expect(transaction).to.emit(greeter, "NewUser").withArgs(group.members[i], users[i].username)
}
})
})
describe("# greet", () => {
const wasmFilePath = "./static/semaphore.wasm"
const zkeyFilePath = "./static/semaphore.zkey"
it("Should allow users to greet", async () => {
const greeting = ethers.utils.formatBytes32String("Hello World")
const fullProof = await generateProof(users[1].identity, group, groupId, greeting, {
wasmFilePath,
zkeyFilePath
})
const solidityProof = packToSolidityProof(fullProof.proof)
const transaction = greeter.greet(
greeting,
fullProof.publicSignals.merkleRoot,
fullProof.publicSignals.nullifierHash,
solidityProof
)
await expect(transaction).to.emit(greeter, "NewGreeting").withArgs(greeting)
})
})
})
```
4. Run the following `yarn` commands to compile and test your contract:
```bash
yarn hardhat compile
yarn hardhat test
```
## Deploy your contract
To deploy your contract in a local Hardhat network (and use it in your dApp), run the following `yarn` commands:
```bash
yarn hardhat node
yarn hardhat deploy --group 42 --network localhost # In another tab.
```
For a more complete demo that provides a starting point for your dApp,
see [semaphore-boilerplate](https://github.com/semaphore-protocol/boilerplate/).

View File

@@ -0,0 +1,19 @@
---
sidebar_position: 8
---
# Resources
[Semaphore V2 is Live!](https://medium.com/privacy-scaling-explorations/semaphore-v2-is-live-f263e9372579) - Privacy and Scaling Explorations
[To Mixers and Beyond: presenting Semaphore, a privacy gadget built on Ethereum](https://medium.com/coinmonks/to-mixers-and-beyond-presenting-semaphore-a-privacy-gadget-built-on-ethereum-4c8b00857c9b) - Koh Wei Jie
[Privacy in Ethereum](https://www.youtube.com/watch?v=maDHYyj30kg) - Barry WhiteHat at the Taipei Ethereum Meetup
[Snarks for mixing, signaling and scaling by](https://www.youtube.com/watch?v=lv6iK9qezBY) - Barry WhiteHat at Devcon 4
[Privacy in Ethereum](https://www.youtube.com/watch?v=zBUo7G95wYE) - Barry WhiteHat at Devcon 5
[A trustless Ethereum mixer using zero-knowledge signalling](https://www.youtube.com/watch?v=GzVT16lFOHU) - Koh Wei Jie and Barry WhiteHat at Devcon 5
[Hands-on Applications of Zero-Knowledge Signalling](https://www.youtube.com/watch?v=7wd2aAN2jXI) - Koh Wei Jie at Devcon 5

View File

@@ -0,0 +1,51 @@
---
sidebar_position: 6
---
# Subgraph
[The Graph](https://thegraph.com/) is a protocol for indexing networks like Ethereum and IPFS.
Site owners publish _subgraphs_ that expose site data for anyone to query.
Semaphore's subgraph allows you to retrieve data from the [`Semaphore.sol`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts/Semaphore.sol) smart contract.
:::tip
The Graph protocol uses the [GraphQL](https://graphql.org/) query lanaguage. For examples, see the [GraphQL API documentation](https://thegraph.com/docs/developer/graphql-api). Visit the [subgraph repository](https://github.com/semaphore-protocol/subgraph) to see the list of Semaphore subgraphs.
:::
## Schema
### MerkleTree
- `id`: unique identifier among all MerkleTree entities,
- `depth`: Merkle tree depth,
- `root`: Merkle tree root,
- `zeroValue`: Merkle tree zero value,
- `numberOfLeaves`: total number of tree leaves,
- `group`: link to the Group entity.
### Group
- `id`: unique identifier among all Group entities,
- `merkleTree`: link to the MerkleTree entity,
- `timestamp`: block timestamp,
- `admin`: admin of the group,
- `members`: list of group members.
- `verifiedProofs`: list of group proofs.
### Member
- `id`: unique identifier among all Member entities,
- `identityCommitment`: Semaphore identity commitment,
- `timestamp`: block timestamp,
- `index`: index of the tree leaf,
- `group`: link to the Group entity.
### VerifiedProof
- `id`: unique identifier among all VerifiedProof entities,
- `signal`: user's signal,
- `merkleTreeRoot`: Merkle tree root,
- `nullifierHash`: nullifier hash,
- `externalNullifier`: external nullifier,
- `timestamp`: block timestamp,
- `group`: link to the Group entity.

View File

@@ -0,0 +1,4 @@
{
"label": "Technical reference",
"position": 4
}

View File

@@ -0,0 +1,57 @@
---
sidebar_position: 2
---
# Circuits
The [Semaphore circuit](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/circuits) is the heart of the protocol and consists of three parts:
- [**Proof of membership**](/technical-reference/circuits#proof-of-membership)
- [**Nullifier hash**](/technical-reference/circuits#nullifier-hash)
- [**Signal**](/technical-reference/circuits#signal)
![Semaphore circuit](https://github.com/semaphore-protocol/semaphore/raw/v2.6.1/packages/circuits/scheme.png)
The diagram above shows how the input signals are used in the Semaphore circuit and how the outputs are calculated.
## Proof of membership
The circuit hashes the hash of the identity nullifier with the identity trapdoor to generate an identity commitment. Then, it verifies the proof of membership against the Merkle root and the identity commitment.
**Private inputs:**
- `treeSiblings[nLevels]`: the values along the Merkle path to the user's identity commitment,
- `treePathIndices[nLevels]`: the direction (0/1) per tree level corresponding to the Merkle path to the user's identity commitment,
- `identityNullifier`: the 32-byte identity secret used as nullifier,
- `identityTrapdoor`: the 32-byte identity secret used as trapdoor.
**Public outputs:**
- `root`: The Merkle root of the tree.
## Nullifier hash
The circuit hashes the identity nullifier with the external nullifier and then checks that the result matches the provided nullifier hash.
Nullifier hashes saved in a Semaphore smart contract allow the contract to reject a proof that contains a used nullifier hash.
**Private inputs:**
- `identityNullifier`: the 32-byte identity secret used as a nullifier.
**Public inputs:**
- `externalNullifier`: the 32-byte external nullifier.
**Public outputs:**
- `nullifierHash`: the hash of the identity nullifier and the external nullifier; used to prevent double-signaling.
**Procedure:**
## Signal
The circuit calculates a dummy square of the signal hash to prevent any tampering with the proof.
**Public inputs:**
- `signalHash`: the hash of the user's signal.

View File

@@ -0,0 +1,50 @@
---
sidebar_position: 3
---
# Contracts
Semaphore includes three types of contracts:
- [**Base contracts**](/technical-reference/contracts#base-contracts)
- [**Extension contracts**](/technical-reference/contracts#extension-contracts)
- [**Verifiers**](/technical-reference/contracts#verifiers)
:::info
To use Semaphore contracts and interfaces in your project,
install the [`@semaphore-protocol/contracts`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts) NPM package.
:::
## Base contracts
Semaphore provides the following base contracts:
- [`SemaphoreCore.sol`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts/base/SemaphoreCore.sol): contains the functions to verify Semaphore proofs;
- [`SemaphoreGroups.sol`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts/base/SemaphoreGroups.sol): contains the functions to create groups and add/remove members.
These contracts are closely related to the protocol.
You can inherit them in your contract or you can use [`Semaphore.sol`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts/Semaphore.sol), which inherits them for you.
See our [deployed contracts](/deployed-contracts#semaphore) to find the addresses for your network.
:::info
While some dApps may use on-chain groups, others may prefer to use off-chain groups, saving only their tree roots in the contract.
:::
## Extension contracts
- [`SemaphoreVoting.sol`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts/extensions/SemaphoreVoting.sol): voting contract that contains the essential functions to create polls, add voters, and anonymously cast votes.
- [`SemaphoreWhistleblowing.sol`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts/extensions/SemaphoreWhistleblowing.sol): whistleblowing contract that contains the essential functions to create entities (for example: non-profit organizations), add whistleblowers, and anonymously publish leaks.
These contracts extend the protocol to provide application logic for specific use-cases.
More extensions will be added in the future.
## Verifiers
To verify Semaphore proofs, the [`SemaphoreCore.sol`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts/base/SemaphoreCore.sol) contract requires the address of a deployed verifier contract.
You can choose to manually deploy the [verifier](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts/verifiers) you prefer or you can use one of our [deployed verifiers](/deployed-contracts#verifiers).
Each verifier name indicates the tree depth that it can verify.
For example, given a Semaphore proof generated with a tree depth `20`:
- The `Verifier20.sol` contract can verify the proof.
- The [group](/guides/groups) used for the proof can have a maximum `2^20=1048576` members.

View File

@@ -0,0 +1,4 @@
{
"label": "Use cases",
"position": 3
}

View File

@@ -0,0 +1,137 @@
---
sidebar_position: 1
---
# Private voting use case
The private voting use case describes how Semaphore interacts with your users and Ethereum to allow users to cast private votes in your application.
Learn how Semaphore enables applications to do the following:
- Register members as voters.
- Allow members to vote anonymously.
- Prove voter membership.
- Record and prove votes.
- Prevent double-voting.
## Roles
- **[Developer or community admin](#developer-or-community-admin)**
- **[Community member (dApp user)](#community-member)**
- **[Relay](#relay)**
### Developer or community admin
As a developer or community admin, you deploy the following:
- **Smart contract on Ethereum**: implements the Semaphore **base contract** to create a poll (Semaphore **group** that members join to vote), post transactions, and verify proofs on Ethereum.
- **Decentralized application (dApp)**: your application that provides a user interface (UI) where members join a poll and vote on a proposal.
### Community member
Community members connect their wallets to the dApp to take the following actions:
1. Verify ownership of the community token.
2. Generate an anonymous ID.
3. Cast a vote.
### Relay
To preserve anonymity and avoid disclosing the member's wallet address, the dApp may use a [relay](/glossary/#relay) to broadcast the vote.
The relay calls the **contract** function that then posts the member's vote transaction to Ethereum.
## Private voting
Consider a scenario where your community issues a token that users can mint.
The token might be a Proof of Attendance (POAP), NFT, or social token that your users can mint to receive membership and vote in your community.
The voting scenario has the following steps:
1. [Create a poll](#create-a-poll): Coordinator creates a poll, or _group_, in which members can vote on a proposal.
2. [Register voters](#register-voters): Members join the poll to vote.
3. [Record votes](#record-votes): Once the poll opens, members may cast one vote, or _signal_, on the topic.
### Create a poll
A community coordinator or dApp administrator uses the deployed smart contract to create an on-chain (Ethereum) poll, a [Semaphore group](/guides/groups/) that members can join and cast votes to.
In the following sample code, the voting contract declares a `createPoll` function that uses the Semaphore base `_createGroup` function:
```ts title="https://github.com/semaphore-protocol/semaphore/blob/v3.15.1/packages/contracts/contracts/extensions/SemaphoreVoting.sol"
function createPoll(
uint256 pollId,
address coordinator,
uint8 depth
) public override {
require(address(verifiers[depth]) != address(0), "SemaphoreVoting: depth value is not supported");
// highlight-next-line
_createGroup(pollId, depth, 0);
Poll memory poll;
poll.coordinator = coordinator;
polls[pollId] = poll;
emit PollCreated(pollId, coordinator);
}
```
A poll is a Semaphore [group](/guides/groups/) that stores the following:
- A topic to vote on.
- The public ID of the poll creator.
- [Semaphore IDs](/guides/identities/) of members who joined the poll.
To create the poll, the administrator calls the smart contract function--for example:
```ts
SemaphoreVoting.createPoll(pollId, coordinator, depth)
```
Next, learn how to [register voters](#register-voters) for the poll.
### Register voters
Before a user can register to vote, the dApp needs to verify membership by checking the user's wallet for the NFT.
To grant access to the wallet, the user clicks a `Connect wallet` button in the dApp and allows the dApp to check for the NFT.
Once a member is verified, the dApp provides the following member interactions:
1. [Generate a private identity](#generate-a-private-identity).
2. [Join a poll](#join-a-poll).
:::info
To learn how to connect to Ethereum wallets, visit the [ethers.js Getting Started documentation]((https://docs.ethers.io/v5/getting-started).
:::
#### Generate a private identity
To generate a private identity, the member completes a form in the dApp UI.
With the form values and the `@semaphore-protocol/identity` library, the dApp prompts the member to sign a wallet message and then generates the signed private identity.
The private identity is known only to the member and can be used in future interactions with the dApp.
Next, learn how members [join a poll](#join-a-poll).
#### Join a poll
Once the member has a private identity for the dApp, the member may select a poll to vote in.
When the member selects a poll, the dApp does the following:
1. Uses the `@semaphore-protocol/identity` library to generate an anonymous Semaphore ID, or _identity commitment_, from the private identity.
2. Calls a contract function that adds the new Semaphore ID to the on-chain poll.
With a member registered for a poll, learn how the dApp [records votes](#record-votes).
### Record votes
Once members have joined a poll, the coordinator starts the poll to allow voting.
When a member votes (for example, by selecting a radio button), then the dApp takes the following actions:
1. Uses the `@semaphore-protocol/proof` library to create a proof of the vote, the poll identifier, the Semaphore ID, and a [nullifier](/glossary/#nullifier) that prevents double-voting.
2. Sends the vote proof to the [relay](#relay).
### Related
- To get started developing with Semaphore, see the [Quick setup](/V2/quick-setup/) guide.
- For an example app that you can use to start your own project, see [Semaphore boilerplate](https://github.com/semaphore-protocol/boilerplate).

View File

@@ -0,0 +1,50 @@
---
id: introduction
title: What Is Semaphore?
sidebar_position: 1
slug: /
---
## Overview
[Semaphore](https://github.com/semaphore-protocol/semaphore) is a [zero-knowledge](https://z.cash/technology/zksnarks) protocol that allows you to cast a signal (for example, a vote or endorsement) as a provable group member without revealing your identity.
Additionally, it provides a simple mechanism to prevent double-signaling.
Use cases include private voting, whistleblowing, anonymous DAOs and mixers.
## Features
With Semaphore, you can allow your users to do the following:
1. [Create a Semaphore identity](/guides/identities/).
2. [Add their Semaphore identity to a group (i.e. _Merkle tree_)](/guides/groups/).
3. [Send a verifiable, anonymous signal (e.g a vote or endorsement)](/guides/proofs/).
When a user broadcasts a signal (for example: a vote), Semaphore zero-knowledge
proofs can ensure that the user has joined the group and hasn't already cast a signal with their nullifier.
Semaphore uses on-chain Solidity contracts and off-chain JavaScript libraries that work in tandem.
- Off chain, JavaScript libraries can be used to create identities, manage groups and generate proofs.
- On chain, Solidity contracts can be used to manage groups and verify proofs.
## Developer benefits
Semaphore is designed to be a simple and generic _privacy layer_ for decentralized applications (dApps) on Ethereum. It encourages modular application design, allowing dApp developers to choose and customize the on-chain and off-chain components they need.
## About the code
The core of the protocol is the [circuit logic](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/circuits/scheme.png).
In addition to circuits,
Semaphore provides [Solidity contracts](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts)
and [JavaScript libraries](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1#-packages) that allow developers to generate zero-knowledge proofs and verify them with minimal effort.
### Audits
| Version | Report | Scope |
| ------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| v2.0.0 | [Semaphore_2.0.0_Audit.pdf](https://github.com/semaphore-protocol/semaphore/files/9850441/Semaphore_2.0.0_Audit.pdf) | `circuits`, `contracts` |
| v2.5.0 | [Semaphore_2.5.0_Audit.pdf](https://github.com/semaphore-protocol/semaphore/files/9845008/Semaphore_2.5.0_Audit.pdf) | `contracts`, `libraries` |
:::info
If you are using the previous version of Semaphore, see the [Semaphore V1](/V1) documentation.
:::

View File

@@ -0,0 +1,14 @@
{
"version.label": {
"message": "V3",
"description": "The label for version V3"
},
"sidebar.mySidebar.category.Guides": {
"message": "Guías",
"description": "The label for category Guides in sidebar mySidebar"
},
"sidebar.mySidebar.category.Technical reference": {
"message": "Referencia técnica",
"description": "The label for category Technical reference in sidebar mySidebar"
}
}

View File

@@ -0,0 +1,17 @@
---
sidebar_position: 10
---
# Créditos
Semaphore es el esfuerzo de varias personas, para ver una lista completa de contribuidores puede visitar nuestras [páginas en Github](https://github.com/semaphore-protocol/semaphore/graphs/contributors).
- [Barry WhiteHat](https://github.com/barryWhiteHat)
- [Kobi Gurkan](https://github.com/kobigurk)
- [Koh Wei Jie](https://github.com/weijiekoh)
- [Andrija Novakovic](https://github.com/akinovak)
- [Cedoor](https://github.com/cedoor)
- [Rachel Aux](https://github.com/rachelaux)
- [Andy Guzman](https://github.com/aguzmant103)
- [Vivian Plasencia](https://github.com/vplasencia)
- [LauNaMu](https://github.com/0xyNaMu)

View File

@@ -0,0 +1,21 @@
---
sidebar_position: 5
---
# Contratos desplegados
| Contrato | Goerli\* | Sepolia | Mumbai | Optimism Goerli\* | Arbitrum Goerli\* | Arbitrum One |
| ------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| Semaphore.sol | [0x3889...6131](https://goerli.etherscan.io/address/0x3889927F0B5Eb1a02C6E2C20b39a1Bd4EAd76131) | [0x3889...6131](https://sepolia.etherscan.io/address/0x3889927F0B5Eb1a02C6E2C20b39a1Bd4EAd76131) | [0x3889...6131](https://mumbai.polygonscan.com/address/0x3889927F0B5Eb1a02C6E2C20b39a1Bd4EAd76131) | [0x3889...6131](https://goerli-optimism.etherscan.io/address/0x3889927F0B5Eb1a02C6E2C20b39a1Bd4EAd76131) | [0x3889...6131](https://goerli.arbiscan.io/address/0x3889927F0B5Eb1a02C6E2C20b39a1Bd4EAd76131) | [0xc60E...1520](https://arbiscan.io/address/0xc60E0Ee1a2770d5F619858C641f14FC4a6401520) |
| SemaphoreVerifier.sol | [0xb908...217C](https://goerli.etherscan.io/address/0xb908Bcb798e5353fB90155C692BddE3b4937217C) | [0xb908...217C](https://sepolia.etherscan.io/address/0xb908Bcb798e5353fB90155C692BddE3b4937217C) | [0xb908...217C](https://mumbai.polygonscan.com/address/0xb908Bcb798e5353fB90155C692BddE3b4937217C) | [0xb908...217C](https://goerli-optimism.etherscan.io/address/0xb908Bcb798e5353fB90155C692BddE3b4937217C) | [0xb908...217C](https://goerli.arbiscan.io/address/0xb908Bcb798e5353fB90155C692BddE3b4937217C) | [0xCAbe...4d07](https://arbiscan.io/address/0xCAbeED6cB96a287000aBd834b0B79c05e6Ea4d07) |
| Pairing.sol | [0xEe44...d7e8](https://goerli.etherscan.io/address/0xEe44c1e83A768E80A3588B409f1A010f9D1dd7e8) | [0xEe44...d7e8](https://sepolia.etherscan.io/address/0xEe44c1e83A768E80A3588B409f1A010f9D1dd7e8) | [0xEe44...d7e8](https://mumbai.polygonscan.com/address/0xEe44c1e83A768E80A3588B409f1A010f9D1dd7e8) | [0xEe44...d7e8](https://goerli-optimism.etherscan.io/address/0xEe44c1e83A768E80A3588B409f1A010f9D1dd7e8) | [0xEe44...d7e8](https://goerli.arbiscan.io/address/0xEe44c1e83A768E80A3588B409f1A010f9D1dd7e8) | [0xE3a4...A74C](https://arbiscan.io/address/0xE3a4C2FE9f025405cA6F60f6E960B4558604A74C) |
| IncrementalBinaryTree.sol | [0x4621...7F49](https://goerli.etherscan.io/address/0x4621EE309EAc747425F0FEd51931dDC241A27F49) | [0x4621...7F49](https://sepolia.etherscan.io/address/0x4621EE309EAc747425F0FEd51931dDC241A27F49) | [0x4621...7F49](https://mumbai.polygonscan.com/address/0x4621EE309EAc747425F0FEd51931dDC241A27F49) | [0x4621...7F49](https://goerli-optimism.etherscan.io/address/0x4621EE309EAc747425F0FEd51931dDC241A27F49) | [0x4621...7F49](https://goerli.arbiscan.io/address/0x4621EE309EAc747425F0FEd51931dDC241A27F49) | [0xcDF8...fFb0](https://arbiscan.io/address/0xcDF8efE6334c68aF283C83f2F14648da51fcfFb0) |
| PoseidonT3.sol | [0xe136...2595](https://goerli.etherscan.io/address/0xe136aBACf78E05988154ed85F4Ea911105302595) | [0xe136...2595](https://sepolia.etherscan.io/address/0xe136aBACf78E05988154ed85F4Ea911105302595) | [0xe136...2595](https://mumbai.polygonscan.com/address/0xe136aBACf78E05988154ed85F4Ea911105302595) | [0xe136...2595](https://goerli-optimism.etherscan.io/address/0xe136aBACf78E05988154ed85F4Ea911105302595) | [0xe136...2595](https://goerli.arbiscan.io/address/0xe136aBACf78E05988154ed85F4Ea911105302595) | [0xe0c8...61d0](https://arbiscan.io/address/0xe0c8d1e53D9Bfc9071F6564755FCFf6cC0dB61d0) |
:::caution
Está previsto que la testnet Goerli deje de funcionar en el cuarto trimestre de 2023. Consulte los siguientes enlaces para obtener más información.
- Goerli: https://ethereum.org/en/developers/docs/networks/#goerli
- Optimism Goerli: https://community.optimism.io/docs/useful-tools/networks/#op-goerli
- Arbitrum Goerli: https://docs.arbitrum.io/for-devs/concepts/public-chains#arbitrum-goerli
:::

View File

@@ -0,0 +1,80 @@
---
sidebar_position: 8
---
# FAQ
## ¿Qué es Semaphore?
Semaphore es un protocolo de conocimiento cero (zero-knowledge) que permite a los usuarios demostrar su pertenencia a un grupo y enviar señales como votos, comentarios o mensajes de texto sin revelar la identidad del usuario.
Esto significa que las señales no tienen conexión con las identidades.
También proporciona un mecanismo simple para evitar la doble señalización, lo que significa que no puede verificar la misma prueba dos veces.
## ¿Dónde puedo hacer preguntas sobre Semaphore?
Puede hacer preguntas sobre Semaphore en [Discord](https://semaphore.pse.dev/discord) o abriendo un [Semaphore Discussion](https://github.com/semaphore-protocol/semaphore/discussions).
## ¿Por qué las identidades requieren tanto `identity trapdoor` como `identity nullifier`?
Tener dos valores privados proporciona una capa de seguridad adicional. Si alguien rompe el hash del nullifier (imagínese que existe cierta maleabilidad de que la preimagen de Poseidón es fácil de encontrar cuando se aplica un hash con un valor específico X, que es el external nullifier elegido por los desarrolladores), el atacante puede encontrar todos los mensajes que envió la misma persona, pero no puede encontrar a quién, porque también está el trapdoor, que podría ser más difícil de romper.
## ¿Cuál es la diferencia entre `identity nullifier`, `external nullifier` y `nullifier hash`?
El identity nullifier (anulador de identidad) es uno de los valores secretos del usuario, mientras que el external nullifier (anulador externo) se puede utilizar como un tema sobre el que los usuarios pueden generar una prueba válida (por ejemplo, enviar votos anónimos) un número limitado de veces.
Tanto el identity nullifier como el external nullifier se utilizan para evitar que la misma prueba se verifique dos veces, lo que significa que si un usuario genera la misma prueba (con la misma identidad y el mismo external nullifier) dos veces, la segunda no será válida.
Finalmente, el nullifier hash (hash del anulador) es solo el hash del identity nullifier y el external nullifier que se utiliza para comprobar si ya se ha generado la misma prueba.
En el caso de una aplicación de votación, si tiene un grupo y desea que todos los miembros de este grupo voten solo una vez, puede usar la identificación del grupo como external nullifier. Cuando un usuario vota por primera vez, puede guardar el hash de su identity nullifier y la identificación del grupo (es decir, el nullifier hash) y evitar la doble votación comprobando si ese hash ya existe.
Vea los [circuitos de Semaphore](https://docs.semaphore.pse.dev/technical-reference/circuits) para más información técnica, o el [Semaphore boilerplate](https://github.com/semaphore-protocol/boilerplate) para un caso de uso real.
## ¿Por qué debo evitar que las pruebas se verifiquen dos veces?
Dado que las pruebas de conocimiento cero son completamente anónimas, es importante evitar que las generadas por identidades elegibles sean reutilizadas por una parte malintencionada.
En una aplicación de voto anónimo, por ejemplo, sin chequeos, se podría reutilizar una prueba válida para volver a votar.
## ¿Dónde puedo encontrar ejemplos de aplicaciones que utilicen Semaphore?
Puede encontrar algunas aplicaciones que usan Semaphore en [este blog post](https://mirror.xyz/privacy-scaling-explorations.eth/Yi4muh-vzDZmIqJIcM9Mawu2e7jw8MRnwxvhFcyfns8).
## ¿Cómo puedo iniciar un proyecto usando Semaphore?
Hay tres formas de comenzar a usar Semaphore en su proyecto: usando la [Semaphore CLI](https://github.com/semaphore-protocol/semaphore/tree/main/packages/cli), usando el [Semaphore boilerplate](https://github.com/semaphore-protocol/boilerplate) como una plantilla o bifurcándolo, o instalando los paquetes de Semaphore manualmente.
### Semaphore CLI
Para crear un nuevo proyecto podrías usar `npx` o instalar la [Semaphore CLI](https://github.com/semaphore-protocol/semaphore/tree/main/packages/cli) globalmente usando `npm` y entonces crear un nuevo proyecto usando el comando `semaphore create`. Vea [Configuración Rápida](https://docs.semaphore.pse.dev/quick-setup) para más información.
Hay tres plantillas soportadas en este momento: `contracts-hardhat`, `monorepo-ethers` y `monorepo-subgraph`.
- `contracts-hardhat`: Contiene un caso de uso básico de Semaphore. Viene con un contrato de muestra, una prueba (test) para ese contrato y una tarea (task) de muestra que implementa (deploys) ese contrato.
- `monorepo-ethers`: Es una aplicación completa que demuestra un caso de uso básico de Semaphore. Viene con un contrato de muestra, una prueba para ese contrato y una tarea de muestra que implementa ese contrato. También contiene una interfaz para usar el contrato. Esta plantilla usa [Ethers](https://github.com/ethers-io/ethers.js/) por detrás para obtener datos on-chain.
- `monorepo-subgraph`: Es lo mismo que la plantilla `monorepo-ethers`, pero usa [The Graph protocol](https://thegraph.com/) por detrás para obtener datos on-chain.
La Semaphore CLI también se puede usar para obtener datos de grupo de una red soportada. Hay comandos como: `get-groups`, `get-group`, `get-members`, `get-proofs`:
- `get-groups`: Muestra la lista de grupos de una red soportada.
- `get-group`: Muestra los datos de un grupo de una red soportada.
- `get-members`: Muestra los miembros de un grupo de una red soportada.
- `get-proofs`: Muestra las pruebas de un grupo de una red soportada.
### Semaphore boilerplate
Para crear un proyecto, también puede utilizar el [Semaphore boilerplate](https://github.com/semaphore-protocol/boilerplate). Puede bifurcarlo o usarlo como plantilla.
Las plantillas de la Semaphore CLI y el Semaphore boilerplate contienen el mismo código, que es una aplicación de feedback en la que puede crear una identidad, unirse a un grupo, y enviar su feedback de forma anónima. Son casi lo mismo, la única diferencia es que las plantillas usan CSS para que pueda decidir el framework de CSS o librería que desea usar y el boilerplate usa [ChakraUI](https://chakra-ui.com/) por defecto.
También puede probar la aplicación Semaphore boilerplate en vivo aquí: https://demo.semaphore.pse.dev.
### Instalación manual
Alternativamente, también puede instalar todos los paquetes manualmente usando npm o yarn siguiendo la [documentación de Semaphore](https://docs.semaphore.pse.dev).
## ¿Cómo puedo contribuir al protocolo?
Hay varias formas de contribuir al protocolo, puede encontrar más información al respecto aquí: https://github.com/semaphore-protocol#ways-to-contribute.

View File

@@ -0,0 +1,66 @@
---
sidebar_position: 7
---
# Glosario
## Identidad Semaphore
La identidad de un usuario en el protocolo Semaphore.
Una identidad contiene los tres valores que se mencionan a continuación:
- [Compromiso de identidad](#identity-commitment) (identity commitment): el valor público.
- Identidad trampilla (identity trapdoor) y anulador de identidad (identity nullifier): valores secretos que únicamente son del conocimiento del usuario.
## Compromiso de identidad (Identity commitment)
El valor público de la [identidad Semaphore](#semaphore-identity) utilizado en los [grupos Semaphore](#semaphore-group).
Semaphore utiliza la función hash [Poseidon](https://www.poseidon-hash.info/) para crear un compromiso de identidad a partir de los valores secretos de la identidad Semaphore.
## Grupo Semaphore
Un grupo es un [árbol de Merkle](#merkle-tree) binario e incremental en el que cada hoja contiene un [compromiso de identidad](#identity-commitment) para un usuario.
El compromiso de identidad comprueba que un usuario es un miembro del grupo sin revelar la identidad Semaphore del usuario.
Semaphore utiliza la función hash **Poseidon** para crear árboles de Merkle.
Para mayor información, vea el [sitio web de Poseidon](https://www.poseidon-hash.info/).
## Árbol de Merkle (Merkle tree)
Un árbol en el que cada hoja (es decir, un nodo que no tiene hijos) es etiquetado con el hash criptográfico de un bloque de datos,
y cada nodo, que no es una hoja, es etiquetado con el hash criptográfico de las etiquetas de sus nodos hijos.
En los protocolos de conocimiento zero (ZK), los árboles de Merkle pueden ser utilizados para resumir y validar de forma eficiente grandes conjuntos de datos.
Para validar que un árbol contiene una hoja en específico, un verificador sólo necesita una porción de la estructura completa de datos.
Para más información, vea [árbol de Merkle en Wikipedia](https://es.wikipedia.org/wiki/%C3%81rbol_de_Merkle).
## Anulador (Nullifier)
Un valor utilizado para prevenir registros dobles o dos señales emitidas por el mismo usuario.
Ver [hash de circuito nullifier](/technical-reference/circuits/#nullifier-hash).
## Retransmisor (Relayer)
Un tercero que recibe una comisión por incluir transacciones retransmitidas en la blockchain (McMenamin, Daza, and Fitz. https://eprint.iacr.org/2022/155.pdf, p.3).
Para preservar la anonimidad del usuario emitiendo una señal con Semaphore, una aplicación puede utilizar un retransmisor para publicar la transacción de la señal en Ethereum en nombre del usuario.
Las aplicaciones pueden ofrecer recompensas a los retransmisores e implementar mecanismos para prevenir ventajas maliciosas, como requerir que las señales incluyan la dirección del retransmisor, vinculando así la señal a esa dirección en específico (https://docs.semaphore.pse.dev/whitepaper-v1.pdf, p.6).
## Archivos confiables de configuración (Trusted setup files)
Los parámetros verificables y seguros generados por la ceremonia de configuración de confianza de Semaphore.
Semaphore utiliza los archivos confiables de configuración para generar y verificar pruebas válidas de conocimiento cero.
Para generar o verificar pruebas válidas de conocimiento cero con Semaphore, las aplicaciones deben incluir los siguientes archivos _confiables de configuración_ de Semaphore.
- semaphore.zkey
- semaphore.wasm
- semaphore.json
Para ver una lista completa de archivos listos para utilizarse, vea [trusted-setup-pse.org](https://www.trusted-setup-pse.org).
Para aprender más, vea la [ceremonia de configuración de confianza](https://storage.googleapis.com/trustedsetup-a86f4.appspot.com/semaphore/semaphore_top_index.html) (trusted setup ceremony).
## Señales (Signals)
El término "señales" en Semaphore se refiere a los valores que el usuario transmite al votar, confirmar, enviar un mensaje, etc. Por otro lado, "[señales](https://docs.circom.io/circom-language/signals/)" en Circom se refiere a datos que contienen elementos dentro del campo de Z/pZ. En Circom, las "señales" se pueden definir como entrada o salida y, de lo contrario, se consideran señales intermedias.

View File

@@ -0,0 +1,4 @@
{
"label": "Guides",
"position": 3
}

View File

@@ -0,0 +1,181 @@
---
sidebar_position: 4
title: Obteniendo datos
---
import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"
# Semaphore data
Para obtener datos on-chain del contrato [Semaphore.sol](https://github.com/semaphore-protocol/semaphore/blob/main/packages/contracts/contracts/Semaphore.sol), puedes usar la librería [@semaphore-protocol/data](https://github.com/semaphore-protocol/semaphore/tree/main/packages/data).
Hay dos formas para hacer esto, usando [`SemaphoreSubgraph`](https://github.com/semaphore-protocol/semaphore/blob/main/packages/data/src/subgraph.ts) o [`SemaphoreEthers`](https://github.com/semaphore-protocol/semaphore/blob/main/packages/data/src/ethers.ts). La clase `SemaphoreSubgraph` usa el [subgrafo de Semaphore](https://github.com/semaphore-protocol/subgraph), el cual usa [The Graph Protocol](https://thegraph.com/) detrás del telón, y la clase `SemaphoreEthers` usa [Ethers](https://github.com/ethers-io/ethers.js/).
- [**Obtener datos usando SemaphoreSubgraph**](#obtener-datos-usando-semaphoresubgraph)
- [**Obtener datos usando SemaphoreEthers**](#obtener-datos-usando-semaphoreethers)
## Instalar librería
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
{label: 'pnpm', value: 'pnpm'}
]}>
<TabItem value="npm">
```bash
npm install @semaphore-protocol/data@^3
```
</TabItem>
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/data@^3
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm add @semaphore-protocol/data@^3
```
</TabItem>
</Tabs>
## Obtener datos usando SemaphoreSubgraph
Para obtener datos usando el subgrafo de Semaphore puedes usar la clase [`SemaphoreSubgraph`](https://github.com/semaphore-protocol/semaphore/blob/main/packages/data/src/subgraph.ts) del paquete [@semaphore-protocol/data](https://github.com/semaphore-protocol/semaphore/tree/main/packages/data).
```typescript
import { SemaphoreSubgraph } from "@semaphore-protocol/data"
const semaphoreSubgraph = new SemaphoreSubgraph()
// or:
const semaphoreSubgraph = new SemaphoreSubgraph("arbitrum")
// or:
const semaphoreSubgraph = new SemaphoreSubgraph(
"https://api.studio.thegraph.com/query/14377/<your-subgraph>/<your-version>"
)
```
### Obtener Ids de los grupos
```typescript
const groupIds = await semaphoreSubgraph.getGroupIds()
```
### Obtener los grupos
```typescript
const groups = await semaphoreSubgraph.getGroups()
// or
const groups = await semaphoreSubgraph.getGroups({ members: true, verifiedProofs: true })
```
### Obtener un grupo
```typescript
const group = await semaphoreSubgraph.getGroup("42")
// or
const { members, verifiedProofs } = semaphoreSubgraph.getGroup("42", { members: true, verifiedProofs: true })
```
### Comprueba si un identity commitment es miembro de un grupo
```ts
await semaphoreSubgraph.isGroupMember(
"42",
"16948514235341957898454876473214737047419402240398321289450170535251226167324"
)
```
:::info
Puedes crear un grupo off-chain usando la clase SemaphoreSubgraph para obtener los miembros de la siguiente forma:
```typescript
import { Group } from "@semaphore-protocol/group"
import { SemaphoreSubgraph } from "@semaphore-protocol/data"
const groupId = "3"
const semaphoreSubgraph = new SemaphoreSubgraph("sepolia")
const { members } = await semaphoreSubgraph.getGroup(groupId, { members: true })
const group = new Group(groupId, 20, members)
```
:::
## Obtener datos usando SemaphoreEthers
Para obtener datos usando Ethers puedes usar la clase [`SemaphoreEthers`](https://github.com/semaphore-protocol/semaphore/blob/main/packages/data/src/ethers.ts) del paquete [@semaphore-protocol/data](https://github.com/semaphore-protocol/semaphore/tree/main/packages/data).
```typescript
import { SemaphoreEthers } from "@semaphore-protocol/data"
const semaphoreEthers = new SemaphoreEthers()
// or:
const semaphoreEthers = new SemaphoreEthers("homestead", {
address: "semaphore-address",
startBlock: 0
})
// or:
const semaphoreEthers = new SemaphoreEthers("http://localhost:8545", {
address: "semaphore-address"
})
```
### Obtener Ids de los grupos
```typescript
const groupIds = await semaphoreEthers.getGroupIds()
```
### Obtener un grupo
```typescript
const group = await semaphoreEthers.getGroup("42")
```
### Obtener el admin de un grupo
```typescript
const admin = await semaphoreEthers.getGroupAdmin("42")
```
### Obtener los miembros de un grupo
```typescript
const members = await semaphoreEthers.getGroupMembers("42")
```
### Obtener las pruebas verificadas de un grupo
```typescript
const verifiedProofs = await semaphoreEthers.getGroupVerifiedProofs("42")
```
:::info
Puedes crear un grupo off-chain usando la clase SemaphoreEthers para obtener los miembros de la siguiente forma:
```typescript
import { Group } from "@semaphore-protocol/group"
import { SemaphoreEthers } from "@semaphore-protocol/data"
const groupId = "3"
const semaphoreEthers = new SemaphoreEthers("sepolia")
const members = await semaphoreEthers.getGroupMembers(groupId)
const group = new Group(groupId, 20, members)
```
:::

View File

@@ -0,0 +1,159 @@
---
sidebar_position: 2
title: Grupos
---
import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"
# Gupos Semaphore
Un [grupo Semaphore](/glossary/#semaphore-group) contiene los [identity commitments](/glossary/#identity-commitment) (compromisos de identidad) de miembros del grupo.
Estos son algunos ejemplos de uso de los grupos:
- Encuesta con preguntas a la que se unen las personas que acudieron a un evento para calificarlo,
- votación a la que se unen los miembros para votar por una propuesta,
- Denunciantes que están verificados como empleados de una organización.
Un grupo Semaphore es un [árbol de Merkle incremental](/glossary/#incremental-merkle-tree), y los miembros del grupo (por ejemplo, [identity commitments](/glossary/#identity-commitments)) son las hojas del árbol.
Los grupos Semaphore determinan los siguientes tres parámetro:
- **Group id**: un identificador único para el grupo;
- **Tree depth**: el número máximo de miembros que puede contener un grupo (`max size = 2 ^ tree depth`);
- **Members** la lista de miembros para inicializar el grupo.
Aprenda cómo trabajar con grupos.
- [**Grupos off-chain**](#off-chain-groups)
- [**Grupos on-chain**](#on-chain-groups)
## Grupos off-chain (externos a la cadena)
- [Crear un grupo](#create-a-group)
- [Añadir miembros](#add-members)
- [Remover o actualizar miembros](#remove-or-update-members)
### Crear un grupo
Utilice la clase `Group` de la librería [`@semaphore-protocol/group`](https://github.com/semaphore-protocol/semaphore/blob/main/packages/group) para crear un grupo off-chain con los siguientes parámetros:
- `Group id`: un identificar único para el grupo;
- `Tree depth`: (_default `20`_) el número máximo de usuarios que puede contener un grupo, el valor por defecto es 20 (`max size = 2 ^ tree depth`).
- `Members`: (_default `[]`_) la lista de miembros para inicializar el grupo.
#### Instalar librería:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
{label: 'pnpm', value: 'pnpm'}
]}>
<TabItem value="npm">
```bash
npm install @semaphore-protocol/group@^3
```
</TabItem>
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/group@^3
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm add @semaphore-protocol/group@^3
```
</TabItem>
</Tabs>
Para crear un grupo con el número de usuarios que aparece por defecto (20) _`treeDepth`_, llame la función para construir un `Group` sin el segundo parámetro. Por ejemplo:
```ts
import { Group } from "@semaphore-protocol/group"
const group = new Group(1)
```
El siguiente código de ejemplo pasa por _`treeDepth`_ para crear un grupo para `2 ^ 30 = 1073741824` miembros:
```ts
import { Group } from "@semaphore-protocol/group"
const group = new Group(1, 30)
```
También puede inicializar un grupo con varios miembros pasando la lista de identity commitments (miembros) como tercer parámetro al crear el grupo:
```ts
import { Group } from "@semaphore-protocol/group"
const members = [
"11237622825477336339577122413451117718539783476837539122310492284566644730311",
"9332663527862709610616009715800254142772436825222910251631161087138559093425",
"13255821893820536903335282929376140649646180444238593676033702344407594536519"
]
const group = new Group(1, 20, members)
```
### Añadir miembros
Utiliza la función `Group addMember` para añadir un miembro (es decir su "identity commitment") a un grupo. Por ejemplo:
```ts
group.addMember(identityCommitment)
```
Para añadir un lote de miembros a un grupo, pasa una selección por la función `Group addMembers`. Por ejemplo:
```ts
group.addMembers([identityCommitment1, identityCommitment2])
```
:::caution
Cuando utiliza la misma identidad Semaphore en varios grupos, si un atacante toma control de esa identidad, todos los grupos de los que forma parte estarán comprometidos. Considere utilizar identidades diferentes para cada grupo.
:::
### Remover o actualizar miembros
Para remover miembros de un equipo, pasa el índice del miembro por la función `Group removeMember`. Por ejemplo:
```ts
group.removeMember(0)
```
Para actualizar los miembros dentro de un grupo, pasa el índice del miembro y el nuevo valor por la función `Group updateMember`. Por ejemplo:
```ts
group.updateMember(0, 2)
```
:::caution
Remover a un miembro de un grupo configura el valor del nodo a un valor especial (ejemplo, `zeroValue`).
Dado que ese nodo no se remueve y el largo de la selección de `group.members` no cambia.
:::
## Grupos on-chain
El contrato [`SemaphoreGroups`](https://github.com/semaphore-protocol/semaphore/blob/main/packages/contracts/contracts/base/SemaphoreGroups.sol) utiliza la librería del [`IncrementalBinaryTree`](https://github.com/privacy-scaling-explorations/zk-kit/blob/main/packages/incremental-merkle-tree.sol/contracts/IncrementalBinaryTree.sol) (árbol binario incremental) y provee métodos para crear y administrar grupos.
:::información
puede importar el contrato `SemaphoreGroups.sol` y otros contratos Semaphore del módulo NPM [`@semaphore-protocol/contracts`](https://github.com/semaphore-protocol/semaphore/tree/main/packages/contracts).
:::
Alternativamente, puede utilizar un contrato [`Semaphore.sol`](https://github.com/semaphore-protocol/semaphore/blob/main/packages/contracts/contracts/Semaphore.sol) ya desplegado y utilizar sus funciones externas para grupos.
:::caution
`Semaphore.sol` no revisa si un miembro con un identity commitment en específico ya existe en un grupo. Esta revisión se debe realizar off-chain.
:::
:::caution
`Semaphore.sol` incluye un mecanismo para verificar pruebas Semaphore creadas con raíces de árboles de Merkle antiguas. La duración de este mecanismo puede ser definido por el admin en la función `createGroup`. Por lo tanto, los miembros de un grupo pueden continuar generando pruebas válidas incluso después de ser removidos. Para más información ver el issue [#98](https://github.com/semaphore-protocol/semaphore/issues/98).
:::

View File

@@ -0,0 +1,117 @@
---
sidebar_position: 1
title: Identidades
---
import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"
# Identidades Semaphore
Para unirse a un [grupo Semaphore](/glossary#semaphore-group), un usuario primero deberá crear una [identidad Semaphore](/glossary#semaphore-identity).
Una identidad Semaphore contiene dos valores generados junto con la identidad:
- Identity trapdoor (Identidad trampilla)
- Identity nullifier (Anulador de identidad)
Para utilizar y verificar su identidad, la persona dueña de la identidad (usuario) debe conocer los valores trapdoor y nullifier.
Para prevenir fraudes, la persona dueña debe conservar de forma secreta ambos valores.
## Crear identidades
En su código, utilice la librería [`@semaphore-protocol/identity`](https://github.com/semaphore-protocol/semaphore/tree/main/packages/identity) para crear una identidad Semaphore _de forma determinística_ (del hash de un mensaje) o _de forma aleatoria_.
- [**Crear identidades aleatorias**](#create-random-identities)
- [**Crear identidades determinísticas**](#create-deterministic-identities)
### Instalar librería:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
{label: 'pnpm', value: 'pnpm'}
]}>
<TabItem value="npm">
```bash
npm install @semaphore-protocol/identity@^3
```
</TabItem>
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/identity@^3
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm add @semaphore-protocol/identity@^3
```
</TabItem>
</Tabs>
### Crear identidades aleatorias
Para crear una identidad aleatoria, represente `Identity` sin algún parámetro. Por ejemplo:
```ts
import { Identity } from "@semaphore-protocol/identity"
const { trapdoor, nullifier, commitment } = new Identity()
```
La nueva identidad contiene dos valores aleatorios secretos: `trapdoor` y `nullifier`, y un valor público: `commitment`.
El hash Poseidon del identity nullifier y trapdoor se conoce como _identity secret_ (el secreto de identidad),
y su hash es el _identity commitment_ (compromiso de identidad).
Un identity commitment (compromiso de identidad), de forma similar a las direcciones Ethereum, es un valor público que se utiliza en los grupos Semaphore para representar la
identidad de un miembro del grupo. Los valores secretos son similares a las llaves privadas
Ethereum y se utilizan para generar pruebas de conocimiento cero (ZKP) Semaphore y autenticar señales.
### Crear identidades determinísticas
Si transmite un mensaje como un parámetro, Semaphore genera `trapdoor` y `nullifier`
del hash _SHA256_ del mensaje.
El mensaje puede ser una contraseña o un mensaje que el usuario firma de forma criptográfica con una llave privada.
Al utilizar identidades determinísticas siempre deberá mantener secreto el mensaje.
Dado que el hash es determinístico, cualquier persona con el mismo mensaje puede recrear la misma identidad.
```ts
const identity = new Identity("secret-message")
```
:::tip
Crear un sistema que guarde o recupere valores secretos de identidades Semaphore no es trivial.
Puede elegir delegar este tipo de funcionalidad a carteras existente como Metamask. Por ejemplo:
1. En Metamask, un usuario firma un mensaje con la llave privada de su cuenta Ethereum.
2. En la aplicación que usted ofrece, el usuario crea una identidad determinística con el mensaje firmado.
3. Ahora el usuario puede recrear su identidad Semaphore cuando quiera al firmar el mismo mensaje con su cuenta Ethereum en Metamask.
:::
## Guarde sus identidades
Puede generar una identidad como una cadena de caractéres JSON que puede guardar y reutilizar más tarde.
El método `Identity.toString()` genera una matriz JSON a partir de una identidad. Por ejemplo:
```ts
console.log(identity.toString()) // Ver la identidad trampilla y anulador.
// '["8255d...", "62c41..."]'
```
La matriz contiene la trapdoor y el nullifier.
Para reutilizar la identidad guardada, transforme la cadena JSON al constructor `Identity()`.
```ts
const identity2 = new Identity(identity.toString())
```

View File

@@ -0,0 +1,128 @@
---
sidebar_position: 3
title: Pruebas
---
import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"
# Pruebas Semaphore
Una vez que un usuario liga su [identidad Semaphore](/glossary#semaphore-identity) a un [grupo Semaphore](/glossary#semaphore-group), el usuario puede emitir una señal anónima con una prueba de conocimiento cero (ZKP) que demuestre lo siguiente:
- el usuario es un miembro del grupo,
- el mismo usuario creo tanto la señal como la prueba.
Las y los desarrolladores pueden utilizar Semaphore para realizar las siguientes acciones:
- [**Generar una prueba externa a la cadena (off-chain)**](#generate-a-proof-off-chain)
- [**Verificar una prueba externa a la cadena (off-chain)**](#verify-a-proof-off-chain)
- [**Verificar una prueba interna a la cadena (on-chain)**](#verify-a-proof-on-chain)
## Generar una prueba off-chain
Utilice la librería [`@semaphore-protocol/proof`](https://github.com/semaphore-protocol/semaphore/tree/main/packages/proof) para generar una prueba off-chain.
Para generar una prueba, transforme los siguientes parámetros con la función `generateProof`:
- `identity`: la identidad Semaphore del usuario emitiendo la señal y generando la prueba;
- `group`: el grupo al cual pertenece el usuario;
- `externalNullifier`: el valor que impide la emisión de dos señales por el mismo usuario;
- `signal`: la señal que el usuario quiere enviar de forma anónima;
- `snarkArtifacts`: la `zkey` y `wasm` de los [archivos confiables de configuración](/glossary/#trusted-setup-files).
#### Instalar librería:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
{label: 'pnpm', value: 'pnpm'}
]}>
<TabItem value="npm">
```bash
npm install @semaphore-protocol/proof@^3
```
</TabItem>
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/proof@^3
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm add @semaphore-protocol/proof@^3
```
</TabItem>
</Tabs>
En el caso de uso de un sistema de votación, una vez que todos los votantes hayan ligado sus [identidades](/guides/identities#create-an-identity) al [grupo](/guides/groups) de la votación,
un votante puede generar una prueba para votar por una propuesta.
En el llamado para `generateProof`(generar la prueba), el sistema de votación envía el ID único de la votación (la raíz del [árbol de Merkle](/glossary/#merkle-tree/) del grupo) como el
`externalNullifier` para impedir que el votante emita más de una señal para esta votación.
La siguiente muestra de código demuestra cómo utilizar `generateProof` para generar una prueba de votación:
```ts
import { generateProof } from "@semaphore-protocol/proof"
const externalNullifier = group.root
const signal = 1
const fullProof = await generateProof(identity, group, externalNullifier, signal, {
zkeyFilePath: "./semaphore.zkey",
wasmFilePath: "./semaphore.wasm"
})
```
:::info
Si estás generando la prueba en el lado del cliente, puedes evitar agregar los artefactos de snark porque se obtienen automáticamente:
```ts
const fullProof = await generateProof(identity, group, externalNullifier, signal)
```
:::
## Verificar una prueba off-chain
Utilice la librería [`@semaphore-protocol/proof`](https://github.com/semaphore-protocol/semaphore/tree/main/packages/proof) para verificar una prueba Semaphore off-chain.
Para verificar una prueba, transforme los siguientes parámetros con la función `verifyProof`:
- `fullProof`: la prueba Semaphore;
- `treeDepth`: la profundidad del árbol de Merkle.
La siguiente muestra de código demuestra cómo verificar la prueba generada previamente:
```ts
import { verifyProof } from "@semaphore-protocol/proof"
await verifyProof(fullProof, 20) // verdadero o falso.
```
`verifyProof` devolverá una Promesa que determina uno de los dos valores `verdadero` o `falso`.
## Verificar una prueba on-chain
Utilice el contrato [`Semaphore.sol`](/technical-reference/contracts#semaphoresol) para verificar pruebas on-chain.
:::info
Vea nuestros [contratos desplegados](/deployed-contracts) para encontrar las direcciones adecuadas para su red.
::::
Para verificar las pruebas Semaphore en su contrato, importe `ISemaphore.sol`, transfórmelo a la dirección `Semaphore.sol` y llame el método `verifyProof` con los siguientes parámetros:
- `groupId`: el identificador del grupo;
- `merkleTreeRoot`: la raíz del árbol de Merkle;
- `signal`: la señal que el usuario quiere enviar de forma anónima ;
- `nullifierHash`: un [nullifier hash](#retrieve-a-nullifier-hash) (hash anulador);
- `externalNullifier`: el valor que impide la emisión de dos señales por el mismo usuario;
- `proof`: una [prueba Semaphore que es compatible con Solidity](#generate-a-solidity-compatible-proof).
:::info
Puede importar `ISemaphore.sol` y otros contratos Semaphore del módulo NPM [`@semaphore-protocol/contracts`](https://github.com/semaphore-protocol/semaphore/tree/main/packages/contracts).
:::

View File

@@ -0,0 +1,336 @@
---
sidebar_position: 2
---
import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"
# Configuración rápida
Semaphore ofrece un CLI oficial para configurar su proyecto con Hardhat. Si su NPM es versión 5.2 or más reciente puede utilizar NPX:
```bash
npx @semaphore-protocol/cli@^3 create my-app --template monorepo-ethers
```
De lo contrario, instale `@semaphore-protocol/cli@^3` de forma global y corra el comando `init`:
```bash
npm i -g @semaphore-protocol/cli@^3
semaphore create my-app --template monorepo-ethers
```
:::info
Los templates soportados son: [`contracts-hardhat`](https://github.com/semaphore-protocol/semaphore/tree/main/packages/cli-template-contracts-hardhat), [`monorepo-ethers`](https://github.com/semaphore-protocol/semaphore/tree/main/packages/cli-template-monorepo-ethers), [`monorepo-subgraph`](https://github.com/semaphore-protocol/semaphore/tree/main/packages/cli-template-monorepo-subgraph)
:::
:::info
El CLI [`semaphore`](https://github.com/semaphore-protocol/semaphore/tree/main/packages/cli) también se puede utilizar para obtener información de los grupos que existen dentro de las redes soportadas por Semaphore (por ejemplo: `semaphore get-groups --network goerli`).
:::
Para comenzar a trabajar en su proyecto, instale las siguientes dependencias:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
{label: 'pnpm', value: 'pnpm'}
]}>
<TabItem value="npm">
```bash
cd my-app
npm i
```
</TabItem>
<TabItem value="yarn">
```bash
cd my-app
yarn
```
</TabItem>
<TabItem value="pnpm">
```bash
cd my-app
pnpm install
```
</TabItem>
</Tabs>
## Output
El comando `create` creará un directorio con el nombre my-app (o cualquier nombre que usted escoja) dentro de la carpeta actual. Ese directorio contendrá la estructura inicial del proyecto, que incluye un contrato simple (contract), una tarea (task) para desplegar lo, algunas pruebas (test) y una aplicación de Next.js (la carpeta web-app) para interactuar con el contrato.
```
my-app
├── .yarn
├── apps
│ └── contracts
│ │ └── contracts
| │ │ └── Feedback.sol
│ │ └── scripts
| │ │ └── download-snark-artifacts.ts
│ │ └── tasks
| │ │ └── deploy.ts
│ │ └── test
| │ │ └── Feedback.ts
│ │ └── hardhat.config.ts
│ │ └── package.json
│ │ └── tsconfig.json
│ └── web-app
├── scripts
│ └── copy-contracts-artifacts.ts
├── .editorconfig
├── .env
├── .env.example
├── .eslintignore
├── .eslintrc.json
├── .gitignore
├── .prettierignore
├── .prettierrc.json
├── .yarnrc.yml
├── package.json
├── README.md
└── tsconfig.json
```
El contrato `Feedback.sol` crea un grupo Semaphore, permite que los usuarios se unan a ese grupo con su identidad Semaphore, y, finalmente, permite que los miembros de ese grupo envíen un feedback anónimo.
## Uso
### Compilar contratos
Vaya a la carpeta `contracts`:
```bash
cd apps/contracts
```
Y compile sus contratos al correr:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
{label: 'pnpm', value: 'pnpm'}
]}>
<TabItem value="npm">
```bash
npm run compile
```
</TabItem>
<TabItem value="yarn">
```bash
yarn compile
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm compile
```
</TabItem>
</Tabs>
### Pruebe los contratos
Pruebe sus contratos al correr:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
{label: 'pnpm', value: 'pnpm'}
]}>
<TabItem value="npm">
```bash
npm test
```
</TabItem>
<TabItem value="yarn">
```bash
yarn test
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm test
```
</TabItem>
</Tabs>
Genere un reporte de la prueba de cobertura:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
{label: 'pnpm', value: 'pnpm'}
]}>
<TabItem value="npm">
```bash
npm run test:coverage
```
</TabItem>
<TabItem value="yarn">
```bash
yarn test:coverage
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm test:coverage
```
</TabItem>
</Tabs>
O un reporte de la prueba de gas:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
{label: 'pnpm', value: 'pnpm'}
]}>
<TabItem value="npm">
```bash
npm run test:report-gas
```
</TabItem>
<TabItem value="yarn">
```bash
yarn test:report-gas
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm test:report-gas
```
</TabItem>
</Tabs>
### Desplegar contratos
Siga las instrucciones a continuación para desplegar sus contratos:
En la carpeta raíz del proyecto:
1. Agregue sus variables de entorno en el archivo `.env`.
:::note
Deberá por lo menos configurar un URL válido en Ethereum (ejemplo: Infura) y una llave privada con algunos ethers.
:::
2. Vaya a la carpeta `apps/contracts` y desplegue su contrato.
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
{label: 'pnpm', value: 'pnpm'}
]}>
<TabItem value="npm">
```bash
npm run deploy -- --semaphore <semaphore-address> --group <group-id> --network goerli
```
</TabItem>
<TabItem value="yarn">
```bash
yarn deploy --semaphore <semaphore-address> --group <group-id> --network goerli
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm deploy --semaphore <semaphore-address> --group <group-id> --network goerli
```
</TabItem>
</Tabs>
:::note
Revise las direcciones de los contratos de Semaphore [aquí](/deployed-contracts).
:::
:::caution
El group id (id del grupo) es un número.
:::
### Inicie la app
Inicie la aplicación:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
{label: 'pnpm', value: 'pnpm'}
]}>
<TabItem value="npm">
```bash
npm run dev
```
</TabItem>
<TabItem value="yarn">
```bash
yarn dev
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm dev
```
</TabItem>
</Tabs>

View File

@@ -0,0 +1,33 @@
---
sidebar_position: 9
---
# Recursos
## Artículos
[Propuesta de la comunidad: Semaphore: Señalización de conocimiento cero (ZK) en Ethereum (v1 Whitepaper)](https://docs.semaphore.pse.dev/whitepaper-v1.pdf) - Kobi Gurkan, Koh Wei Jie y Barry WhiteHat
[Para Mezcladores y más allá: presentando Semaphore, una herramienta de privacidad construida en Ethereum](https://medium.com/coinmonks/to-mixers-and-beyond-presenting-semaphore-a-privacy-gadget-built-on-ethereum-4c8b00857c9b) - Koh Wei Jie
[¡La versión 2 de Semaphore está lista!](https://medium.com/privacy-scaling-explorations/semaphore-v2-is-live-f263e9372579) - Privacy and Scaling Explorations
## Videos
[Privacidad en Ethereum](https://www.youtube.com/watch?v=maDHYyj30kg) - Barry WhiteHat en el Meetup de Ethereum en Taipei
[Snarks para mezclar, enviar señales y escalabilidad](https://www.youtube.com/watch?v=lv6iK9qezBY) - Barry WhiteHat en Devcon 4
[Privacidad en Ethereum](https://www.youtube.com/watch?v=zBUo7G95wYE) - Barry WhiteHat en Devcon 5
[Un mezclador de Ethereum trustless utilizando señalizaciones de conocimiento cero (ZK)](https://www.youtube.com/watch?v=GzVT16lFOHU) - Koh Wei Jie y Barry WhiteHat en Devcon 5
[Implementación de aplicaciones de señalizaciones de conocimiento cero (ZK)](https://www.youtube.com/watch?v=7wd2aAN2jXI) - Koh Wei Jie en Devcon 5
[Roadmap para Semaphore en Ethereum](https://www.youtube.com/watch?v=gOub903iWFs) - Barry WhiteHat en Zcon1
[Pruebas concisas en Ethereum](https://www.youtube.com/watch?v=TtsDNneTDDY) - Barry WhiteHat en el 2ndo ZKProof Workshop
[Propuesta: Semaphore - Señalización de conocimiento cero (ZK) en Ethereum](https://www.youtube.com/watch?v=y5uV9eRb3-w) - Kobi Gurkan y Koh Wei Jie en el ZKProof Home Edition
[Señalizaciones anónimas en Ethereum](https://www.youtube.com/watch?v=dxAfL91Sbw4) - Cedoor en Devcon 6 Bogotá

View File

@@ -0,0 +1,51 @@
---
sidebar_position: 6
---
# Subgrafo
[The Graph](https://thegraph.com/) es un protocolo para indexar redes como Ethererum o IPFS.
Las personas dueñas de los sitios publica _subgrafos_ que exponen los datos del sitio para que cualquiera los pueda consultar.
El subgrafo de Semaphore le permite obtener datos del contrato inteligente [`Semaphore.sol`](https://github.com/semaphore-protocol/semaphore/blob/main/packages/contracts/Semaphore.sol).
:::tip
El protocolo The Graph utiliza el lenguaje de consulta [GraphQL](https://graphql.org/). Para ver ejemplos visite [GraphQL API documentation](https://thegraph.com/docs/developer/graphql-api). Para ver la lista de subgrafos de Semaphore visite el [repositorio de subgrafos](https://github.com/semaphore-protocol/subgraph).
:::
## Esquema
### Árbol de Merkle
- `id`: identificador único entre todas las entidades de árboles de Merkle,
- `depth`: profundidad del árbol de Merkle,
- `root`: raíz del árbol de Merkle,
- `zeroValue`: valor cero del árbol de Merkle,
- `numberOfLeaves`: número total de hojas en el árbol,
- `group`: link a la entidad del grupo.
### Grupo
- `id`: identificador único entre todas las entidades del grupo,
- `merkleTree`: link a la entidad del árbol de Merkle,
- `timestamp`: timestamp (registro de tiempo) del bloque,
- `admin`: administrador del grupo,
- `members`: lista de los miembros del grupo,
- `verifiedProofs`: lista de las pruebas del grupo.
### Miembro
- `id`: identificador único entre todos los miembros,
- `identityCommitment`: compromiso de identidad Semaphore,
- `timestamp`: timestamp del bloque,
- `index`: índice de la hoja del árbol,
- `group`: link a la entidad del grupo.
### PruebaVerificada
- `id`: identificador único entre todas las entidades con una prueba verificada (VerifiedProof),
- `signal`: señal del usuario,
- `merkleTreeRoot`: raíz del árbol de Merkle,
- `nullifierHash`: hash nullifier (anulador),
- `externalNullifier`: nullifier externo,
- `timestamp`: timestamp del bloque,
- `group`: link a la entidad del grupo.

View File

@@ -0,0 +1,4 @@
{
"label": "Technical reference",
"position": 4
}

View File

@@ -0,0 +1,57 @@
---
sidebar_position: 2
---
# Circuitos
El [circuito Semaphore](https://github.com/semaphore-protocol/semaphore/tree/main/packages/circuits) es el corazón del protocolo y está compuesto por tres partes:
- [**Prueba de membresía**](/technical-reference/circuits#proof-of-membership)
- [**Nullifier hash**](/technical-reference/circuits#nullifier-hash) (hash anulador)
- [**Señal**](/technical-reference/circuits#signal)
![Semaphore circuit](https://github.com/semaphore-protocol/semaphore/raw/main/packages/circuits/scheme.png)
El diagrama anterior muestra cómo se utilizan las señales de entrada en el circuito Semaphore y cómo se calculan los resultados.
## Prueba de membresía
El circuito resume criptográficamente (hashes) el nullifier hash de la identidad utilizando la identity trapdoor (identidad trampilla) para generar el compromiso de identidad. Después de esto, el circuito verifica la prueba de membresía contra la raíz de Merkle y el compromiso de identidad.
**Insumos (inputs) privados:**
- `treeSiblings[nLevels]`: los valores a lo largo del camino de Merkle rumbo al compromiso de identidad del usuario,
- `treePathIndices[nLevels]`: la dirección (0/1) por nivel del árbol correspondiente al camino de Merkle rumbo al compromiso de identidad del usuario,
- `identityNullifier`: la identidad secreta de 32-bits utilizada como anulador,
- `identityTrapdoor`: la identidad secreta de 32-bits utilizada como trampilla.
**Resultados (outputs) públicos:**
- `root`: La raíz de Merkle del árbol.
## Hash anulador (Nullifier hash)
El circuito resume criptográficamente (hashes) el identity nullifier con el nullifier externo y después revisa que el resultado coincida con el nullifier hash provisto.
Los nullifier hashes guardados en un contrato inteligente Semaphore permiten que el contrato rechace las pruebas que contengan un nullifier hash ya utilizado.
**Insumos (inputs) privados:**
- `identityNullifier`: el identity secret (secreto de identidad) de 32 bits que se utiliza como nullifier.
**Insumos (inputs) públicos:**
- `externalNullifier`: el nullifier externo de 32 bits.
**Resultados (outputs) públicos:**
- `nullifierHash`: el hash del identity nullifier y del nullifier externo; se utiliza para prevenir que el mismo usuario emita dos señales.
**Procedimiento:**
## Señal
El circuito calcula un cuadrado ficticio del hash de la señal para prevenir que se altere la prueba.
**Insumos (inputs) públicos:**
- `signalHash`: El hash de la señal del usuario.

View File

@@ -0,0 +1,50 @@
---
sidebar_position: 3
---
# Contratos
Semaphore incluye dos tipos de contratos:
- [**Contratos base**](/technical-reference/contracts#base-contracts)
- [**Contratos para la extensión**](/technical-reference/contracts#extension-contracts)
así como [**Semaphore.sol**](/technical-reference/contracts#semaphoresol), el principal contrato desplegado en las redes soportadas por Semaphore.
:::info
Para utilizar los contratos e interfaces Semaphore en su proyecto, instale el paquete NPM [`@semaphore-protocol/contracts`](https://github.com/semaphore-protocol/semaphore/tree/main/packages/contracts).
:::
## Contratos base
Semaphore ofrece los siguientes contratos base:
- [`SemaphoreVerifier.sol`](https://github.com/semaphore-protocol/semaphore/blob/main/packages/contracts/base/SemaphoreVerifier.sol): contiene una función para verificar pruebas Semaphore;
- [`SemaphoreGroups.sol`](https://github.com/semaphore-protocol/semaphore/blob/main/packages/contracts/base/SemaphoreGroups.sol): contiene las funciones para crear grupos y añadir/remover/actualizar miembros.
Los contratos base están relacionados de forma muy cercana al protocolo.
Puede utilizarlos en su contrato o puede utilizar [**Semaphore.sol**](/technical-reference/contracts#semaphoresol) que ya los tiene integrados.
:::info
Si bien algunas dApps pueden utilizar grupos internos a la cadena, otros puede que prefieran utilizar grupos externos a la cadena, por lo que únicamente guardarán las raíces de sus árboles en el contrato.
:::
## Contratos para la extensión
- [`SemaphoreVoting.sol`](https://github.com/semaphore-protocol/semaphore/blob/main/packages/contracts/extensions/SemaphoreVoting.sol): contrato para votaciones que contiene las funciones esenciales para crear encuestas, añadir electores, y emitir votos de forma anónima;
- [`SemaphoreWhistleblowing.sol`](https://github.com/semaphore-protocol/semaphore/blob/main/packages/contracts/extensions/SemaphoreWhistleblowing.sol): contrato para denuncias que contiene las funciones esenciales para crear entidades (por ejemplo: organizaciones sin fines de lucro), añade denunciantes, y filtraciones publicadas de forma anónima.
Estos contratos extienden las capacidades del protocolo y proveen una aplicación lógica para casos de uso específicos.
En un futuro se incluirán más extensiones.
## Semaphore.sol
[`Semaphore.sol`](https://github.com/semaphore-protocol/semaphore/blob/main/packages/contracts/contracts/Semaphore.sol) utiliza los contratos base como punto de partida, los integra y de forma adicional brinda:
- un sistema que solamente permite que administradores (ej. cuentas de Ethereum o contratos inteligentes) controlen grupos;
- un mecanismo que guarda los [hashes anuladores](/technical-reference/circuits#nullifier-hash) (nullifier hashes) de cada grupo y evita que el mismo miembro emita dos señales;
- un mecanismo que permite que pruebas Semaphore generadas con raíces de Merkle antiguas sean verificadas por un periodo de tiempo determinado por el administrador del grupo.
:::info
Visitando [contratos desplegados](/deployed-contracts) puede encontrar las direcciones correspondientes a su red.
::::

View File

@@ -0,0 +1,239 @@
---
sidebar_position: 11
---
import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"
# Solución de problemas
Si estas sugerencias no funcionan, no dude en preguntar en las [Semaphore Discussions](https://github.com/semaphore-protocol/semaphore/discussions) o en el canal `dev-chat` en el [Semaphore Discord](https://semaphore.pse.dev/discord).
## Usando Semaphore en the frontend
Semaphore funciona con cualquier framework de JavaScript, pero el paquete [`@semaphore-protocol/proof`](https://github.com/semaphore-protocol/semaphore/tree/main/packages/proof) está usando [snarkjs](https://github.com/iden3/snarkjs), que usa módulos Node.js que no son compatibles con los frameworks de frontend y hay algunos cambios que debemos hacer para que funcione en el lado del cliente.
### Semaphore con Nextjs
Verá un error como este:
```
Module not found: Can't resolve 'fs'
```
Para resolver esto, en su archivo `next.config.js`, dentro del objeto `nextConfig`, agregue:
```javascript
webpack: (config, { isServer }) => {
if (!isServer) {
config.resolve.fallback = {
fs: false
}
}
return config
}
```
Su fichero `next.config.js` sería algo como esto:
```javascript
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
webpack: (config, { isServer }) => {
if (!isServer) {
config.resolve.fallback = {
fs: false
}
}
return config
}
}
module.exports = nextConfig
```
### Semaphore con React + Vite o Vuejs + Vite
Verá un error como este:
```bash
readman.js:43 Uncaught ReferenceError: process is not defined
at stringToBase64 (threadman.js:43:5)
at threadman.js:50:22
```
Para resolver eso:
1- Instale `@esbuild-plugins/node-globals-polyfill` y `@esbuild-plugins/node-modules-polyfill`
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
{label: 'pnpm', value: 'pnpm'}
]}>
<TabItem value="npm">
```bash
npm install @esbuild-plugins/node-globals-polyfill
```
</TabItem>
<TabItem value="yarn">
```bash
yarn add @esbuild-plugins/node-globals-polyfill
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm add @esbuild-plugins/node-globals-polyfill
```
</TabItem>
</Tabs>
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
{label: 'pnpm', value: 'pnpm'}
]}>
<TabItem value="npm">
```bash
npm install @esbuild-plugins/node-modules-polyfill
```
</TabItem>
<TabItem value="yarn">
```bash
yarn add @esbuild-plugins/node-modules-polyfill
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm add @esbuild-plugins/node-modules-polyfill
```
</TabItem>
</Tabs>
2- Modifique `vite.config.ts` para añadirlos:
```typescript
import { NodeGlobalsPolyfillPlugin } from "@esbuild-plugins/node-globals-polyfill"
import { NodeModulesPolyfillPlugin } from "@esbuild-plugins/node-modules-polyfill"
```
y en `defineConfig` agregue:
```typescript
optimizeDeps: {
esbuildOptions: {
// Enable esbuild polyfill plugins
plugins: [
NodeGlobalsPolyfillPlugin({
process: true,
buffer: true
}),
NodeModulesPolyfillPlugin()
]
}
}
```
Su fichero `vite.config.ts` debería ser algo como:
```typescript
import { fileURLToPath, URL } from "node:url"
import { defineConfig } from "vite"
import vue from "@vitejs/plugin-vue"
import { NodeGlobalsPolyfillPlugin } from "@esbuild-plugins/node-globals-polyfill"
import { NodeModulesPolyfillPlugin } from "@esbuild-plugins/node-modules-polyfill"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url))
}
},
optimizeDeps: {
esbuildOptions: {
// Enable esbuild polyfill plugins
plugins: [
NodeGlobalsPolyfillPlugin({
process: true,
buffer: true
}),
NodeModulesPolyfillPlugin()
]
}
}
})
```
:::info
En caso de React con Vite, si ve un subrayado ondulado rojo en cada módulo Semaphore que dice `Could not find a declaration file for module ...`, cambie el `moduleResolution` de `bundler` a `Node` en el fichero `tsconfig.json` dentro de `compilerOptions`.
Su fichero `tsconfig.json` sería algo así:
```json
{
"compilerOptions": {
"target": "ESNext",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "Node",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}
```
:::
## Grupos de Semaphore
### Creando un Grupo
Cuando crea un grupo y se revierte la transacción, asegúrese de que la identificación del grupo que está utilizando no existe en la red que está utilizando.
Para comprobarlo, puede utilizar la [Semaphore CLI](https://github.com/semaphore-protocol/semaphore/tree/main/packages/cli) con el comando `get-groups` y la red que está utilizando y luego, asegúrese de que su id de grupo no sea parte de esa lista. También puede utilizar el [Semaphore explorer](https://explorer.semaphore.pse.dev/).
## Semaphore Proofs
### Transacción revertida al usar el mismo external nullifier
Cuando genera una prueba usando el mismo external nullifier que usó para verificar una prueba antes, la transacción se revertirá porque ese external nullifier ya se usó. Si desea enviar y verificar varias pruebas de la misma identidad, debe usar un external nullifier diferente cada vez que genere una prueba.

View File

@@ -0,0 +1,54 @@
---
id: introduction
title: ¿Qué es Semaphore?
sidebar_position: 1
slug: /
---
## General
[Semaphore](https://github.com/semaphore-protocol/semaphore) es un protocolo que utiliza [conocimiento cero (zero-knowledge)](https://z.cash/technology/zksnarks) y permite emitir una señal (por ejemplo: un voto o una aprobación) como una persona probablemente miembro de un grupo sin revelar su identidad.
Además, proporciona un mecanismo sencillo para impedir que un mismo usuario emita dos señales.
Algunos de los potenciales casos de uso son: votaciones, denuncias, DAOs anónimas y mezcladores.
## Características
Con Semaphore puede permitir que sus usuarios realicen las siguientes acciones:
1. [Crear una identidad Semaphore](/guides/identities/).
2. [Agregar su identidad Semaphore a un grupo (es decir: _Árbol de Merkle_)](/guides/groups/).
3. [Enviar una señal anónima, verificable (ej. un voto o una aprobación)](/guides/proofs/).
Cuando un usuario emite una señal (por ejemplo: un voto), las pruebas de conocimiento cero (ZKP) pueden asegurar que el usuario se ha incorporado al grupo y aún no ha emitido una señal con su nullifier (anulador).
Semaphore utiliza contratos internos a la cadena en Solidity y librerías de JavaScript externas a la cadena que funcionan de forma conjunta.
- Externos a la cadena (off-chain), se pueden utilizar librerías de Javascript para crear identidades, organizar grupos y generar pruebas.
- Internos a la cadena (on-chain), se pueden utilizar contratos en Solidity para organizar grupos y verificar pruebas.
## Beneficios para desarrolladores
Semaphore está diseñado para ser un _componente de privacidad_ simple y genérico para aplicaciones descentralizadas (dApps) en Ethereum. Promueve el diseño modular de las aplicaciones, lo que permite que los desarrolladores de las dApps escojan y personalicen los componentes que necesitan externos e internos a la cadena.
## Respecto al código
La base del protocolo es la [lógica de circuitos](https://github.com/semaphore-protocol/semaphore/tree/main/packages/circuits/scheme.png) (circuit logic).
Además de los circuitos,
Semaphore ofrece [contratos en Solidity](https://github.com/semaphore-protocol/semaphore/tree/main/packages/contracts)
y [librerías en JavaScript](https://github.com/semaphore-protocol/semaphore#-packages) que permiten que los desarrolladores generen pruebas de conocimiento cero (ZKP) y las verifiquen con un esfuerzo mínimo.
### Ceremonia de configuración de confianza (Trusted Setup Ceremony)
Los [parámetros seguros](/glossary#trusted-setup-files) para generar pruebas válidas con los circuitos Semaphore fueron generados en una [ceremonia de configuración de confianza](https://storage.googleapis.com/trustedsetup-a86f4.appspot.com/semaphore/semaphore_top_index.html) que se completó con más de 300 participantes el [29 de Marzo de 2022](https://etherscan.io/tx/0xec6dbe68883c7593c2bea82f55af18b3aeb5cc146e026d0083a9b3faa9aa0b65#eventlog).
### Auditorías
| Versión | Auditores | Reporte | Alcance |
| ------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| v2.0.0 | [PSE](https://pse.dev/) | [Semaphore_2.0.0_Audit.pdf](https://github.com/semaphore-protocol/semaphore/files/9850441/Semaphore_2.0.0_Audit.pdf) | `circuits`, `contracts` |
| v2.5.0 | [PSE](https://pse.dev/) | [Semaphore_2.5.0_Audit.pdf](https://github.com/semaphore-protocol/semaphore/files/9845008/Semaphore_2.5.0_Audit.pdf) | `contracts`, `libraries` |
| v3.0.0 | [Veridise](https://veridise.com/) | [Semaphore_3.0.0_Audit.pdf](https://github.com/semaphore-protocol/semaphore/files/9845008/Semaphore_2.5.0_Audit.pdf) | `circuits`, `contracts` |
:::info
Si está utilizando una de las versiones anteriores de Semaphore, vea la documentación de [Semaphore V1](/V1) o de [Semaphore V2](/V2).
:::

View File

@@ -0,0 +1,11 @@
{
"item.label.Whitepaper": {
"message": "Whitepaper"
},
"item.label.Documentation": {
"message": "Documentación"
},
"item.label.Github": {
"message": "Github"
}
}

50
apps/docs/package.json Normal file
View File

@@ -0,0 +1,50 @@
{
"name": "semaphore-docs",
"private": true,
"scripts": {
"start": "docusaurus start",
"start:es": "docusaurus start --locale es",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "3.1.1",
"@docusaurus/preset-classic": "3.1.1",
"@mdx-js/react": "^3.0.0",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.2.1",
"docusaurus-plugin-sass": "^0.2.5",
"file-loader": "^6.2.0",
"prism-react-renderer": "^2.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sass": "^1.52.3",
"url-loader": "^4.1.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.1.1",
"@docusaurus/tsconfig": "3.1.1",
"@types/react": "^18.2.29",
"typescript": "~5.2.2"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"engines": {
"node": ">=18.0"
}
}

29
apps/docs/sidebars.js Normal file
View File

@@ -0,0 +1,29 @@
/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation
The sidebars can be generated from the filesystem, or explicitly defined here.
Create as many sidebars as you want.
*/
// @ts-check
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
module.exports = {
// By default, Docusaurus generates a sidebar from the docs folder structure
tutorialSidebar: [{ type: "autogenerated", dirName: "." }]
// But you can create a sidebar manually
/*
tutorialSidebar: [
{
type: 'category',
label: 'Tutorial',
items: ['hello'],
},
],
*/
}

View File

@@ -0,0 +1,25 @@
import React, { useEffect, useState } from "react"
export default function Articles() {
const [articles, setArticles] = useState<any[]>([])
useEffect(() => {
fetch("https://raw.githubusercontent.com/semaphore-protocol/semaphore/main/apps/website/src/data/articles.json")
.then((response) => response.json())
.catch(() => [])
.then(setArticles)
}, [])
return (
<ul>
{articles.map((article) => (
<li key={article.url + article.title}>
<a href={article.url} target="_blank" rel="noreferrer">
{article.title}
</a>{" "}
- {article.authors.join(", ")} (<i>{article.date}</i>)
</li>
))}
</ul>
)
}

View File

@@ -0,0 +1,56 @@
import Heading from "@theme/Heading"
import { useEffect, useState } from "react"
function capitalizeFirstLetter(s: string): string {
return s.charAt(0).toUpperCase() + s.slice(1)
}
function getEtherscanLink(network: string): string {
switch (network) {
case "sepolia":
return "https://sepolia.etherscan.io/address/"
case "mumbai":
return "https://mumbai.polygonscan.com/address/"
case "arbitrum":
return "https://arbiscan.io/address/"
case "arbitrum-sepolia":
return "https://sepolia.arbiscan.io/address/"
case "optimism-sepolia":
return "https://sepolia-optimism.etherscan.io/address/"
default:
return ""
}
}
export default function DeployedContracts() {
const [deployedContracts, setDeployedContracts] = useState<any[]>([])
useEffect(() => {
fetch(
"https://raw.githubusercontent.com/semaphore-protocol/semaphore/feat/semaphore-v4/packages/contracts/deployed-contracts.json"
)
.then((response) => response.json())
.catch(() => [])
.then(setDeployedContracts)
}, [])
return (
<div>
{deployedContracts.map(({ network, contracts }) => (
<div key={network}>
<Heading as="h2">{capitalizeFirstLetter(network)}</Heading>
<ul>
{contracts.map(({ name, address }) => (
<li key={address}>
{name}:{" "}
<a href={getEtherscanLink(network) + address} target="_blank" rel="noreferrer">
{address}
</a>
</li>
))}
</ul>
</div>
))}
</div>
)
}

View File

@@ -0,0 +1,21 @@
import React, { useEffect, useState } from "react"
import CodeBlock from "@theme/CodeBlock"
export default function RemoteCode({ url, language, title }: { url: string; language: string; title: string }) {
const [code, setCode] = useState<string>("")
useEffect(() => {
fetch(url)
.then((response) => response.text())
.catch(() => "")
.then((text) => setCode(text))
}, [url])
return (
<div>
<CodeBlock language={language} title={title} showLineNumbers>
{code}
</CodeBlock>
</div>
)
}

View File

@@ -0,0 +1,25 @@
import React, { useEffect, useState } from "react"
export default function Videos() {
const [videos, setVideos] = useState<any[]>([])
useEffect(() => {
fetch("https://raw.githubusercontent.com/semaphore-protocol/semaphore/main/apps/website/src/data/videos.json")
.then((response) => response.json())
.catch(() => [])
.then(setVideos)
}, [])
return (
<ul>
{videos.map((video) => (
<li key={video.url + video.title}>
<a href={video.url} target="_blank" rel="noreferrer">
{video.title}
</a>{" "}
- {video.speakers.join(", ")} at <u>{video.eventName}</u> (<i>{video.date}</i>)
</li>
))}
</ul>
)
}

View File

@@ -0,0 +1,21 @@
import React from "react"
export type IconArrowTopRightProps = {
width?: number
height?: number
}
export default function IconArrowTopRight({ width = 13, height = 13 }: IconArrowTopRightProps): JSX.Element {
return (
<svg
className="custom-icon"
width={width}
height={height}
viewBox="0 0 14 14"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M5.85868 0.495117L5.85398 2.49512L10.4116 2.50578L0.808105 12.09L2.2209 13.5056L11.8507 3.89516L11.8399 8.50917L13.8399 8.51377L13.8587 0.513817L5.85868 0.495117Z" />
</svg>
)
}

View File

@@ -0,0 +1,423 @@
/**
* Any CSS included here will be global. The classic template
* bundles Infima by default. Infima is a CSS framework designed to
* work well for content-centric websites.
*/
/* You can override the default Infima variables here. */
@font-face {
font-family: "DM Sans";
src: url("/static/fonts/DMSans.ttf") format("truetype");
font-weight: 400;
font-style: normal;
}
:root {
--ifm-color-primary: "linear(to-r, #4771ea, #2735a6)";
--ifm-color-primary-dark: #3555df;
--ifm-color-primary-darker: #2735a6;
--ifm-color-primary-darkest: #1b2050;
--ifm-color-primary-light: #9abaf6;
--ifm-color-primary-lighter: #c3d4fa;
--ifm-color-primary-lightest: #f0f4fe;
--custom-dark-4: #0c0c15;
--custom-dark-3: #00020d;
--custom-dark-2: #26262b;
--custom-dark-1: #1b2050;
--custom-gray-2: #26262b;
--custom-gray-1: #eeeef0;
--custom-gray-0: #f7f7f8;
--custom-blue-3: var(--ifm-color-primary);
--custom-blue-2: #3555df;
--custom-blue-1: #f0f4fe;
--custom-blue-0: #f8f9ff;
--collapse-button-bg-color-dark: #2e333a;
--ifm-code-font-size: 95%;
--ifm-h1-font-size: 1.75rem;
--ifm-h2-font-size: 1.5rem;
--ifm-h3-font-size: 1.25rem;
--ifm-h4-font-size: 1rem;
--ifm-h5-font-size: 0.875rem;
--ifm-h6-font-size: 0.85rem;
--ifm-toc-border-width: 1px;
/* --ifm-menu-color: var(--ifm-color-emphasis-900); */
--ifm-menu-color-background-active: transparent;
--ifm-menu-color-background-hover: transparent;
--ifm-global-shadow-lw: 0 1px 10px 0 rgba(0, 0, 0, 0.1);
--ifm-global-shadow-md: 0 5px 40px rgba(0, 0, 0, 0.1);
--ifm-global-shadow-tl: 0 12px 28px 0 rgba(0, 0, 0, 0.2), 0 2px 4px 0 rgba(0, 0, 0, 0.1);
--ifm-global-spacing: 1.5rem;
/* --ifm-navbar-background-color: rgba(255, 0.2); */
}
html[data-theme="dark"] {
--ifm-background-color: var(--custom-dark-3);
--ifm-color-primary: var(--custom-gray-1);
--custom-blue-2: #6a95f0;
--ifm-heading-color: var(--custom-gray-0);
--ifm-navbar-background-color: var(--custom-dark-3);
--ifm-toc-border-color: var(--custom-gray-2);
}
html[data-theme="light"] {
--ifm-background-color: var(--custom-gray-0);
--ifm-color-primary: var(--custom-dark-1);
--ifm-heading-color: var(--custom-dark-2);
--ifm-navbar-background-color: var(--custom-gray-0);
--ifm-toc-border-color: var(--custom-gray-1);
}
html {
font-family: "DM Sans", sans-serif;
font-size: 18px;
font-variant: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
font-feature-settings: "ss01" on, "ss02" on, "cv01" on, "cv03" on;
font-weight: 400;
}
svg.custom-icon path,
svg.custom-icon react {
fill: var(--ifm-color-primary);
}
svg.custom-icon circle {
stroke: var(--ifm-color-primary);
}
p {
font-family: "DM Sans", sans-serif;
line-height: 32px;
font-weight: 400;
}
hr {
border-bottom-width: 0px;
border-top-width: 1px;
border-color: var(--ifm-color-emphasis-200);
}
h1,
h2,
h3,
h4,
h5 {
font-weight: 500;
}
h1 {
font-size: 52px;
}
h2 {
font-size: 32px;
}
h3 {
font-size: 24px;
}
h4 {
font-size: 20px;
}
h5 {
font-size: 10px;
}
.tocCollapsibleButton_node_modules-\@docusaurus-theme-classic-lib-next-theme-TOCCollapsible-styles-module {
padding-left: 0px !important;
}
.menu__link--sublist:after {
background: var(--ifm-menu-link-sublist-icon) 50% / 1.5rem 1.5rem;
/* color: var( --ifm-color-primary); */
}
.alert a {
text-decoration-color: inherit;
}
.navbar {
align-items: center;
box-shadow: none;
font-size: 18px;
.navbar__toggle {
margin-right: 20px;
}
.navbar-sidebar__brand {
margin-bottom: 16px;
padding: 12px 20px;
}
}
@media (max-width: 996px) {
.footer {
--ifm-footer-padding-horizontal: 20px;
}
}
html[data-theme="dark"] {
.navbar {
border-bottom: var(--ifm-toc-border-color) 1px solid;
}
.footer {
background-color: var(--custom-dark-4);
}
.markdown a {
color: var(--custom-blue-2);
}
h2 a {
color: var(--custom-blue-2);
}
input:focus,
select:focus {
border-color: var(--custom-blue-2);
}
li[role="tab"][aria-selected="true"] {
color: var(--custom-blue-2);
border-bottom-color: var(--custom-blue-2);
}
.badge--secondary {
--ifm-badge-background-color: var(--custom-blue-0);
color: var(--custom-dark-1);
}
}
html[data-theme="light"] {
.navbar {
border-bottom: var(--ifm-toc-border-color) 1px solid;
}
.footer {
background-color: var(--custom-blue-1);
}
.markdown a {
color: var(--custom-blue-2);
}
h2 a {
color: var(--custom-blue-3);
}
input:focus,
select:focus {
border-color: var(--custom-blue-3);
}
li[role="tab"][aria-selected="true"] {
color: var(--custom-blue-3);
border-bottom-color: var(--custom-blue-3);
}
.badge--secondary {
--ifm-badge-background-color: var(--custom-dark-1);
color: var(--custom-blue-0);
}
}
/* Navbar items visibility */
a.whitepaper-v1 {
display: none;
}
html.docs-version-V1 {
a.whitepaper-v1 {
display: inline-block;
}
}
.container {
padding: 0px;
/* margin: 4rem auto 0px; */
max-width: 90% !important;
}
.container.padding-top--md {
padding-top: 2rem !important;
}
.react-toggle-track {
background-color: var(--ifm-color-emphasis-100) !important;
}
.react-toggle-thumb {
background-color: var(--ifm-color-emphasis-200) !important;
}
.react-toggle-thumb:hover {
box-shadow: none !important;
}
.menu__link {
font-size: 18px;
font-weight: 400;
padding: 8px 16px;
}
html[data-theme="dark"] .navbar__logo {
filter: invert(100%) saturate(100%) brightness(100%) contrast(100%);
}
.docusaurus-highlight-code-line {
background-color: rgb(72, 77, 91);
display: block;
margin: 0 calc(-1 * var(--ifm-pre-padding));
padding: 0 var(--ifm-pre-padding);
color: var(--ifm-color-secondary-darker);
}
.badge {
margin-bottom: 16px;
}
html[data-theme="light"] .DocSearch {
/* --docsearch-primary-color: var(--ifm-color-primary); */
/* --docsearch-text-color: var(--ifm-font-color-base); */
--docsearch-muted-color: var(--ifm-color-emphasis-900);
--docsearch-container-background: rgba(94, 100, 112, 0.7);
/* Modal */
--docsearch-modal-background: var(--ifm-color-secondary-lighter);
/* Search box */
--docsearch-searchbox-background: var(--ifm-color-secondary);
--docsearch-searchbox-focus-background: var(--ifm-color-white);
--docsearch-searchbox-shadow: inset 0 0 0 2px var(--custom-blue-3);
/* Hit */
--docsearch-hit-color: var(--ifm-font-color-base);
--docsearch-hit-active-color: var(--ifm-color-white);
--docsearch-hit-background: var(--ifm-color-white);
--docsearch-highlight-color: var(--custom-blue-3);
/* Footer */
--docsearch-footer-background: var(--ifm-color-white);
}
html[data-theme="dark"] .DocSearch {
/* --docsearch-text-color: var(--ifm-font-color-100); */
--docsearch-muted-color: var(--ifm-color-secondary-darkest);
--docsearch-container-background: rgba(47, 55, 69, 0.7);
/* Modal */
--docsearch-modal-background: var(--ifm-background-color);
/* Search box */
--docsearch-searchbox-background: var(--ifm-background-color);
--docsearch-searchbox-focus-background: var(--ifm-color-black);
--docsearch-searchbox-shadow: inset 0 0 0 2px var(--custom-blue-2);
/* Hit */
--docsearch-hit-color: var(--ifm-font-color-base);
--docsearch-hit-active-color: var(--ifm-color-emphasis-700);
--docsearch-hit-background: var(--ifm-color-emphasis-100);
--docsearch-highlight-color: var(--custom-blue-2);
/* Footer */
--docsearch-footer-background: var(--ifm-background-surface-color);
--docsearch-key-gradient: linear-gradient(
-26.5deg,
var(--ifm-color-emphasis-200) 0%,
var(--ifm-color-emphasis-100) 100%
);
}
.react-toggle-thumb :hover {
border: none;
outline: none;
box-shadow: none;
}
.react-toggle-thumb :focus {
border: none;
outline: none;
box-shadow: none;
}
.react-toggle-thumb :active {
border: none;
outline: none;
box-shadow: none;
}
.menu {
/* background-color: var(--ifm-color-emphasis-0); */
padding: 1.5rem 1rem !important;
}
.dropdown__menu {
box-shadow: 0 5px 40px rgba(0, 0, 0, 0.1);
}
.menu__link:hover {
text-decoration: underline;
}
.menu__link--active {
font-weight: 600;
}
.table-of-contents {
opacity: 0.4;
}
.table-of-contents:hover {
opacity: 1;
}
.table-of-contents__link:hover {
text-decoration: underline;
}
.navbar__inner {
flex-wrap: unset;
}
.navbar__item {
display: inline-block;
}
.navbar__item.dropdown {
display: inline-block;
}
.menu__list-item--collapsed .menu__link {
display: flex;
}
.menu__link {
display: flex;
}
@media (max-width: 960px) {
.menu {
/* background-color: var(--ifm-color-emphasis-0); */
padding: initial !important;
}
.container {
max-width: 100% !important;
padding: 1rem;
}
.container.padding-top--md {
padding-top: initial;
}
.navbar__item {
display: none !important;
}
}

View File

@@ -0,0 +1,75 @@
import Link from "@docusaurus/Link"
import { translate } from "@docusaurus/Translate"
import Logo from "@theme/Logo"
import clsx from "clsx"
import React from "react"
import styles from "./styles.module.scss"
function Footer() {
return (
<footer className={clsx("footer")}>
<div className={clsx("container container-fluid", styles.container)}>
<div>
<div>
<h3>
{translate({
id: "footer.left.title"
})}
</h3>
<p>
{translate({
id: "footer.left.description"
})}
</p>
<Link href="https://pse.dev" target="_blank">
pse.dev
</Link>
</div>
<div>
<div>
<h3>
{translate({
id: "footer.right.connect.title"
})}
</h3>
<Link href="https://semaphore.pse.dev/discord" target="_blank">
{translate({
id: "footer.right.connect.link1"
})}
</Link>
<Link href="https://twitter.com/SemaphoreDevs" target="_blank">
{translate({
id: "footer.right.connect.link2"
})}
</Link>
<Link href="https://semaphore.pse.dev/github" target="_blank">
{translate({
id: "footer.right.learn.link1"
})}
</Link>
</div>
</div>
</div>
<hr />
<div>
<p>
{translate({
id: "footer.copyright"
})}
</p>
<Logo
style={{ marginRight: -8 }}
className="navbar__brand"
imageClassName="navbar__logo"
titleClassName="navbar__title text--truncate"
/>
</div>
</div>
</footer>
)
}
export default React.memo(Footer)

View File

@@ -0,0 +1,137 @@
.container {
display: flex;
flex-direction: column;
font-size: 14px;
a {
color: var(--custom-blue-2);
font-weight: bold;
font-size: 16px;
}
h3 {
font-weight: bold;
font-size: 18px;
white-space: nowrap;
}
> div:first-child {
display: flex;
margin-bottom: 20px;
> div:first-child {
flex: 1;
margin-right: 20px;
> p {
max-width: 400px;
}
}
> div:last-child {
flex: 1;
display: flex;
justify-content: right;
> div {
display: flex;
flex-direction: column;
margin-left: 200px;
> a {
margin-bottom: 5px;
}
}
}
}
> div:last-child {
display: flex;
justify-content: space-between;
margin-top: 20px;
> p {
margin: 0;
}
}
}
@media (max-width: 1280px) {
.container {
> div:first-child {
> div:last-child {
> div {
margin-left: 50px;
}
}
}
}
}
@media (max-width: 768px) {
.container {
> div:first-child {
flex-direction: column;
> div:first-child {
margin-bottom: 30px;
> p {
margin: 20px 0;
max-width: inherit;
}
}
> div:last-child {
justify-content: space-between;
> div {
margin-left: 0;
}
> p {
font-size: 16px;
font-weight: bold;
}
> a {
margin: 5px 0;
}
}
}
}
}
@media (max-width: 640px) {
.container {
> div:last-child {
> a {
display: none;
}
}
}
}
html[data-theme="light"] {
.container {
a {
color: var(--custom-blue-3);
}
}
hr {
border-color: var(--custom-gray-1);
}
}
html[data-theme="dark"] {
.container {
a {
color: var(--custom-blue-2);
}
}
hr {
border-color: var(--custom-dark-1);
}
}

View File

@@ -0,0 +1,18 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import IconArrowTopRight from "@site/src/components/icons/IconArrowTopRight"
import React from "react"
function IconExternalLink() {
return (
<span style={{ marginLeft: "0.6rem", position: "relative", top: "1px" }}>
<IconArrowTopRight />
</span>
)
}
export default IconExternalLink

View File

@@ -0,0 +1,6 @@
import SearchOriginal from "@theme-original/Navbar/Search"
import React from "react"
export default function Search(props: any) {
return <SearchOriginal {...props} />
}

View File

@@ -0,0 +1,53 @@
/* eslint-disable jsx-a11y/click-events-have-key-events */
/* eslint-disable jsx-a11y/control-has-associated-label */
import IconMoon from "@site/src/components/icons/IconMoon"
import IconSun from "@site/src/components/icons/IconSun"
import clsx from "clsx"
import React, { memo, useRef, useState } from "react"
import styles from "./styles.module.scss" // Based on react-toggle (https://github.com/aaronshaf/react-toggle/).
export const ToggleComponent = memo(({ className, checked: defaultChecked, disabled, onChange }: any) => {
const [checked, setChecked] = useState(defaultChecked)
const [focused, setFocused] = useState(false)
const inputRef = useRef(null)
return (
<div
className={clsx(styles.toggle, className, {
[styles.toggleChecked]: checked,
[styles.toggleFocused]: focused,
[styles.toggleDisabled]: disabled
})}
>
<div className={styles.toggleTrack} role="button" tabIndex={-1} onClick={() => inputRef.current?.click()}>
<div className={styles.toggleTrackCheck}>
<span className={styles.toggleIcon}>
<IconMoon />
</span>
</div>
<div className={styles.toggleTrackX}>
<span className={styles.toggleIcon}>
<IconSun />
</span>
</div>
<div className={styles.toggleTrackThumb} />
</div>
<input
ref={inputRef}
checked={checked}
type="checkbox"
className={styles.toggleScreenReader}
aria-label="Switch between dark and light mode"
onChange={onChange}
onClick={() => setChecked(!checked)}
onFocus={() => setFocused(true)}
onBlur={() => setFocused(false)}
onKeyDown={(e) => {
if (e.key === "Enter") {
inputRef.current?.click()
}
}}
/>
</div>
)
})

View File

@@ -0,0 +1,15 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import useIsBrowser from "@docusaurus/useIsBrowser"
import React from "react"
import { ToggleComponent } from "./ToggleComponent"
export default function Toggle(props) {
const isBrowser = useIsBrowser()
return <ToggleComponent disabled={!isBrowser} {...props} />
}

View File

@@ -0,0 +1,110 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
.toggle {
touch-action: pan-x;
position: relative;
cursor: pointer;
user-select: none;
margin-left: 10px;
-webkit-tap-highlight-color: transparent;
}
.toggleScreenReader {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
position: absolute;
width: 1px;
}
.toggleDisabled {
cursor: not-allowed;
}
.toggleTrack {
width: 50px;
height: 24px;
border-radius: 30px;
background-color: var(--custom-dark-1);
transition: all 0.2s ease;
}
.toggleTrackCheck {
position: absolute;
height: 15px;
top: 0;
bottom: 0;
margin: auto 0;
left: 8px;
opacity: 0;
transition: opacity 0.25s ease;
}
.toggleChecked .toggleTrackCheck,
[data-theme="dark"] .toggle .toggleTrackCheck {
opacity: 1;
transition: opacity 0.25s ease;
}
.toggleTrackX {
position: absolute;
width: 12px;
height: 15px;
top: 0;
bottom: 0;
margin: auto 0;
right: 10px;
opacity: 1;
transition: opacity 0.25s ease;
}
.toggleChecked .toggleTrackX,
[data-theme="dark"] .toggle .toggleTrackX {
opacity: 0;
}
.toggleTrackThumb {
position: absolute;
top: 1px;
left: 1px;
width: 22px;
height: 22px;
border: 1px solid #4d4d4d;
border-radius: 50%;
background-color: #fafafa;
transition: all 0.25s ease;
}
.toggleFocused .toggleTrackThumb,
.toggle:hover .toggleTrackThumb {
box-shadow: 0 0 2px 3px var(--ifm-color-primary);
}
/* stylelint-disable-next-line no-descending-specificity */
.toggleChecked .toggleTrackThumb,
[data-theme="dark"] .toggle .toggleTrackThumb {
left: 27px;
}
.toggle:active:not(.toggleDisabled) .toggleTrackThumb {
box-shadow: 0 0 5px 5px var(--ifm-color-primary);
}
.toggleIcon {
align-items: center;
display: flex;
height: 15px;
justify-content: center;
width: 15px;
svg > path {
fill: var(--custom-blue-0);
}
}

1
apps/docs/src/types/global.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
declare module "*.scss"

0
apps/docs/static/.nojekyll vendored Normal file
View File

BIN
apps/docs/static/fonts/DMSans.ttf vendored Normal file

Binary file not shown.

BIN
apps/docs/static/img/favicon.ico vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

13
apps/docs/static/img/semaphore-logo.svg vendored Normal file
View File

@@ -0,0 +1,13 @@
<svg width="149" height="40" viewBox="0 0 149 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.9239 0H19.3595C8.66769 0 0 8.68848 0 19.406V19.9999H9.96197L19.9239 10.0954V0ZM18.2705 1.6939V9.40519L9.28173 18.3425H1.68653C1.94142 14.0024 3.74877 9.95766 6.84047 6.85854C9.92721 3.7644 13.9507 1.95437 18.2705 1.6939Z" fill="#00020D"/>
<path d="M19.9256 20.0001H9.96362L0 29.9046V40H0.56604C11.2579 40 19.9256 31.3115 19.9256 20.594V20.0001Z" fill="#00020D"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M139.575 26.0528C140.552 26.6013 141.649 26.8756 142.866 26.8756C143.826 26.8756 144.727 26.6956 145.566 26.3356C146.424 25.9756 147.144 25.4528 147.727 24.767L146.235 23.2499C145.824 23.7299 145.326 24.0899 144.744 24.3299C144.178 24.5699 143.552 24.6899 142.866 24.6899C142.044 24.6899 141.315 24.5185 140.681 24.1756C140.046 23.8156 139.558 23.3185 139.215 22.6842C139.005 22.2855 138.86 21.8484 138.778 21.3727H148.344C148.395 21.1156 148.429 20.8927 148.447 20.7042C148.464 20.4984 148.472 20.3099 148.472 20.1384C148.472 18.9899 148.224 17.9613 147.727 17.0527C147.247 16.1441 146.569 15.4327 145.695 14.9184C144.838 14.4041 143.844 14.147 142.712 14.147C141.529 14.147 140.458 14.4298 139.498 14.9956C138.555 15.5441 137.801 16.2984 137.235 17.2584C136.686 18.2184 136.412 19.2984 136.412 20.4984C136.412 21.7156 136.695 22.8042 137.261 23.7642C137.826 24.7242 138.598 25.487 139.575 26.0528ZM138.783 19.4442C138.862 19.0025 138.997 18.5997 139.189 18.2356C139.515 17.6184 139.978 17.1384 140.578 16.7956C141.178 16.4527 141.872 16.2813 142.661 16.2813C143.415 16.2813 144.058 16.4441 144.589 16.7699C145.121 17.0784 145.532 17.5241 145.824 18.107C146.022 18.4929 146.153 18.9386 146.217 19.4442H138.783Z" fill="#00020D"/>
<path d="M128.062 26.6185V14.4041H130.376V15.8236C130.441 15.7244 130.509 15.6284 130.582 15.5356C131.302 14.6098 132.339 14.147 133.693 14.147C134.31 14.147 134.867 14.2584 135.365 14.4813C135.862 14.687 136.325 15.0384 136.753 15.5356L135.236 17.1041C134.979 16.8299 134.696 16.6327 134.387 16.5127C134.079 16.3927 133.719 16.3327 133.307 16.3327C132.45 16.3327 131.747 16.607 131.199 17.1556C130.65 17.7041 130.376 18.5356 130.376 19.6499V26.6185H128.062Z" fill="#00020D"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M116.608 26.0271C117.568 26.5928 118.648 26.8756 119.848 26.8756C121.031 26.8756 122.103 26.5928 123.063 26.0271C124.04 25.4613 124.811 24.6985 125.377 23.7385C125.943 22.7613 126.225 21.6727 126.225 20.4727C126.225 19.2899 125.943 18.2184 125.377 17.2584C124.811 16.2984 124.04 15.5441 123.063 14.9956C122.103 14.4298 121.031 14.147 119.848 14.147C118.648 14.147 117.568 14.4298 116.608 14.9956C115.648 15.5613 114.885 16.3241 114.32 17.2841C113.754 18.227 113.471 19.2899 113.471 20.4727C113.471 21.6727 113.754 22.7613 114.32 23.7385C114.885 24.6985 115.648 25.4613 116.608 26.0271ZM121.905 24.0985C121.305 24.4585 120.62 24.6385 119.848 24.6385C119.077 24.6385 118.391 24.4585 117.791 24.0985C117.191 23.7385 116.72 23.2499 116.377 22.6327C116.034 21.9985 115.863 21.2785 115.863 20.4727C115.863 19.6842 116.034 18.9813 116.377 18.3641C116.72 17.747 117.191 17.267 117.791 16.9241C118.391 16.5641 119.077 16.3841 119.848 16.3841C120.62 16.3841 121.297 16.5641 121.88 16.9241C122.48 17.267 122.951 17.747 123.294 18.3641C123.654 18.9813 123.834 19.6842 123.834 20.4727C123.834 21.2785 123.663 21.9985 123.32 22.6327C122.977 23.2499 122.505 23.7385 121.905 24.0985Z" fill="#00020D"/>
<path d="M109.592 26.6185V19.4956C109.592 18.5699 109.301 17.807 108.718 17.207C108.135 16.607 107.381 16.307 106.455 16.307C105.838 16.307 105.289 16.4441 104.809 16.7184C104.329 16.9927 103.952 17.3699 103.678 17.8499C103.403 18.3299 103.266 18.8784 103.266 19.4956V26.6185H100.952V8.25838H103.266V15.9822C103.637 15.4972 104.1 15.0998 104.655 14.7898C105.392 14.3613 106.223 14.147 107.149 14.147C108.075 14.147 108.889 14.3527 109.592 14.7641C110.312 15.1756 110.878 15.7498 111.289 16.487C111.701 17.2241 111.906 18.0727 111.906 19.0327V26.6185H109.592Z" fill="#00020D"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M90.6654 26.3099C91.4197 26.6871 92.2597 26.8756 93.1854 26.8756C94.2997 26.8756 95.3026 26.6013 96.194 26.0528C97.1026 25.487 97.814 24.7242 98.3283 23.7642C98.8426 22.8042 99.0997 21.7242 99.0997 20.5242C99.0997 19.3242 98.8426 18.2441 98.3283 17.2841C97.814 16.3241 97.1026 15.5613 96.194 14.9956C95.3026 14.4298 94.2997 14.147 93.1854 14.147C92.2768 14.147 91.4454 14.3441 90.6911 14.7384C90.0461 15.0684 89.5061 15.5165 89.0711 16.0828V14.4041H86.7568V31.7357H89.0711V24.9483C89.492 25.5127 90.0235 25.9665 90.6654 26.3099ZM94.8311 24.1499C94.2483 24.5099 93.5711 24.6899 92.7997 24.6899C92.0454 24.6899 91.3682 24.5099 90.7682 24.1499C90.1854 23.7899 89.7311 23.3013 89.4054 22.6842C89.0968 22.0499 88.9425 21.3299 88.9425 20.5242C88.9425 19.7013 89.1054 18.9727 89.4311 18.3384C89.7568 17.7041 90.2111 17.2156 90.794 16.8727C91.3768 16.5127 92.054 16.3327 92.8254 16.3327C93.5797 16.3327 94.2483 16.5127 94.8311 16.8727C95.414 17.2156 95.8768 17.7041 96.2197 18.3384C96.5626 18.9727 96.734 19.6927 96.734 20.4984C96.734 21.3213 96.5626 22.0499 96.2197 22.6842C95.8768 23.3013 95.414 23.7899 94.8311 24.1499Z" fill="#00020D"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M78.2702 26.8756C77.1559 26.8756 76.1445 26.6013 75.2359 26.0528C74.3273 25.487 73.6073 24.7242 73.0759 23.7642C72.5616 22.8042 72.3045 21.7242 72.3045 20.5242C72.3045 19.3242 72.5616 18.2441 73.0759 17.2841C73.6073 16.3241 74.3188 15.5613 75.2102 14.9956C76.1188 14.4298 77.1388 14.147 78.2702 14.147C79.1959 14.147 80.0188 14.3441 80.7388 14.7384C81.3807 15.0668 81.9122 15.5123 82.3331 16.0747V14.4041H84.6731V26.6185H82.3331V24.9569C81.9261 25.5173 81.4032 25.9683 80.7645 26.3099C80.0445 26.6871 79.2131 26.8756 78.2702 26.8756ZM78.6559 24.6899C79.8045 24.6899 80.7302 24.3042 81.4331 23.5327C82.136 22.7442 82.4874 21.7413 82.4874 20.5242C82.4874 19.6842 82.3245 18.9556 81.9988 18.3384C81.6902 17.7041 81.2445 17.2156 80.6617 16.8727C80.0788 16.5127 79.4017 16.3327 78.6302 16.3327C77.8588 16.3327 77.1731 16.5127 76.5731 16.8727C75.9902 17.2327 75.5273 17.7299 75.1845 18.3641C74.8588 18.9813 74.6959 19.6927 74.6959 20.4984C74.6959 21.3213 74.8588 22.0499 75.1845 22.6842C75.5273 23.3013 75.9988 23.7899 76.5988 24.1499C77.1988 24.5099 77.8845 24.6899 78.6559 24.6899Z" fill="#00020D"/>
<path d="M51.8494 14.4041V26.6185H54.1637V19.2127C54.1637 18.6127 54.3009 18.0984 54.5752 17.6699C54.8495 17.2413 55.2095 16.907 55.6552 16.667C56.1009 16.427 56.6066 16.307 57.1723 16.307C58.0123 16.307 58.7066 16.5727 59.2552 17.1041C59.8209 17.6184 60.1038 18.3299 60.1038 19.2384V26.6185H62.4181V19.2127C62.4181 18.6127 62.5552 18.0984 62.8295 17.6699C63.1038 17.2413 63.4638 16.907 63.9095 16.667C64.3724 16.427 64.8867 16.307 65.4524 16.307C66.2752 16.307 66.961 16.5727 67.5095 17.1041C68.0752 17.6184 68.3581 18.3299 68.3581 19.2384V26.6185H70.6981V18.7756C70.6981 17.8156 70.4838 16.9927 70.0553 16.307C69.6438 15.6213 69.0867 15.0898 68.3838 14.7127C67.681 14.3356 66.8838 14.147 65.9924 14.147C65.1352 14.147 64.3467 14.3441 63.6267 14.7384C62.9067 15.1156 62.3152 15.647 61.8524 16.3327C61.8459 16.3424 61.8395 16.352 61.8332 16.3617C61.8226 16.3434 61.8118 16.3252 61.8009 16.307C61.4066 15.6213 60.8581 15.0898 60.1552 14.7127C59.4695 14.3356 58.6981 14.147 57.8409 14.147C56.9666 14.147 56.178 14.3441 55.4752 14.7384C54.9596 15.015 54.5225 15.3747 54.1637 15.8173V14.4041H51.8494Z" fill="#00020D"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M44.4917 26.8756C43.2746 26.8756 42.1774 26.6013 41.2003 26.0528C40.2231 25.487 39.4517 24.7242 38.886 23.7642C38.3202 22.8042 38.0374 21.7156 38.0374 20.4984C38.0374 19.2984 38.3117 18.2184 38.8602 17.2584C39.426 16.2984 40.1802 15.5441 41.1231 14.9956C42.0831 14.4298 43.1546 14.147 44.3374 14.147C45.4689 14.147 46.4631 14.4041 47.3203 14.9184C48.1946 15.4327 48.8717 16.1441 49.3517 17.0527C49.8489 17.9613 50.0975 18.9899 50.0975 20.1384C50.0975 20.3099 50.0889 20.4984 50.0717 20.7042C50.0546 20.8927 50.0203 21.1156 49.9689 21.3727H40.4034C40.4848 21.8484 40.6304 22.2855 40.8403 22.6842C41.1831 23.3185 41.6717 23.8156 42.306 24.1756C42.9403 24.5185 43.6688 24.6899 44.4917 24.6899C45.1774 24.6899 45.8031 24.5699 46.3689 24.3299C46.9517 24.0899 47.4489 23.7299 47.8603 23.2499L49.3517 24.767C48.7689 25.4528 48.0489 25.9756 47.1917 26.3356C46.3517 26.6956 45.4517 26.8756 44.4917 26.8756ZM40.4081 19.4442H47.8418C47.7786 18.9386 47.6477 18.4929 47.4489 18.107C47.1574 17.5241 46.746 17.0784 46.2146 16.7699C45.6831 16.4441 45.0403 16.2813 44.286 16.2813C43.4974 16.2813 42.8031 16.4527 42.2031 16.7956C41.6031 17.1384 41.1403 17.6184 40.8145 18.2356C40.6224 18.5997 40.4869 19.0025 40.4081 19.4442Z" fill="#00020D"/>
<path d="M30.5607 26.6185C31.1779 26.7899 31.8293 26.8756 32.515 26.8756C33.8864 26.8756 34.975 26.5413 35.7807 25.8728C36.6036 25.2042 37.015 24.2956 37.015 23.147C37.015 22.3927 36.8522 21.7842 36.5265 21.3213C36.2179 20.8584 35.815 20.4899 35.3179 20.2156C34.8207 19.9413 34.2979 19.727 33.7493 19.5727C33.2007 19.4013 32.6693 19.2384 32.155 19.0842C31.6579 18.9299 31.255 18.7413 30.9464 18.5184C30.6378 18.2956 30.4836 17.9784 30.4836 17.567C30.4836 17.1556 30.655 16.8384 30.9979 16.6156C31.3579 16.3756 31.8721 16.2556 32.5407 16.2556C33.175 16.2556 33.7407 16.3756 34.2379 16.6156C34.7522 16.8556 35.1807 17.1984 35.5236 17.6441L37.015 16.1527C36.535 15.4841 35.9179 14.987 35.1636 14.6613C34.4264 14.3184 33.5779 14.147 32.6179 14.147C31.7093 14.147 30.9293 14.2927 30.2778 14.5841C29.6436 14.8756 29.1464 15.2956 28.7864 15.8441C28.4264 16.3756 28.2464 17.0099 28.2464 17.747C28.2464 18.4841 28.4007 19.0756 28.7093 19.5213C29.035 19.967 29.4464 20.3184 29.9436 20.5756C30.4407 20.8327 30.9636 21.047 31.5121 21.2185C32.0779 21.3727 32.6093 21.5356 33.1064 21.707C33.6036 21.8613 34.0064 22.067 34.315 22.3242C34.6407 22.5642 34.8036 22.907 34.8036 23.3527C34.8036 23.7985 34.6064 24.1499 34.2122 24.407C33.8179 24.647 33.2607 24.767 32.5407 24.767C31.8207 24.767 31.1693 24.6385 30.5864 24.3813C30.0036 24.107 29.4893 23.6956 29.0436 23.147L27.5521 24.6385C27.9293 25.1013 28.375 25.5042 28.8893 25.847C29.4036 26.1728 29.9607 26.4299 30.5607 26.6185Z" fill="#00020D"/>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

BIN
apps/docs/static/whitepaper-v1.pdf vendored Normal file

Binary file not shown.

7
apps/docs/tsconfig.json Normal file
View File

@@ -0,0 +1,7 @@
{
// This file is not used in compilation. It is here just for a nice editor experience.
"extends": "@docusaurus/tsconfig",
"compilerOptions": {
"baseUrl": "."
}
}

View File

@@ -0,0 +1,17 @@
---
sidebar_position: 8
---
# Security audit
The [Ethereum Foundation](https://ethereum.org/) and [POA
Network](https://www.poa.network/) commissioned [ABDK
Consulting](https://www.abdk.consulting) to audit the source code of Semaphore
as well as relevant circuits in
[circomlib](https://github.com/iden3/circomlib), which contains components
which the Semaphore zk-SNARK uses.
The summary of the audit results can be found
[here](https://github.com/appliedzkp/semaphore/tree/master/audit). After three
rounds of fixes, all security and performance issues were fixed, and the few
remaining issues are minor and do not affect security.

View File

@@ -0,0 +1,105 @@
---
sidebar_position: 5
---
# Contract API
## Constructor
**Contract ABI**:
`constructor(uint8 _treeLevels, uint232 _firstExternalNullifier)`
- `_treeLevels`: The depth of the identity tree.
- `_firstExternalNullifier`: The first identity nullifier to add.
The depth of the identity tree determines how many identity commitments may be
added to this contract: `2 ^ _treeLevels`. Once the tree is full, further
insertions will fail with the revert reason `IncrementalMerkleTree: tree is full`.
The first external nullifier will be added as an external nullifier to the
contract, and this external nullifier will be active once the deployment
completes.
## Add, deactivate, or reactivate external nullifiiers
**Contract ABI**:
`addExternalNullifier(uint232 _externalNullifier)`
Adds an external nullifier to the contract. Only the owner can do this.
This external nullifier is active once it is added.
- `_externalNullifier`: The new external nullifier to set.
`deactivateExternalNullifier(uint232 _externalNullifier)`
- `_externalNullifier`: The existing external nullifier to deactivate.
Deactivate an external nullifier. The external nullifier must already be active
for this function to work. Only the owner can do this.
`reactivateExternalNullifier(uint232 _externalNullifier)`
Reactivate an external nullifier. The external nullifier must already be
inactive for this function to work. Only the owner can do this.
- `_externalNullifier`: The deactivated external nullifier to reactivate.
## Insert identities
**Contract ABI**:
`function insertIdentity(uint256 _identityCommitment)`
- `_identity_commitment`: The user's identity commitment, which is the hash of
their public key and their identity nullifier (a random 31-byte value). It
should be the output of a Pedersen hash. It is the responsibility of the
caller to verify this.
**Off-chain `libsemaphore` helper functions**:
Use `genIdentity()` to generate an `Identity` object, and
`genIdentityCommitment(identity: Identity)` to generate the
`_identityCommitment` value to pass to the contract.
To convert `identity` to a string and back, so that you can store it in a
database or somewhere safe, use `serialiseIdentity()` and
`unSerialiseIdentity()`.
See the [Usage section on inserting
identities](./usage#insert-identities) for more information.
## Broadcast signals
**Contract ABI**:
```
broadcastSignal(
bytes memory _signal,
uint256[8] memory _proof,
uint256 _root,
uint256 _nullifiersHash,
uint232 _externalNullifier
)
```
- `_signal`: the signal to broadcast.
- `_proof`: a zk-SNARK proof (see below).
- `_root`: The root of the identity tree, where the user's identity commitment
is the last-inserted leaf.
- `_nullifiersHash`: A uniquely derived hash of the external nullifier, user's
identity nullifier, and the Merkle path index to their identity commitment.
It ensures that a user cannot broadcast a signal with the same external
nullifier more than once.
- `_externalNullifier`: The external nullifier at which the signal is
broadcast.
**Off-chain `libsemaphore` helper functions**:
Use `libsemaphore`'s `genWitness()`, `genProof()`, `genPublicSignals()` and
finally `genBroadcastSignalParams()` to generate the parameters to the
contract's `broadcastSignal()` function.
See the [Usage section on broadcasting
signals](./usage#broadcast-signals) for more information.

View File

@@ -0,0 +1,33 @@
---
sidebar_position: 9
---
# Credits
- Barry WhiteHat
- Chih Cheng Liang
- Kobi Gurkan
- Koh Wei Jie
- Harry Roberts
Many thanks to:
- ABDK Consulting
- Jordi Baylina / iden3
- POA Network
- PepperSec
- Ethereum Foundation
# Resources
[To Mixers and Beyond: presenting Semaphore, a privacy gadget built on Ethereum](https://medium.com/coinmonks/to-mixers-and-beyond-presenting-semaphore-a-privacy-gadget-built-on-ethereum-4c8b00857c9b) - Koh Wei Jie
[Privacy in Ethereum](https://www.youtube.com/watch?v=maDHYyj30kg) - Barry WhiteHat at the Taipei Ethereum Meetup
[Snarks for mixing, signaling and scaling by](https://www.youtube.com/watch?v=lv6iK9qezBY) - Barry WhiteHat at Devcon 4
[Privacy in Ethereum](https://www.youtube.com/watch?v=zBUo7G95wYE) - Barry WhiteHat at Devcon 5
[A trustless Ethereum mixer using zero-knowledge signalling](https://www.youtube.com/watch?v=GzVT16lFOHU) - Koh Wei Jie and Barry WhiteHat at Devcon 5
[Hands-on Applications of Zero-Knowledge Signalling](https://www.youtube.com/watch?v=7wd2aAN2jXI) - Koh Wei Jie at Devcon 5

View File

@@ -0,0 +1,137 @@
---
sidebar_position: 2
---
# How it works
## Inserting identities
An identity is comprised of the following information:
1. An [EdDSA](https://en.wikipedia.org/wiki/EdDSA) private key. Note that it is
_not_ an Ethereum private key.
2. An identity nullifier, whih is a random 32-byte value.
3. An identity trapdoor, whih is a random 32-byte value.
An identity commitment is the Pedersen hash of:
1. The public key associated with the identity's private key.
2. The identity nullifier.
3. The identity trapdoor.
To register an identity, the user must insert their identity commitment into
Semaphore's identity tree. They can do this by calling the Semaphore contract's
`insertIdentity(uint256 _identityCommitment)` function. See the [API
reference](./contract-api) for more information.
## Broadcasting signals
To broadcast a signal, the user must invoke this Semaphore contract function:
```
broadcastSignal(
bytes memory _signal,
uint256[8] memory _proof,
uint256 _root,
uint256 _nullifiersHash,
uint232 _externalNullifier
)
```
- `_signal`: the signal to broadcast.
- `_proof`: a zk-SNARK proof (see below).
- `_root`: The root of the identity tree, where the user's identity commitment
is the last-inserted leaf.
- `_nullifiersHash`: A uniquely derived hash of the external nullifier, user's
identity nullifier, and the Merkle path index to their identity commitment.
It ensures that a user cannot broadcast a signal with the same external
nullifier more than once.
- `_externalNullifier`: The external nullifier at which the signal is
broadcast.
To zk-SNARK proof must satisfy the constraints created by Semaphore's zk-SNARK
circuit as described below:
### The zk-SNARK circuit
The
[semaphore-base.circom](https://github.com/appliedzkp/semaphore/blob/master/circuits/circom/semaphore-base.circom)
circuit helps to prove the following:
### That the identity commitment exists in the Merkle tree
**Private inputs:**
- `identity_pk`: the user's EdDSA public key
- `identity_nullifier`: a random 32-byte value which the user should save
- `identity_trapdoor`: a random 32-byte value which the user should save
- `identity_path_elements`: the values along the Merkle path to the
user's identity commitment
- `identity_path_index[n_levels]`: the direction (left/right) per tree level
corresponding to the Merkle path to the user's identity commitment
**Public inputs:**
- `root`: The Merkle root of the identity tree
**Procedure:**
The circuit hashes the public key, identity nullifier, and identity trapdoor to
generate an **identity commitment**. It then verifies the Merkle proof against
the Merkle root and the identity commitment.
### That the signal was only broadcasted once
**Private inputs:**
- `identity_nullifier`: as above
- `identity_path_index`: as above
**Public inputs:**
- `external_nullifier`: the 29-byte external nullifier - see above
- `nullifiers_hash`: the hash of the identity nullifier, external nullifier,
and Merkle path index (`identity_path_index`)
**Procedure:**
The circuit hashes the given identity nullifier, external nullifier, and Merkle
path index, and checks that it matches the given nullifiers hash. Additionally,
the smart contract ensures that it has not previously seen this nullifiers
hash. This way, double-signalling is impossible.
### That the signal was truly broadcasted by the user who generated the proof
**Private inputs:**
- `identity_pk`: as above
- `auth_sig_r`: the `r` value of the signature of the signal
- `auth_sig_s`: the `s` value of the signature of the signal
**Public inputs:**
- `signal_hash`: the hash of the signal
- `external_nullifier`: the 29-byte external nullifier - see above
**Procedure:**
The circuit hashes the signal hash and the external nullifier, and verifies
this output against the given public key and signature. This ensures the
authenticity of the signal and prevents front-running attacks.
## Cryptographic primitives
Semaphore uses MiMC for the Merkle tree, Pedersen commmitments for the identity
commitments, Blake2 for the nullifiers hash, and EdDSA for the signature.
MiMC is a relatively new hash function. We use the recommended MiMC
construction from [Albrecht et al](https://eprint.iacr.org/2016/492.pdf), and
there is a prize to break MiMC at [http://mimchash.org](http://mimchash.org)
which has not been claimed yet.
We have also implemented a version of Semaphore which uses the Poseidon hash
function for the Merkle tree and EdDSA signature verification. This may have
better security than MiMC, allows identity insertions to save about 20% gas,
and roughly halves the proving time. Note, however, that the Poseidon-related
circuits and EVM bytecode generator have not been audited, so use it with
caution. To use it, checkout the `feat/poseidon` branch of this repository.

Some files were not shown because too many files have changed in this diff Show More