Compare commits

...

613 Commits

Author SHA1 Message Date
cedoor
bada8b8792 chore: v4.6.0 2024-11-25 13:09:50 +07:00
Cedoor
e93b19c566 chore(contracts): deploy contracts (#892)
* chore(contracts): deploy contracts

* chore(subgraph): deploy new subgraphs
2024-11-25 13:08:31 +07:00
leopardracer
862f715d05 fix: typos in documentation files (#898)
* Update usage.md

* Update glossary.md
2024-11-25 12:42:49 +07:00
Dmitry
3ed6c38587 Fixed closing tag issue in Update README.md (#894)
In the table section, there is a minor mistake in the closing tag. Instead of using </tbody>, it should be </tbody>. This is a formatting mistake.
2024-11-20 15:53:14 +07:00
Cedoor
7e183f3d2c refactor(contracts): support version range (#891)
re #888
2024-10-31 13:19:05 +00:00
Jimmy Chu
901d0954c0 refactor(contracts): specify gas cost in SemaphoreVerifier precompile calls (#883)
* chore(contracts): remove sub() from gas() in staticcall at SemaphoreVerifier

re #871

* refactor(contracts): using fixed gas cost on precompile calls

re #871

* refactor(contracts): increease fixed gas cost with safety buffer
2024-10-31 12:35:19 +00:00
Erick Vasquez
caebc1a4ab feat: add veilescrow to projects section (#890) 2024-10-30 18:46:38 +01:00
Vivian Plasencia
9b419f0c78 docs: add benchmarks page (#889)
* docs(docs): add benchmarks page to the docs

re #815

* chore(docs): update the docusaurus version
2024-10-30 10:54:13 +01:00
Vivian Plasencia
c67b888eb6 chore: v4.5.0 2024-10-28 20:23:40 +01:00
Vivian Plasencia
376cd11808 docs(identity): add export import identity to the docs (#887)
re #872
2024-10-28 13:29:35 +01:00
Vivian Plasencia
58132a9478 feat(identity): export point and signature types (#886)
* feat(identity): export point and signature types

re #885

* docs(identity): add the generate commitment function to the readme file
2024-10-28 13:29:03 +01:00
Vivian Plasencia
fadcf19206 chore: v4.4.2 2024-10-23 22:42:39 +02:00
Shikhar Singh
3be17268ab feat: remove prepublish script when creating template with Semaphore CLI (#882)
* feat(cli): remove @semaphore-protocol/cli prepublish script

The idea is to remove the prepublish script from the scripts object of the package.json file of
every cli template when the template is downloaded using the CLI.

BREAKING CHANGE: n

* refactor(cli): add comment

* refactor(cli): create seperate file for removePrePublishScript function

* refactor(cli): using updatedPackageJsonContent var instead of calling readFileSync again
2024-10-23 22:07:48 +02:00
Vivian Plasencia
82cdc60af6 fix: update shebang lines in the ts scripts (#881)
re #880
2024-10-23 10:50:46 +01:00
sripwoud
6c9ede6931 ci: install soldeer in release workflow (#867)
* ci: install `soldeer` in release workflow

* ci: setup soldeer login file (#868)

* chore: trigger release workflow

* chore: format

* ci: set `soldeer` credentials in github workspace

* chore: remove commentouts

* chore: add back tag trigger
2024-10-22 09:20:34 +01:00
cedoor
e6576cdc47 chore: v4.4.1 2024-10-21 12:41:11 +01:00
cedoor
c07dc88490 style: format code with prettier 2024-10-21 12:02:54 +01:00
Yago Pajariño
67060dd412 Update cli monorepo ethers and subgraph web app UI (#841)
* refactor(cli-template-monorepo-ethers): update cli-template-monorepo-ethers web app UI

re #836

* refactor(cli-template-monorepo-subgraph): update cli-template-monorepo-subgraph web app UI

re #836

* refactor(cli-template-monorepo-subgraph): rename subgraph web app on package.json

re #836

* refactor: update yarn.lock

re #836

* chore: fix indentation error on yarn.lock

re 836

* chore: update cli monorepo package.json

re #836

* chore(cli-template-monorepo-ethers): remove .env values

* chore(cli-template-monorepo-subgraph): change .env values

* chore(cli-template-monorepo-ethers): update .gitignore file

* chore(cli-template-monorepo-subgraph): update .gitignore file

* style(cli-template-monorepo-ethers): update globals.css

* refactor(cli-template-monorepo-ethers): replace chakra with plain html+css on cli-ethers page.tsx

* style(cli-template-monorepo-ethers): import globals css in layout

* style(cli-template-monorepo-ethers): remove chakra ui elements

* refactor(cli-template-monorepo-ethers): remove chakra ui from layout

* refactor(cli-template-monorepo-ethers): remove chakra ui from PageContainer, Stepper

* style(cli-template-monorepo-ethers): add font link

* chore(cli-template-monorepo-ethers): remove unused groups page

* style(cli-template-monorepo-ethers): remove chakra ui from group page

* style(cli-template-monorepo-ethers): remove chakra ui from proof page

* style(cli-template-monorepo-ethers): update css and add class names

* style(cli-template-monorepo-ethers): add css declarations

* style(cli-template-monorepo-ethers): add github icon

* style(cli-template-monorepo-ethers): add left arrow on stepper

* style(cli-template-monorepo-ethers): remove chakra from proofs page

* style(cli-template-monorepo-ethers): minor style improvements

* style(cli-template-monorepo-ethers): remove chakra libraries from package.json

* refactor(cli-template-monorepo-ethers): update yarn.lock file after package.json modified

* style(cli-template-monorepo-ethers): fix deepscan issues

* chore(cli-template-monorepo-ethers): remove unused packages and update dotenv version

* style(cli-template-monorepo-ethers): update stylesheet

* chore(cli-template-monorepo-ethers): update github logo

* chore(cli-template-monorepo-ethers): add loader to join group button

* chore(cli-template-monorepo-subgraph): update packages

* style(cli-template-monorepo-subgraph): update stylesheet

* style(cli-template-monorepo-subgraph): update user interface

* chore: update yarn.lock

* style: change styling and add feedback link

* chore(cli-template-monorepo-subgraph): remove unused styles and icons

* chore: remove unused context logs

* chore(cli-template-monorepo-subgraph): change data source subgraph web app

* chore: change repo url

* chore: remove unused hook useSemaphore
2024-10-21 11:58:05 +01:00
Cedoor
a4e540d8f4 chore(website): update roadmap (#878) 2024-10-18 13:03:16 +01:00
Jimmy Chu
79976f33cb Split SemaphoreVerifier key points into a separate library (#875)
* refactor(scripts): added a script to convert bigint to hex

* refactor(contracts): split SemaphoreVerifier verification key points into a separate library (#330)

* chore(contracts): yarn format & lint

* refactor(contracts): update SemaphoreVerifierKeyPts library to be internal

re #330

* chore(contracts): update spacing

* chore(contracts): updated per peer review and added invariant check for VerifierKeyPts lib

* chore(contracts): update invariant check to revert with custom error
2024-10-17 14:21:41 +01:00
cedoor
822530f2cf chore: v4.4.0 2024-10-17 14:19:38 +01:00
Vivian Plasencia
b3f862979d feat(identity): add generate commitment function (#877)
This static method is particularly useful after signature verification, as it allows retrieval of
the corresponding commitment associated with the public key.

re #873
2024-10-17 13:28:49 +02:00
cedoor
06e11d5c34 chore: v4.3.1 2024-10-16 12:20:26 +01:00
cedoor
88d4470b11 ci(circuits): add sudo before running wget command 2024-10-16 12:16:22 +01:00
Vivian Plasencia
bb1c6984b2 ci: add -O flag to the wget command 2024-10-16 13:04:32 +02:00
cedoor
5841327477 ci(circuits): update circom url 2024-10-16 11:52:02 +01:00
cedoor
eab3ab30c6 ci(circuits): update circom url 2024-10-16 11:48:30 +01:00
Cedoor
cd6dc38f9e ci(circuits): set static version of circom (#874)
* fix(circuits): add override for circom_runtime

* chore(circuits): use yarn syntax for overrides

* ci(circuits): set static version of circom
2024-10-16 11:05:07 +01:00
cedoor
3cb1b5757d revert(circuits): set previous circomkit version as static 2024-10-15 11:30:11 +01:00
cedoor
a8db8393c1 chore(circuits): update circomkit config 2024-10-15 11:24:55 +01:00
cedoor
391b571c31 chore(circuits): update circomkit dep version 2024-10-15 11:21:04 +01:00
cedoor
4c2769099f chore(circuits): update dev dependencies 2024-10-15 11:05:08 +01:00
Cedoor
29cabb49d6 build: move poseidon-lite to dependencies (#870) 2024-10-15 10:58:51 +01:00
cedoor
48b0694586 chore: v4.3.0 2024-10-03 12:46:01 +01:00
Cedoor
28684fdb1a Chore/mainnet deployments (#869)
* chore(contracts): deploy semaphore contracts on base

re #865

* chore(contracts): deploy semaphore contracts on linea

re #865

* refactor(data): add types for new networks

re #865
2024-10-03 12:42:36 +01:00
Cedoor
49a16635d8 chore(website): update roadmap.json (#866) 2024-10-01 19:04:11 +01:00
cedoor
4bfe6d8791 chore: v4.2.0 2024-10-01 18:48:37 +01:00
Cedoor
a3d97795fe Chore/new testnets (#864)
* chore(contracts): deploy contracts on base sepolia

re #863

* chore(contracts): deploy contracts on linea sepolia

re #863
2024-10-01 18:36:55 +01:00
cedoor
4c8d297902 chore: v4.1.0 2024-10-01 11:35:27 +01:00
Cedoor
fdbadf5b71 Chore/mainnet deployments (#862)
* chore(contracts): deploy contracts on arbitrum

re #859

* chore(contracts): deploy contracts on polygon

re #859

* chore(contracts): deploy contracts on optimism

re #859
2024-10-01 11:31:29 +01:00
Vivian Plasencia
4496eee137 docs(website): update events (#857) 2024-09-20 17:53:55 +02:00
Cedoor
215a12e25c docs(website): add new project (#856)
re #855
2024-09-20 16:24:23 +01:00
Cedoor
87331114c1 chore: replace discord link with telegram (#853) 2024-09-03 12:49:31 +02:00
sripwoud
0d41562dad chore: publish contracts to soldeer (#820)
* chore: define separate version.ts script

* chore: include publishing to soldeer in script

* fix(contracts): push to soldeer

re 800

* ci: fetch latest contract version from soldeer

* refactor: do not use execa in scripts

* fix: do not exit process in script

* chore: remove comments

* refactor: use shebang in ts scripts

* chore(contracts): add soldeerignore

* chore: inherit stdio in scripts

* chore: remove dry run flag

* chore: uncomment

* chore: fix typo in comment
2024-08-28 16:26:48 +02:00
Elias Rad
c435712656 docs fix spelling issues (#852)
* Update README.md

* Update contract-api.md

* Update howitworks.md

* Update libsemaphore.md
2024-08-28 16:26:31 +02:00
Vivian Plasencia
7d48311474 chore: v4.0.3 2024-08-13 09:53:22 +02:00
csiejimmyliu
5ef73e2819 Semaphore Identity example code bug fix (Fix #848) (#849)
* Semaphore identity example code bug fix

* Receive suggestion for consistency

---------

Co-authored-by: weipooppys93030 <55434365+weipooppys93030@users.noreply.github.com>
2024-08-12 23:29:04 +02:00
cedoor
de7bdd6d17 chore: v4.0.2 2024-08-12 12:00:57 +02:00
Cedoor
21c2739f19 fix(group): update lean-imt dependency (#850)
re #847
2024-08-12 11:56:08 +02:00
Vivian Plasencia
1ed170d0db chore: add pairwise to the list of projects (#846)
* chore: add pairwise to the list of projects

re #845

* refactor: remove slash from the website url

* refactor: remove www from website url
2024-07-31 13:12:54 +01:00
Cedoor
bc041486b0 chore(website): add new project (#844)
re #839
2024-07-31 10:51:52 +01:00
cedoor
5db1bccb84 chore: v4.0.1 2024-07-31 10:39:27 +01:00
Cedoor
b2da0a685a fix(proof): replace root public signal with actual root (#843)
The public signal of proof related to the Merkle root could obviously be different from what is
expected to be the root of the group. Therefore, for the proof to be valid, it is necessary that the
group root passed as a parameter matches the proof/circuit root output.

re #842
2024-07-31 10:38:02 +01:00
Cedoor
9329eed754 docs(docs): update credits.md (#840) 2024-07-26 18:59:56 +02:00
Cedoor
75563ee0d5 docs(docs): update v4 doc (#837)
* docs(docs): update v4 doc

* Update apps/docs/docusaurus.config.ts

Co-authored-by: Vivian Plasencia <v.pcalana@gmail.com>

---------

Co-authored-by: Vivian Plasencia <v.pcalana@gmail.com>
2024-07-25 12:51:06 +01:00
Cedoor
368bbd4bcd docs(website): add roadmap to home page (#834)
* docs(website): add roadmap to home page

re #833

* fix(website): add key property

re #833

* docs(website): add vertical roadmap
2024-07-25 12:50:49 +01:00
Vivian Plasencia
da2fae673d chore: v4.0.0 2024-07-25 13:39:24 +02:00
Cedoor
ff61aae040 chore(proof): update artifacts version (#838) 2024-07-25 12:32:00 +01:00
Vivian Plasencia
44ad964beb chore: v4.0.0-beta.19 2024-07-25 12:55:21 +02:00
Vivian Plasencia
d54d67345d fix: update cli ethers and subgraph templates (#835)
fix: fix cli ethers and subgraph templates
2024-07-25 12:16:57 +02:00
Vivian Plasencia
b5f8ee7929 refactor: support groups with tree depth 0 in cli templates (#832)
refactor: support groups with tree depth 0
2024-07-19 17:29:32 +01:00
cedoor
698cef0a80 chore: v4.0.0-beta.18 2024-07-19 14:11:17 +01:00
Cedoor
af4aec2127 refactor(proof)!: set tree depth = 1 when a group has 1 member (#831)
re #812
2024-07-19 14:10:19 +01:00
Vivian Plasencia
af4fe8de82 fix: cli templates (#830)
* fix(cli-template-monorepo-ethers): update hook dependencies

* fix(cli-template-monorepo-subgraph): update hook dependencies

* docs: update template readme files

* Update packages/cli-template-contracts-hardhat/README.md

Co-authored-by: Cedoor <me@cedoor.dev>

* style: format code

* docs: update note text style

---------

Co-authored-by: Cedoor <me@cedoor.dev>
2024-07-19 14:08:01 +01:00
Vivian Plasencia
90caadf5dc refactor(cli): create an empty yarn.lock file when generating a semahore project with the cli (#828)
refactor(cli): create an empty yarn.lock file when generating a semaphore project with the cli

Now devs will be able to install dependencies successfully right after creating a project with the
CLI.

re #827
2024-07-19 11:32:50 +01:00
cedoor
1e4e63cc31 chore: v4.0.0-beta.17 2024-07-18 22:34:57 +01:00
cedoor
4e54c159e6 chore(subgraph): deploy new subgraphs 2024-07-18 22:33:24 +01:00
Cedoor
0d55ccbb15 chore: update verification keys and deploy contracts (#826)
* chore: update verification keys

* fix(contracts): update verification key parameters

* chore: deploy contracts

* chore(contracts): remove script to copy abi after compiling
2024-07-18 18:48:36 +01:00
Ben Green
57747467bd docs(website): adding AsteriskDAO to project list (#824) 2024-07-15 20:41:12 +01:00
ctrlc03
d9fff6129c chore(contracts): add custom chain config for etherscan api (#823) 2024-07-15 14:53:58 +01:00
Cedoor
0f6505c014 build: build components sequentially (#821) 2024-07-11 14:43:36 +01:00
Cedoor
6c9be1bb5e docs: add link to pse acceleration program (#822) 2024-07-10 12:28:01 +01:00
Chidozie DAVID
fe5cf653c1 Refactor/sempahore abi to utils (#818)
* ci(contracts): a script that moves the abi.json file created to utils folder

A script could be run immediately after compilation to copy the file
artifacts/contracts/Semaphore.sol/Semaphore.json to packages/utils/src/semaphore-abi.json. Then all
packages/apps that need the interface can import it from @semaphore-protocol/utils.

re #817

* refactor(utils): allows packages to import abi from @semaphore-protocol/utils

re #817

* refactor(cli-template-monorepo-ethers): installs ncp and exports Semaphore Abi byte code

re #817

* refactor(contracts): added a script that automates movement of semaphore-abi.json

* chore(cli): changed the dependency and moved to ncp for copying semaphore abi

Changed the importation of abi in utils to _interface and moved the ncp to a dev depency

* chore(utils): changed ab to _interface and update to package.json

* chore(cli): deleted Cli-template file and made a document change

delted some cli-template file, changed yarn commit to git commit and fixed the yarn compile  script
2024-07-09 23:24:48 +01:00
Cedoor
ced5f6a2d5 chore(contracts): add function to deploy contracts deterministically (#816)
* chore(contracts): add function to deploy contracts deterministically

re #766

* chore(contracts): return correct contract instance

re #766
2024-07-05 14:23:09 +01:00
sripwoud
1b046fd8d1 perf: speed up local scripts (#810)
* chore: parallelize build scripts

* chore: run tests concurrently

* chore: group test log outputs

* chore: execute lint and format scripts concurrently

* refactor: do no use wildcard for test script`
2024-07-04 17:24:43 +02:00
cedoor
5fe6e4cd5f chore: v4.0.0-beta.16 2024-07-01 16:29:18 +01:00
Giacomo
e63209914d Add missing implicit method from contract to interface (#814)
refactor(contracts): add missing implicit method from interface
2024-07-01 16:28:15 +01:00
cedoor
504c0f7f9c chore: v4.0.0-beta.15 2024-06-28 11:02:25 +01:00
Cedoor
a1628f635a chore: deploy contracts and replace mumbai with amoy (#809)
* chore: remove unused env variable

* chore: deploy contracts and replace mumbai with amoy

* docs(subgraph): update README.md

* style(subgraph): format code with prettier

* docs(contracts): update deploy command name
2024-06-28 10:59:08 +01:00
cedoor
bb1975a949 chore: v4.0.0-beta.14 2024-06-24 12:41:04 +01:00
Cedoor
b9a163e613 docs: update pull_request_template.md (#807)
Update pull_request_template.md
2024-06-24 12:40:18 +01:00
Cedoor
7ec35c22f8 chore(proof): update @zk-kit/artifacts dep version (#806) 2024-06-24 12:39:31 +01:00
cedoor
f19daf7896 chore: v4.0.0-beta.13 2024-06-18 12:09:38 +01:00
Cedoor
3572f4493d fix(identity)!: update type of private key (#803)
* fix(identity)!: update type of private key

The new types support buffers and text, so that there is less ambiguity on strings.

* refactor(identity): use base64 as encoding for exported priv keys

re #799

* Update packages/identity/src/index.ts

Co-authored-by: Andrew Twyman <artwyman@users.noreply.github.com>

* test(identity): add more tests

re #799

---------

Co-authored-by: Andrew Twyman <artwyman@users.noreply.github.com>
2024-06-18 12:08:20 +01:00
dropbigfish
2830d3d0dc chore: fix wrong link in README.md (#802)
Signed-off-by: dropbigfish <fillfish@foxmail.com>
2024-06-13 11:20:10 +01:00
Giacomo
62b6b170a6 Announce Trusted Setup V4 ceremony (#794)
* chore(website): add trusted setup ceremony on the website

* docs(docs): add trusted setup ceremony instructions on documentation

* chore(docs): add candidate plan for prod ceremony

re n

* fix(docs): rename file to avoid mismatching hyphens

* style(website): follow style guide for hover

* fix(website): wrong link to ceremony

* fix(docs): switch emoji
2024-06-11 10:46:27 +02:00
Vivian Plasencia
5d513f92fb chore: v4.0.0-beta.12 2024-05-31 15:17:01 +02:00
sripwoud
0c942220b6 chore(proof): bump @zk-kit/artifacts to 1.4.1 (#798)
chore(proof): bump `@zk-kit/artifacts`

includes a retry mechanism to fetch artifacts
2024-05-31 14:43:17 +02:00
Vivian Plasencia
9237e147b8 chore: add runs-on to docs workflow (#797) 2024-05-31 13:16:45 +02:00
Vivian Plasencia
1dbc310333 chore: update verification keys (#795)
These are the new keys after the staging ceremony.
2024-05-31 13:02:34 +02:00
sripwoud
4870175577 docs: add link to API Reference (typedoc) (#790)
* chore: shorten `docs` scripts

`githubPages` is true by default
https://rb.gy/hzopfn

* docs: update README.md

* chore: trigger docs workflow only on changes in relevant files

* refactor: provide `cname` typedoc option via config file

* chore: remove heyauthn from exclude typedoc list
2024-05-30 17:29:56 +02:00
Vivian Plasencia
55e887c111 chore: update video url and thumbnail (#793) 2024-05-22 15:20:12 +02:00
Vivian Plasencia
f934c02214 chore: v4.0.0-beta.11 2024-05-21 09:48:11 +02:00
Vivian Plasencia
43fba00845 chore: update zk kit dependencies (#791)
* chore: update @zk-kit/baby-jubjub and @zk-kit/eddsa-poseidon dependencies

re #786

* chore(group): use the new @zk-kit/lean-imt library

re #786

* chore: update @zk-kit/utils version

re #786

* chore(contracts): use the new @zk-kit/lean-imt.sol library in contracts

re #786
2024-05-21 09:43:55 +02:00
sripwoud
7b3621a701 refactor: add @zk-kit/artifacts (#788)
* refactor: add `@zk-kit/artifacts`

* chore: update `jest.config.ts`

* test: increase timeouts

* chore: bump `@zk-kit/utils`

* fix: bump `@zk-kit/artifacts`
2024-05-20 12:16:01 -05:00
Vivian Plasencia
f3f3688476 test(circuits): add test using the identity library (#785)
There is a new test using the Semaphore Identity package to test compatibility between the Identity
library and the circuit.

re #484
2024-05-17 10:01:44 +01:00
Vivian Plasencia
0fa785bc58 chore: v4.0.0-beta.10 2024-05-16 12:47:57 +02:00
Vivian Plasencia
51ebe9db4d feat: support more tree depths (#779)
* feat: support more tree depth

Now Semaphore v4 will support tree depth from 2 to 32.

re #778

* test(proof): update tests to support circuit changes and tree depth 2 - 32

re #778

* fix(contracts): update verifier VK_POINTS

re #778

* test(proof): make tests more atomic

* chore: support tree depth 1

re #778
2024-05-16 12:41:46 +02:00
Vivian Plasencia
c88175bb2d chore: update zk-kit dependencies (#781)
* chore: update @zk-kit/imt and @zk-kit/imt.sol dependencies

re #776

* chore(identity): update dependency @zk-kit/eddsa-poseidon

re #776

* chore: update dependency @zk-kit/utils

re #776

* chore: add fixed version of zk-kit packages

re #776

* chore(identity): update dependency @zk-kit/baby-jubjub

re #776

* chore: update @zk-kit/baby-jubjub package version

re #776

* chore(identity): update @zk-kit/eddsa-poseidon package version

re #776

* chore: update yarn.lock file
2024-05-15 16:52:12 +01:00
Cedoor
ea175fa90c chore: add code owners (#784)
Through Github rulesets and the definition of code owners, it is possible to automate the review
process without additional workflows. It also makes responsibilities within the project clearer. The
current CODEOWNERS file is very simple but more complex rules can be introduced in the future.

re #783
2024-05-15 14:41:35 +01:00
Cedoor
f9e41fb306 chore(circuits): update binary-merkle-root dependency (#780)
re #776
2024-05-13 17:15:18 +01:00
Cedoor
47bfebd4ed docs(docs): add v4 audit report (#777) 2024-05-12 11:17:14 +01:00
Vivian Plasencia
9e5b2285fc test: add missing tests in the js libraries (#774)
* test: add missing tests

Now all lines of js libraries are 100% covered.

re #484

* test(proof): update message type

re #484

* test(proof): update constant

re #484

* test(proof): update number constant

re #484
2024-05-09 12:53:20 +01:00
aguzmant103
de15989638 chore(website): update event list (#775) 2024-05-08 23:15:49 +02:00
sripwoud
2e56ab6b07 chore: optimize pull-requests workflow (#765)
* chore: optimize pull-requests workflow

* fix: quote glob pattern

* fix: append `$` to variables in workflow

* chore: include `yaml` files in lintstaged format check

* feat: detect to_format or to_lint changed files

* feat: run test workflow steps conditionally

* Update .github/workflows/pull-requests.yml

Co-authored-by: Daehyun Paik <paik@a30a.dev>

* Update .github/workflows/pull-requests.yml

Co-authored-by: Daehyun Paik <paik@a30a.dev>

* fix: build utils before contracts

* fix: build identity pkg before running contracts tests

* fix: need to quote `true`

* fix: build group pkg before running contracts tests

* fix: build `{group,identity,proof}` before running circuits tests

* fix: build `proof` pkg before running contracts tests

* fix: build utils before testing circuits

* fix: build `utils` before `subgraph` pkg

---------

Co-authored-by: Daehyun Paik <paik@a30a.dev>
2024-05-08 11:10:00 +01:00
hw
3329922077 test(contracts): update contract tests to be more atomic and use loadFixture (#706) (#770)
test(contracts): update contract test

update contract test to be more atomic and use loadFixture

re #706
2024-05-08 10:55:47 +01:00
Giacomo
6b6bc6a98e Improve documentation for @semaphore/cli package (#771)
docs(cli): improve code comments and readme of the @semaphore/cli package
2024-05-07 14:31:04 +01:00
Giacomo
b9fa75cba3 Improve documentation for @semaphore/data package (#768)
* docs(data): improve code comments and readme of the @semaphore/data package

* docs(data): update package.json description and small nit on README
2024-05-07 14:30:43 +01:00
Giacomo
1b34ad312d Improve documentation for @semaphore/hardhat package (#772)
* docs(hardhat): improve code comments and readme for @semaphore/hardhat package

* docs(hardhat): update package.json description
2024-05-07 14:27:32 +01:00
Vivek
74df3c204d Update articles.json (#769) 2024-05-07 10:47:15 +02:00
Nick Addison
08af4a315f Added missing await in proofs example (#767)
Added missing await in proofs example
2024-05-07 10:46:58 +02:00
cedoor
ddfe4ffd56 chore: v4.0.0-beta.9 2024-05-02 16:29:22 +01:00
Cedoor
87f63451e3 fix(group): add check for zero values in group constructor (#764) 2024-05-02 16:28:21 +01:00
Vivian Plasencia
f8deb64285 chore: update config (#763)
* chore: update lint-staged config

* chore: use czg instead of cz + cz-git

re #738

* chore: use cat instead of vim editor to write commits

re #738

* chore: use secrets.GITHUB_TOKEN instead of secrets.GH_TOKEN

re #738

* style: add a space at the end of the pre-commit file
2024-05-01 10:45:27 +02:00
Vivian Plasencia
82bc47fb24 test(proof): increase timeout for tests generating proofs (#762)
re #761
2024-04-30 15:39:38 +02:00
Seva Zhidkov
5ced7db5f8 docs: fix 404 broken link to circuit file (#760)
docs: fix broken link to circuit file 

broken since [this commit](d9d5de1569 (diff-27cc20ba62610ee534566b1969efe92677c1c6af8940cdc20b57fcb0b4e0c6b3))
2024-04-30 14:33:03 +02:00
Vivian Plasencia
5c224f214c fix: update format code command (#759) 2024-04-29 18:07:36 +02:00
sripwoud
0b9ba376db chore(docs): format mdx files (#754)
* chore(docs): format `mdx` files with `remark`

`prettier` doesn't not have proper support for MDX v3.
Docusaurus recommends using `remark` instead.
https://docusaurus.io/docs/markdown-features/react

re #503

* chore(docs): add remark lint plugins

* chore: bump yarn.lock

* chore: add `quiet` option to remark
2024-04-29 17:13:35 +02:00
cedoor
a9410fa6d1 chore: v4.0.0-beta.8 2024-04-26 18:09:23 +02:00
Cedoor
79bd8d6305 fix: update snarkjs dependency version (#755)
re #713, #675
2024-04-26 17:59:14 +02:00
Vivian Plasencia
c5448fe1f0 Move heyauthn package (#753)
chore: remove heyauthn package

The heyauthn package was moved to the semaphore-protocol extensions repo.

re #752
2024-04-25 15:57:23 +02:00
sripwoud
cf1cffdf65 refactor!: use maybeGetSemaphoreSnarkArtifacts from `@zk-kit/utils (#747)
* chore(proof): bump `@zk-kit/utils` dep

* refactor(proof): use `maybeGetSemaphoreSnarkArtifacts` from `@zk-kit/utils`

Delete logic related to fetching snark artifacts (wasm and zkey files) that was moved to
`@zk-kit/utils`

* revert(proof): add back `requireObject(snarkArtifacts)` check

* chore(proof): update rollup.browser.config.ts

* docs(proof): update README

* chore(proof): remove unused import in rollup.browser.config.ts

* Update packages/proof/package.json

Co-authored-by: Cedoor <me@cedoor.dev>

* docs(proof): add links to other repos in proof README

* chore: bump `yarn.lock`

* docs(proof): add punctuation

---------

Co-authored-by: Cedoor <me@cedoor.dev>
2024-04-24 16:43:19 +02:00
Cedoor
41a85e0e45 Merge pull request #748 from semaphore-protocol/gitignore
chore: update `.gitignore`
2024-04-24 15:08:17 +02:00
Cedoor
6502c17f7b Merge pull request #750 from semaphore-protocol/fix/docs
docs: fix `typedoc` compilation warnings
2024-04-24 15:07:24 +02:00
Cedoor
1849055e88 Merge pull request #751 from semaphore-protocol/fix/install-circom-deps
ci: fix circom deps installation steps
2024-04-24 15:01:04 +02:00
sripwoud
e536debb16 ci: add comment 2024-04-24 14:36:13 +02:00
sripwoud
4ba367bee4 chore: format 2024-04-24 13:56:48 +02:00
sripwoud
ce6d622202 ci: remove microsoft.prod sources file 2024-04-24 13:54:20 +02:00
sripwoud
3b08b67175 ci: debug pull-requests workflow 2024-04-24 13:52:02 +02:00
sripwoud
68181aa1fb docs: fix warnings about function signatures 2024-04-24 13:29:58 +02:00
sripwoud
6225b9b7c0 docs: fix typedoc entryPoints 2024-04-24 13:29:25 +02:00
sripwoud
940db25a87 chore: update .gitignore
Don't version control `asdf` and `direnv` configuration files
2024-04-24 13:09:22 +02:00
Cedoor
9dc768376c Merge pull request #743 from semaphore-protocol/fix/baby-jubjub
Add check to make sure Baby Jubjub secret scalar is < l
2024-04-19 11:04:57 +02:00
cedoor
ba8132561a chore: update lockfile 2024-04-17 10:46:45 +02:00
Cedoor
5aaa9e4f69 Merge pull request #742 from semaphore-protocol/docs/update-code
Update Solidity code to create groups in documentation website
2024-04-16 09:21:17 +01:00
cedoor
f19b632e1e docs(docs): update solidity code to create groups 2024-04-15 16:55:32 +01:00
cedoor
b40f9f13e9 test(circuits): add new test for l = r - 1 2024-04-12 18:45:34 +01:00
cedoor
e884186488 refactor(circuits): remove greater-than check and update less-than bits 2024-04-12 16:22:49 +01:00
Cedoor
a4a6837f5a Merge pull request #737 from Stumble/yumin/fix-alias
fix: incorrect alias check brought from snarkjs. (possible security vulnerability)
2024-04-12 12:12:23 +01:00
Cedoor
2aee16e082 Merge pull request #741 from 0xbok/sol-op
perf(contracts): turn on solidity optimizer
2024-04-09 10:58:49 +01:00
0xbok
7c99c74fac perf(contracts): turn on solidity optimizer
Turn on solidity optimizer

re #740
2024-04-09 02:12:08 +04:00
Yumin Xia
8e246c48bf fix: incorrect alias check brought from snarkjs. 2024-04-05 12:21:59 -07:00
cedoor
75eac56e9f chore: update lockfile 2024-03-29 17:51:34 +00:00
cedoor
d9d5de1569 fix(circuits): check whether the secret scalar is within the r field 2024-03-29 17:49:40 +00:00
cedoor
a522fff448 chore: v4.0.0-beta.7 2024-03-28 19:06:18 +00:00
Cedoor
d9d97de09c Merge pull request #734 from semaphore-protocol/fix/convert-hex-pk
Convert hexadecimal private key before signing messages
2024-03-28 19:05:01 +00:00
Cedoor
88df87e339 Update packages/identity/tests/index.test.ts
Co-authored-by: Vivian Plasencia <v.pcalana@gmail.com>
2024-03-28 17:57:24 +00:00
cedoor
9c2968eecd fix(identity): convert hex private key before signing messages
The ZK-Kit EdDSA Poseidon package only supports the following private key types: text, buffer. The
Semaphore identity supports text and hexadecimal strings. If the identity private key is an
hexadicimal string it needs to be converted before being passed to any ZK-Kit function.

re #733
2024-03-28 15:52:08 +00:00
Cedoor
c795ddce35 Merge pull request #732 from semaphore-protocol/fix/group-checks
Add checks for removed members

Former-commit-id: 2faac4e30790a049a8377807ab507d980fa21b31
2024-03-28 14:43:37 +00:00
Cedoor
764ff52516 Merge pull request #731 from semaphore-protocol/refactor/bigint-type
Use native `bigint` type

Former-commit-id: 4adc328c9458e386ffc9f65e5ea06040911564cc
2024-03-28 14:43:19 +00:00
cedoor
2b7dbf3519 refactor(group): remove check on generateMerkleProof function
Contracts actually need devs to generate a Merkle proof of a removed member.

re #717


Former-commit-id: 0014365453
2024-03-28 13:04:58 +00:00
cedoor
ea2145471d fix(group): add checks for removed members
re #717


Former-commit-id: 1c42ab332a
2024-03-28 12:53:21 +00:00
cedoor
197a7ae204 test: fix types on tests
Former-commit-id: fa4d9860e4
2024-03-28 12:52:16 +00:00
cedoor
663bea73d0 docs: update group parameter types
Former-commit-id: 56c7fc8b23
2024-03-28 12:45:50 +00:00
cedoor
072d94fdee refactor(identity): keep index.ts file only as there's only 1 class
Former-commit-id: e25db2d89e
2024-03-28 12:09:09 +00:00
cedoor
a20d3db122 refactor: use native bigints
The core libraries can now use native bigints as the new ts target is es2020.


Former-commit-id: 238c6b3bbe
2024-03-28 12:06:18 +00:00
cedoor
d00c0a3309 style: format readme file with prettier
Former-commit-id: 7fd8d8245c
2024-03-28 10:34:56 +00:00
Cedoor
c071d5b6e5 docs: update README.md
Former-commit-id: 82d2cd04c4
2024-03-28 10:31:21 +00:00
Cedoor
c1ab686a6c Merge pull request #730 from semaphore-protocol/fix/docs-links
Fix docs links

Former-commit-id: afd0e07f12
2024-03-27 13:09:43 +00:00
cedoor
1942afe766 refactor(docs): use utils function to get explorer url
re #599


Former-commit-id: e05d89ce63
2024-03-27 12:38:09 +00:00
cedoor
f57f4979ce fix(docs): set correct anchor links
re #599


Former-commit-id: 38830641af
2024-03-27 12:37:34 +00:00
cedoor
65a6983c54 chore(docs): rename vercel conf file
Former-commit-id: 4ac10bab49
2024-03-27 11:17:50 +00:00
cedoor
30844cee5f chore(docs): add vercel conf file
Former-commit-id: 47524eec19
2024-03-27 11:10:59 +00:00
cedoor
5fecb53438 chore: v4.0.0-beta.6
Former-commit-id: 41494b62c8
2024-03-26 18:49:38 +00:00
cedoor
3f7eb28051 chore: deploy new semaphore subgraphs
Former-commit-id: 9a41d607e4
2024-03-26 18:49:02 +00:00
Vivian Plasencia
1fb6e99cd0 chore: v4.0.0-beta.5
Former-commit-id: 821735aae0
2024-03-26 18:39:03 +01:00
Cedoor
a3f86d9ad3 Merge pull request #728 from semaphore-protocol/chore/es2020-target
Update TypeScript target to `ES2020`

Former-commit-id: 02cd18f457
2024-03-26 17:26:11 +00:00
Cedoor
832b0d6887 Merge pull request #727 from semaphore-protocol/chore/update-template-contracts
Update CLI template contracts

Former-commit-id: 8da28a5a5d
2024-03-26 17:25:24 +00:00
cedoor
a159c23b91 chore: build libraries first
Former-commit-id: 6239919f9a
2024-03-26 17:03:33 +00:00
cedoor
825a52cc4d chore: build libraries before generating subgraph files
Former-commit-id: d55810d169
2024-03-25 19:11:12 +00:00
cedoor
e0057a56af chore: add pre-build script to subgraph
Former-commit-id: ce2ef1e87d
2024-03-25 19:06:15 +00:00
Cedoor
7afcd53649 Merge pull request #719 from semaphore-protocol/feat/deployed-contracts
Add deployed contracts to utils package

Former-commit-id: bc2bc37991
2024-03-25 18:55:09 +00:00
cedoor
f569b2fc70 chore: update ts target to es2020
Targeting ES2020 looks like it's generally fine today. It's widely supported across modern browsers
and environments and it would allow Semaphore bundles to use new ES features natively, like arrow
functions, promises, and classes, which can improve code readability and efficiency.

re #688


Former-commit-id: 9f49d91197
2024-03-25 13:04:21 +00:00
cedoor
aa0c9ceba2 chore(cli): update template contracts
re #722


Former-commit-id: 895f9e1e9e
2024-03-25 12:58:42 +00:00
Cedoor
4a68eb5e03 Merge pull request #721 from xiaoxianBoy/fix-typos
chore: fix typos
Former-commit-id: 87e94afeac
2024-03-25 11:50:35 +00:00
Cedoor
32944c412b Merge pull request #726 from semaphore-protocol/docs/add-social-media-card
Docs: Add social media card
Former-commit-id: f1441fd0c8
2024-03-25 11:47:47 +00:00
cedoor
8d8fb82407 refactor(utils): re-organize 'networks' module structure and add tests
re #715


Former-commit-id: ff3263d166
2024-03-25 11:43:17 +00:00
Cedoor
73a306241b Merge pull request #725 from patitonar/patch-1
chore(circuits): fix groth16 malleability broken link

Former-commit-id: 95cb7dd74d
2024-03-25 10:37:22 +00:00
Vivian Plasencia
9b023041e8 docs: update parameter order in generateProof function
Now the order of parameters in the generateProof function docs is correct.

re #686


Former-commit-id: 3e3c3f4f05
2024-03-23 12:07:50 +01:00
Vivian Plasencia
b6ffad5b8c chore(docs): add social media card to docs
Now when the documentation link is shared on social media, the Semaphore card for social media will
be displayed.

re #712


Former-commit-id: e981583172
2024-03-23 11:51:43 +01:00
cedoor
8abfb93b4c style(utils): format code with prettier
Former-commit-id: 7cfe752f4c
2024-03-22 18:17:38 +00:00
cedoor
138e5339bd chore: remove oz and add more networks
Former-commit-id: 92e189e17c
2024-03-22 18:08:27 +00:00
cedoor
784cddb483 chore: add pre-build script for building local packages
re #715


Former-commit-id: 042759b10e
2024-03-22 15:02:37 +00:00
cedoor
5898a175b0 chore(utils): move json of deployed contracts to utils pkg
re #715


Former-commit-id: 8caad14e3f
2024-03-22 14:53:20 +00:00
Gerardo Nardelli
6e8f84025f chore(circuits): fix groth16 malleability broken link
Former-commit-id: d5477644e0
2024-03-22 11:46:04 -03:00
cedoor
6b659a80d0 chore(utils): reduce number of supported networks
re #715


Former-commit-id: 095147afb3
2024-03-22 13:19:57 +00:00
cedoor
5caa3c7fd8 ci: build libraries first
re #715


Former-commit-id: 17d716f632
2024-03-22 11:18:22 +00:00
cedoor
619459e64b feat(utils): add deployed contracts to utils package
re #715


Former-commit-id: 1647ecaba5
2024-03-22 11:18:20 +00:00
Vivian Plasencia
11eff59b3b docs: fix whitepaper v1 link
re #723


Former-commit-id: ba3f7fb139
2024-03-22 12:17:12 +01:00
snoppy
0e2e6dfd0e chore: fix typos
Former-commit-id: ad43b8ab62
2024-03-22 18:43:24 +08:00
Cedoor
ecfcda70cc Merge pull request #718 from semaphore-protocol/feature/two-step-admin
Create a two-step mechanism to update group admins

Former-commit-id: 00f05510d6
2024-03-21 17:25:48 +00:00
cedoor
601a339d9b feat(contracts)!: create a two-step mechanism to update group admins
The best practice to update a group admin is through a two-step update. The existing admin assigns
the new potential admin, and the new admin accepts in a separate transaction. This prevents existing
admins from making mistakes and assigning wrong addresses.

re #690


Former-commit-id: 255bccf2eb
2024-03-21 15:54:46 +00:00
cedoor
6d0d7444b6 docs: fix variable name
Former-commit-id: d147958c67
2024-03-20 09:48:45 +00:00
cedoor
b441be91a4 revert(proof): remove resolutions and overrides fields
overrides only works with NPM and both overrides and resolutions works if they are in the project
root package.json. So they don't solve #713.

re #713


Former-commit-id: b77feebdea
2024-03-19 16:49:53 +00:00
cedoor
0d4d8508fc chore: v4.0.0-beta.4
Former-commit-id: 7102d0a084
2024-03-19 15:39:58 +00:00
cedoor
b215c6cbde chore(proof): add override version for web-worker
Former-commit-id: e2ad68d6da
2024-03-19 15:38:25 +00:00
cedoor
27956f1676 chore(cli): make contract packages in templates private
Former-commit-id: 63904fb678
2024-03-19 15:37:59 +00:00
cedoor
9c7afa888f chore: v4.0.0-beta.3
Former-commit-id: 9c6f9006e0
2024-03-19 15:16:21 +00:00
Cedoor
96cb583861 Merge pull request #716 from semaphore-protocol/fix/web-worker
Add temporary fixed resolution for `web-worker` dependency

Former-commit-id: 55eaa31dfb
2024-03-19 15:00:17 +00:00
cedoor
b603dbaf81 fix(proof): add temporary fixed resolution for web-worker dep
Adding the 'resolutions' field with the static version of web-worker solves the problem described in
issue #713. To be regarded as a temporary solution.

re #713


Former-commit-id: ca36ed5488
2024-03-19 12:54:43 +00:00
Cedoor
4fc4675678 Merge pull request #714 from semaphore-protocol/fix/deployed-contracts
Update link to fetch deployed contracts on docs

Former-commit-id: 65d3a41fa9
2024-03-18 20:08:37 +00:00
cedoor
6f0fdddae5 chore(contracts): update zk-kit imt.sol dependency
Former-commit-id: 4b074a443f
2024-03-18 20:04:10 +00:00
cedoor
31b05dba43 fix: update link to fetch deployed contracts on docs
Former-commit-id: a875e07ec2
2024-03-18 19:49:52 +00:00
Cedoor
94bdb44a45 Merge pull request #707 from semaphore-protocol/feat/create-group-contracts
Add a new `createGroup` function in the contracts

Former-commit-id: b55693948c
2024-03-18 10:30:49 +00:00
Cedoor
2bc10b0d5e Merge pull request #701 from semaphore-protocol/refactor/update-zk-kit
Update `utils` package and identity private key types.

Former-commit-id: 3b167fb46c
2024-03-15 23:13:54 +00:00
Cedoor
7ab9898beb Merge pull request #709 from semaphore-protocol/ref/remove-groupid-check
Remove existence check for `groupId `

Former-commit-id: d045bf9beb
2024-03-15 23:13:30 +00:00
cedoor
9e5f8351cc fix(utils): add missing exports to index.ts
re #642


Former-commit-id: 0987dee8db
2024-03-15 23:08:47 +00:00
cedoor
b6e6a8db03 fix(identity): update zk-kit packages with fixes
re #700


Former-commit-id: a2ec3013c8
2024-03-15 23:07:56 +00:00
cedoor
9eebaf4967 chore(identity): fix main path in package.json
re #700


Former-commit-id: e01ffb80b6
2024-03-15 23:07:52 +00:00
cedoor
9e5c464237 feat(utils): new semaphore utilities + zk-kit replacements
The utils package will no longer provide errors and types utilities as those functions have been
moved to zk-kit. The utils package now provides a list of supported networks and a function to
decode messages instead.

re #642, #641


Former-commit-id: d2ce1070f0
2024-03-15 23:07:44 +00:00
cedoor
2ea5d5c1cf refactor(identity)!: new private key types
The type of the identities' private key will always be a string type, either text or hexadecimal
strings. This will allow devs to store private keys more easily and avoid confusion with types.

re #700


Former-commit-id: eead04e45d
2024-03-15 23:02:51 +00:00
Cedoor
e9e24b04d1 Merge pull request #711 from semaphore-protocol/ref/add-tree-depth-constants
Add tree depth constants to JavaScript libraries and Solidity contracts

Former-commit-id: d256905c0c
2024-03-15 17:20:29 +00:00
Vivian Plasencia
2c5b0641c7 docs: update code comments related to supported tree depths
re #683


Former-commit-id: c3b9b98370
2024-03-15 17:39:42 +01:00
Vivian Plasencia
9e6d386748 refactor(contracts): add a constants sol file to store the constants
re #683


Former-commit-id: 969f1ed809
2024-03-15 17:27:37 +01:00
Vivian Plasencia
546d9f9dd6 refactor(contracts): add constants for the supported tree depths in contracts
the semaphore contract has new constants to save the min and max supported tree depth

re #683


Former-commit-id: 8793958d75
2024-03-15 13:44:38 +01:00
Vivian Plasencia
38b14a515c refactor(proof): add constants for supported tree depth
there is a new package in utils called constants which has the supported semaphore tree depths

re #683


Former-commit-id: 621003dd6c
2024-03-15 13:34:13 +01:00
Cedoor
193be0e1d5 Merge pull request #710 from semaphore-protocol/test/more-contracts-tests
Add more tests for the semaphore groups contract

Former-commit-id: 750c948157
2024-03-15 11:25:36 +00:00
Vivian Plasencia
dfb5473414 test(contracts): add more tests for the semaphore groups contract
re #484


Former-commit-id: e2c156d883
2024-03-15 11:00:00 +01:00
Vivian Plasencia
25847c4422 refactor(contracts): remove existence check for group id
since the group ids are created incrementally internally in the contracts, there's no need to check
whether the group id has already been taken.

re #708


Former-commit-id: e205bf6ad7
2024-03-14 23:40:41 +01:00
Vivian Plasencia
7b8a35470a feat(contracts): add a new create group function in the contracts
now there is a new function to create groups without passing any parameters

re #704


Former-commit-id: 67a0cecf3e
2024-03-14 23:19:55 +01:00
Cedoor
ee26734d94 Merge pull request #702 from zkfriendly/fix/accessControl
Fixes access control related issues

Former-commit-id: 0fe8d637f3
2024-03-14 20:38:21 +00:00
Cedoor
b50cddad2e Merge pull request #705 from semaphore-protocol/test/add-contracts-tests
Add contract tests

Former-commit-id: dcaba2583f
2024-03-14 20:37:46 +00:00
Cedoor
4578fc63de Merge pull request #703 from semaphore-protocol/fix/create-group
Use an incremental group id when creating a group in contracts

Former-commit-id: 87b48cac69
2024-03-14 20:37:31 +00:00
Vivian Plasencia
eb1f3ad5e2 test(contracts): add missing tests
re #484


Former-commit-id: e1481b8de8
2024-03-14 17:51:12 +01:00
Vivian Plasencia
6049a27308 chore: add hardhat artifacts to prettier ignore file
Former-commit-id: b12dd0fd98
2024-03-14 14:34:49 +01:00
Vivian Plasencia
7943fcd665 docs(contracts): update group counter code comment
Former-commit-id: 644f144e9c
2024-03-14 14:28:55 +01:00
Vivian Plasencia
66be942cb2 refactor(contracts): remove unnecessary initialization for group counter variable
Former-commit-id: f4ee63f909
2024-03-14 14:26:02 +01:00
Vivian Plasencia
b93ad8e14d chore(contracts): update prettier config
Former-commit-id: c670ed4b5d
2024-03-14 14:23:37 +01:00
Vivian Plasencia
7c69037745 style(contracts): add a line at the end of the prettierignore file
Former-commit-id: 2fc164b745
2024-03-14 10:52:42 +01:00
Vivian Plasencia
fcb3634e07 fix(contracts)!: use an incremental group id when creating a group
BREAKING CHANGE: the group id is no longer required when creating a group in contracts

re #682


Former-commit-id: 5f76dd5612
2024-03-14 10:34:42 +01:00
zkFriendly
b5825c52e5 style(contracts): format code with prettier
Former-commit-id: baa18c885e
2024-03-13 23:28:53 +01:00
zkFriendly
8795302788 perf(contracts): remove unnecessary onlyExistingGroup checks
Former-commit-id: 0b9d2a3d86
2024-03-13 23:28:16 +01:00
zkFriendly
3c2db6f724 test(contracts): assert only admin can add members
Former-commit-id: 4e4b4e629a
2024-03-13 23:19:51 +01:00
zkFriendly
fb79707e3e fix(contracts): add missing onlyGroupAdmin modifier to _addMembers
Former-commit-id: bfe050d16b
2024-03-13 23:19:31 +01:00
Cedoor
c5378b6914 Merge pull request #699 from semaphore-protocol/chore/automatic-releases
Update release workflow to auto-publish NPM packages

Former-commit-id: e75273ba27
2024-03-13 19:14:37 +00:00
Cedoor
8709b373e8 Merge pull request #695 from semaphore-protocol/chore/dev-deps
Update remaining dev dependencies

Former-commit-id: b22fa606dc
2024-03-13 19:13:58 +00:00
cedoor
3c993ab150 chore: update release workflow to auto-publish npm packages
re #698


Former-commit-id: 38d434083f
2024-03-13 16:42:11 +00:00
cedoor
541007d4a5 chore(contracts): update solhint-plugin-prettier dev dependency
re #662


Former-commit-id: fe30192879
2024-03-13 16:41:26 +00:00
cedoor
f3971efb55 chore: update dev dependencies + new cz adapter
re #662


Former-commit-id: 15d988efbb
2024-03-13 16:41:11 +00:00
cedoor
c8db909122 style: format code with prettier
re #662


Former-commit-id: 8a9d8a09b9
2024-03-13 16:40:56 +00:00
Cedoor
ab0366aa07 Merge pull request #697 from semaphore-protocol/ref/update-zk-kit-utils
Update `@zk-kit/utils` package

Former-commit-id: 84cf596e99
2024-03-13 16:02:56 +00:00
Vivian Plasencia
d4bda547ff refactor: update zk-kit utils package
Former-commit-id: 287f3a8796
2024-03-13 16:46:07 +01:00
Cedoor
d1f5fb331a Merge pull request #692 from zkfriendly/main
Gas optimization in getting new merkle tree roots after modifying group members

Former-commit-id: 81e8a6885a
2024-03-13 13:35:07 +00:00
Cedoor
14fe011ad7 Merge pull request #694 from semaphore-protocol/ref/proof-types
Replace `PackedPoints` with `PackedGroth16Proof`

Former-commit-id: c43a0a5ba2
2024-03-13 10:07:31 +00:00
Vivian Plasencia
2897754358 refactor(proof): update semaphore proof type
re #693


Former-commit-id: 09c842f9dc
2024-03-12 21:59:48 +01:00
zkFriendly
4a0ea1201c refactor(contracts): use returned new merkle tree root instead of calling getMerkleTreeRoot
Former-commit-id: f06ddd32e4
2024-03-12 16:41:15 +01:00
zkFriendly
634c2b11e6 refactor(contracts): return new merkle tree root after modifying group members
Former-commit-id: 7e2c208efd
2024-03-12 16:39:17 +01:00
cedoor
ac830458fa chore: v4.0.0-beta.2
Former-commit-id: 43f555e229
2024-03-04 15:46:23 +00:00
Cedoor
7b46be0725 Merge pull request #679 from semaphore-protocol/chore/stable-version-script
Add script to remove stableVersion field

Former-commit-id: 3dc31e55ae
2024-03-04 15:44:34 +00:00
Cedoor
f7fa9fe50d Merge pull request #677 from semaphore-protocol/docs/yarn-only
Remove pnpm and npm from supported package managers

Former-commit-id: 6ad2a79298
2024-03-04 13:32:00 +00:00
cedoor
ca944c6eed chore: add script to remove stableVersion field
re #305


Former-commit-id: fbe6b664f1
2024-03-04 13:31:08 +00:00
Cedoor
8bfebd3431 Merge pull request #678 from semaphore-protocol/chore/clean
Update folder name for generated artifacts

Former-commit-id: dfb972d2fa
2024-03-04 12:12:41 +00:00
cedoor
f7403cbdc7 chore: update folder name for generated artifacts
Former-commit-id: 17b072b778
2024-03-04 11:31:20 +00:00
cedoor
e81b4907da chore(docs): remove pnpm and npm from supported package managers
The Semaphore V4 CLI templates don't support npm and pnpm yet. The documentation should reflect this
aspect. It will be updated as soon as those templates support more package managers.

re #676


Former-commit-id: e6198cfdbf
2024-03-04 10:34:22 +00:00
Cedoor
0c540072c6 Merge pull request #674 from semaphore-protocol/ref/cli-templates
Cownload the correct CLI Template files

Former-commit-id: bdf36f9525
2024-03-01 12:30:46 +00:00
Vivian Plasencia
aaf2079274 refactor(cli-template-contracts-hardhat): remove unnecessary files from config
Former-commit-id: 42969e2f00
2024-03-01 13:29:44 +01:00
Vivian Plasencia
42991c5917 refactor(cli-template-monorepo-hardhat): remove unnecessary exclude tags
Former-commit-id: bee7433a52
2024-03-01 13:15:44 +01:00
Vivian Plasencia
4e84441770 fix: download the correct cli template files
Former-commit-id: e82b4638a9
2024-02-29 22:24:53 +01:00
cedoor
41f0b2909f test(circuits): add type assertion for secret value
Former-commit-id: c4dd1e4e10
2024-02-28 20:49:10 +00:00
cedoor
517fd44a23 chore: remove stableVersion field
Former-commit-id: 9c23fc70ef
2024-02-28 20:39:31 +00:00
cedoor
5d2a98d399 chore: v4.0.0-beta.1
Former-commit-id: 8eb19e83fd
2024-02-28 20:37:35 +00:00
cedoor
448f25841f chore: update zk-kit dependency versions
Former-commit-id: 1c72af21f1
2024-02-28 20:37:15 +00:00
cedoor
b81098d144 chore(docs): fix beta-v4 getting-started link
Former-commit-id: 41c01b5105
2024-02-28 19:54:30 +00:00
cedoor
6cfcb571ac chore: remove stableVersion field
Former-commit-id: 0c8e25dbf2
2024-02-28 19:49:04 +00:00
cedoor
ffd85050bd chore: v4.0.0-beta
Former-commit-id: d130f5f913
2024-02-28 19:49:04 +00:00
Cedoor
22d55d943c Merge pull request #670 from semaphore-protocol/docs/update-readme
Update readme file

Former-commit-id: 00a570d675
2024-02-28 19:42:25 +00:00
Vivian Plasencia
683a0bb982 Update README.md
Co-authored-by: Cedoor <me@cedoor.dev>
Former-commit-id: ced57c39cc
2024-02-28 20:41:00 +01: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
Vivian Plasencia
b73c8aa7d0 docs: update readme
Former-commit-id: 49c873aff1
2024-02-28 20:18:16 +01:00
Vivian Plasencia
5eb3e168da docs: update readme file
Former-commit-id: c33eef6def
2024-02-28 20:13:06 +01: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
544 changed files with 49297 additions and 10271 deletions

21
.commitlintrc.js Normal file
View File

@@ -0,0 +1,21 @@
const fs = require("node:fs")
const path = require("node:path")
const packages = fs.readdirSync(path.resolve(__dirname, "packages"))
const apps = fs.readdirSync(path.resolve(__dirname, "apps"))
module.exports = {
extends: ["@commitlint/config-conventional"],
prompt: {
scopes: [...packages, ...apps],
markBreakingChangeMode: true,
allowCustomIssuePrefix: false,
allowEmptyIssuePrefix: false,
issuePrefixes: [
{
value: "re",
name: "re: ISSUES related"
}
]
}
}

View File

@@ -1,3 +0,0 @@
{
"extends": ["@commitlint/config-conventional"]
}

View File

@@ -1,8 +1,5 @@
DEFAULT_NETWORK=hardhat
TREE_DEPTH=20
ALL_SNARK_ARTIFACTS=true
REPORT_GAS=false
BACKEND_PRIVATE_KEY=
INFURA_API_KEY=
COINMARKETCAP_API_KEY=
ETHERSCAN_API_KEY=

View File

@@ -24,6 +24,10 @@ dist
build
/docs
# subgraph
subgraph.template.yaml
generated
# Docusaurus cache and generated files
.docusaurus
.cache-loader

View File

@@ -26,5 +26,13 @@
"no-console": ["warn", { "allow": ["info", "warn", "error"] }],
"@typescript-eslint/lines-between-class-members": "off",
"no-param-reassign": "off"
}
},
"overrides": [
{
"files": ["./scripts/*"],
"rules": {
"no-console": "off"
}
}
]
}

1
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1 @@
* @semaphore-protocol/core-devs

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,38 @@
<!-- 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
- [ ] My changes generate no new warnings
- [ ] I have run `yarn format` 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

View File

@@ -1,14 +0,0 @@
name: auto-assign
on:
pull_request:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/auto-assign@v3
with:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
reviewers: org/core-devs

View File

@@ -2,37 +2,36 @@ name: docs
on:
push:
branches:
- main
branches: [main]
paths:
[
"apps/docs/**",
"packages/data/**",
"packages/group/**",
"packages/identity/**",
"packages/proof/**",
"packages/utils/**"
]
jobs:
gh-pages:
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

View File

@@ -6,77 +6,84 @@ 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
- name: Compile contracts
run: yarn compile:contracts
- name: Build packages and apps
run: yarn build
- name: Format
run: yarn format
- 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 libraries
run: yarn build:libraries
- name: Run Prettier
run: yarn prettier
- name: Build subgraph
run: yarn build:subgraph
- name: Run Eslint
run: yarn lint
- 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
# https://stackoverflow.com/a/78377916
- name: Setup Circom deps
run: |
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
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: sudo wget https://github.com/iden3/circom/releases/download/v2.1.9/circom-linux-amd64 -O /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,78 +4,137 @@ 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
- name: Compile contracts
run: yarn compile:contracts
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files_yaml: |
circuits:
- packages/circuits/**/*.{circom,json,ts}
contracts:
- packages/contracts/**/*.{js,json,ts,sol}
docs:
- apps/docs/**/*
libraries:
- packages/**/*.{js,json,ts}
- '!packages/{circuits,contracts}/**/*'
subgraph:
- apps/subgraph/**/*
to_format:
- '**/*.{cjs,js,json,jsx,md,mdx,sol,ts,tsx,yaml,yml}'
to_lint:
- '**/*.{cjs,js,jsx,ts,tsx}'
- name: Build libraries
- if: steps.changed-files.outputs.contracts_any_changed == 'true'
name: Compile and lint contracts
run: |
yarn workspace @semaphore-protocol/utils build
yarn compile:contracts
yarn workspace semaphore-contracts lint
- if: steps.changed-files.outputs.docs_any_changed == 'true'
name: Build and format docs
run: |
yarn workspace semaphore-docs build
yarn workspace semaphore-docs format
- if: steps.changed-files.outputs.libraries_any_changed == 'true'
name: Build libraries
run: yarn build:libraries
- name: Run Prettier
run: yarn prettier
- if: steps.changed-files.outputs.subgraph_any_changed == 'true'
name: Build subgraph
run: |
yarn workspace @semaphore-protocol/utils build
yarn build:subgraph
- name: Run Eslint
run: yarn lint
- if: steps.changed-files.outputs.to_format_any_changed == 'true'
name: Format
run: yarn run prettier --check ${{ steps.changed-files.outputs.to_format_all_changed_files }}
- if: steps.changed-files.outputs.to_lint_any_changed == 'true'
name: Run Eslint
run: yarn run eslint ${{ steps.changed-files.outputs.to_lint_all_changed_files }} --ext .cjs,.js,.jsx,.ts,.tsx
test:
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: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files_yaml: |
circuits:
- packages/circuits/**/*.{circom,json,ts}
contracts:
- packages/contracts/**/*.{js,json,ts,sol}
libraries:
- packages/**/*.{js,json,ts}
- '!packages/{circuits,contracts}/**/*'
subgraph:
- apps/subgraph/**/*
- name: Test contracts and libraries
run: yarn test
# https://github.com/iden3/circuits/blob/8fffb6609ecad0b7bcda19bb908bdb544bdb3cf7/.github/workflows/main.yml#L18-L22
# https://stackoverflow.com/a/78377916
- if: steps.changed-files.outputs.circuits_any_changed == 'true'
name: Setup Circom and Test circuits
run: |
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update && sudo apt-get install -y wget nlohmann-json3-dev libgmp-dev nasm g++ build-essential
sudo wget https://github.com/iden3/circom/releases/download/v2.1.9/circom-linux-amd64 -O /usr/bin/circom && sudo chmod +x /usr/bin/circom
yarn workspace @semaphore-protocol/group build
yarn workspace @semaphore-protocol/identity build
yarn workspace @semaphore-protocol/proof build
yarn workspace @semaphore-protocol/utils build
yarn test:circuits
- if: steps.changed-files.outputs.contracts_any_changed == 'true'
name: Build and Test contracts
run: |
yarn workspace @semaphore-protocol/group build
yarn workspace @semaphore-protocol/identity build
yarn workspace @semaphore-protocol/proof build
yarn workspace @semaphore-protocol/utils build
yarn compile:contracts
yarn test:contracts
- if: steps.changed-files.outputs.libraries_any_changed == 'true'
name: Build and Test libraries
run: yarn build:libraries && yarn test:libraries
- if: steps.changed-files.outputs.subgraph_any_changed == 'true'
name: Build and Test Subgraph
run: |
yarn workspace @semaphore-protocol/utils build
yarn build:subgraph
yarn test:subgraph

View File

@@ -13,31 +13,42 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install soldeer
uses: taiki-e/install-action@v2
with:
tool: soldeer
- name: Store soldeer login credential
env:
SOLDEER_TOKEN: ${{ secrets.SOLDEER_TOKEN }}
run: |
echo "$SOLDEER_TOKEN" > "$GITHUB_WORKSPACE"/soldeer_login
- name: Install Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 20
cache: yarn
registry-url: "https://registry.npmjs.org"
- 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-
- name: Authentication
run: |
echo npmAuthToken: "$NODE_AUTH_TOKEN" >> ./.yarnrc.yml
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install dependencies
run: yarn
- name: Publish packages
run: yarn version:publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
SOLDEER_LOGIN_FILE: ${{ github.workspace }}/soldeer_login
- run: yarn version:release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

11
.gitignore vendored
View File

@@ -73,9 +73,6 @@ dist
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
@@ -89,5 +86,13 @@ packages/contracts/deployed-contracts/localhost.json
!.yarn/sdks
!.yarn/versions
# asdf
.tool-versions
# direnv
.envrc
# Other
snark-artifacts
*.zip

4
.husky/pre-commit Normal file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged

View File

@@ -0,0 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
if [ "$NO_HOOK" != "1" ]; then
exec < /dev/tty && npx czg --hook || true
fi

View File

@@ -1,3 +1,4 @@
{
"**/*.{js,ts}": ["prettier --write", "eslint --fix"]
"**/*.{js,ts,jsx,tsx,md,json,sol,yaml,yml}": "prettier --write",
"**/*.{js,ts,jsx,tsx}": "eslint"
}

View File

@@ -12,21 +12,16 @@ 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
# subgraph
subgraph.template.yaml
generated
# github
.github/ISSUE_TEMPLATE

1
.soldeerignore Normal file
View File

@@ -0,0 +1 @@
package.json

View File

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

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
b3cadff6efb37a12712d12c2553ec703dbcaa4dd

893
.yarn/releases/yarn-4.1.0.cjs vendored Executable file

File diff suppressed because one or more lines are too long

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
@@ -46,7 +46,7 @@ We always use ESLint and Prettier. To check that your code follows the rules, si
For commits it is recommended to use [Conventional Commits](https://www.conventionalcommits.org).
Don't worry if it looks complicated, in our repositories, after `git add`, you can usually run the npm script `yarn commit` to make many of these steps interactive.
Don't worry if it looks complicated, in our repositories, `git commit` opens an interactive app to create your conventional commit.
Each commit message consists of a **header**, a **body** and a **footer**. The **header** has a special format that includes a **type**, a **scope** and a **subject**:
@@ -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

View File

@@ -1,9 +1,9 @@
<p align="center">
<h1 align="center">
<picture>
<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">
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/semaphore-protocol/.github/main/assets/semaphore-logo-light.svg">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/semaphore-protocol/.github/main/assets/semaphore-logo-dark.svg">
<img width="250" alt="Semaphore icon" src="https://raw.githubusercontent.com/semaphore-protocol/.github/main/assets/semaphore-logo-dark.svg">
</picture>
</h1>
</p>
@@ -34,7 +34,9 @@
<a href="https://www.gitpoap.io/gh/semaphore-protocol/semaphore" target="_blank">
<img src="https://public-api.gitpoap.io/v1/repo/semaphore-protocol/semaphore/badge">
</a>
<a href="http://commitizen.github.io/cz-cli/">
<img alt="Commitizen friendly" src="https://img.shields.io/badge/commitizen-friendly-586D76?style=flat-square">
</a>
</p>
<div align="center">
@@ -51,16 +53,23 @@
🔎 Issues
</a>
<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
<a href="https://semaphore.pse.dev/discord">
<a href="https://semaphore.pse.dev/telegram">
🗣️ Chat &amp; Support
</a>
<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
<a href="https://js.semaphore.pse.dev">
💻 API Reference
</a>
</h4>
</div>
| 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. |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Semaphore is a generic privacy layer. Leveraging zero-knowledge technology, users can prove their membership in groups and send messages (extending from votes to endorsements) off-chain or across EVM-compatible blockchains, all without revealing their personal 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.pse.dev](https://semaphore.pse.dev).
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/offchain verification easier. To learn more about Semaphore visit [semaphore.pse.dev](https://semaphore.pse.dev).
> [!IMPORTANT]
> Help Semaphore prosper by sharing your ideas with the PSE [acceleration program](https://github.com/privacy-scaling-explorations/acceleration-program).
## 📦 Packages
@@ -69,6 +78,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">
@@ -216,27 +244,27 @@ The core of the Semaphore protocol is in the [circuit logic](/packages/circuits/
</tr>
<tr>
<td>
<a href="/packages/heyauthn">
@semaphore-protocol/heyauthn
<a href="/packages/utils">
@semaphore-protocol/utils
</a>
<a href="https://js.semaphore.pse.dev/modules/_semaphore_protocol_heyauthn">
<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/heyauthn">
<img src="https://img.shields.io/npm/v/@semaphore-protocol/heyauthn.svg?style=flat-square" alt="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/heyauthn">
<img src="https://img.shields.io/npm/dm/@semaphore-protocol/heyauthn.svg?style=flat-square" alt="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>
<tbody>
</tbody>
</table>
## 🛠 Install
@@ -274,13 +302,13 @@ yarn lint
Run [Prettier](https://prettier.io/) to check formatting rules:
```bash
yarn prettier
yarn format
```
Or to automatically format the code:
```bash
yarn prettier:write
yarn format:write
```
### Conventional commits
@@ -288,19 +316,11 @@ yarn prettier:write
Semaphore uses [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/). A [command line utility](https://github.com/commitizen/cz-cli) to commit using the correct syntax can be used by running:
```bash
yarn commit
git commit
```
It will also automatically check that the modified files comply with ESLint and Prettier rules.
### Snark artifacts
Download the Semaphore snark artifacts needed to generate and verify proofs:
```bash
yarn download:snark-artifacts
```
### Testing
Run [Jest](https://jestjs.io/) to test the JS libraries:
@@ -323,10 +343,10 @@ yarn test
### Build libraries & compile contracts
Run [Rollup](https://www.rollupjs.org) to build all the packages:
Run [Rollup](https://www.rollupjs.org) and [TheGraph](https://www.npmjs.com/package/@graphprotocol/graph-cli) to build all the packages and the subgraph:
```bash
yarn build:libraries
yarn build
```
Compile the smart contracts with [Hardhat](https://hardhat.org/):
@@ -344,3 +364,15 @@ yarn docs
```
The output will be placed on the `docs` folder.
### Releases
Bump a new version with:
```bash
yarn version:bump <version>
# e.g. yarn version:bump 2.0.0
```
It will create a commit and a git tag that will need to be pushed on the main branch. A workflow will be triggered and will
publish the Semaphore packages on [npm](https://www.npmjs.com/) and release a new version on Github with its changelogs automatically.

View File

@@ -34,7 +34,7 @@
🔎 Issues
</a>
<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
<a href="https://semaphore.pse.dev/discord">
<a href="https://semaphore.pse.dev/telegram">
🗣️ Chat &amp; Support
</a>
</h4>

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

View File

@@ -1,96 +0,0 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require("prism-react-renderer/themes/github")
const darkCodeTheme = require("prism-react-renderer/themes/dracula")
/** @type {import('@docusaurus/types').Config} */
module.exports = {
title: "Semaphore",
tagline: "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"]
},
presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
routeBasePath: "/",
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://github.com/semaphore-protocol/website/edit/main/",
includeCurrentVersion: false
},
theme: {
customCss: [require.resolve("./src/css/custom.scss")]
}
})
]
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// announcementBar: {
// id: "semaphore-v3",
// content:
// '<b>We are pleased to announce the release of <a target="_blank" rel="noopener noreferrer" href="https://github.com/semaphore-protocol/semaphore/releases/tag/v3.0.0">Semaphore V3</a> 🎉</b>',
// backgroundColor: "#DAE0FF",
// textColor: "#000000"
// },
navbar: {
logo: {
alt: "Semaphore Logo",
src: "img/semaphore-logo.svg"
},
items: [
{
label: "Whitepaper",
to: "https://docs.semaphore.pse.dev/whitepaper-v1.pdf",
position: "right",
className: "V1"
},
{
label: "Github",
href: "https://github.com/semaphore-protocol",
position: "right"
},
{
type: "localeDropdown",
position: "right"
}
]
},
colorMode: {
defaultMode: "dark",
// 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"]
},
algolia: {
appId: "6P229KVKCB",
apiKey: "879bb5b002b6370f181f0f79f5c2afe2",
indexName: "semaphoreliedzkp",
contextualSearch: true
}
})
}

View File

@@ -0,0 +1,129 @@
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><a href="https://github.com/semaphore-protocol/semaphore/releases/tag/v4.0.0" target="_blank">Semaphore V4</a> is out 🎉 <a href="/getting-started">Try it out</a> and let us know if you have any feedback on <a href="https://semaphore.pse.dev/telegram" target="_blank">Telegram</a> or <a href="https://github.com/orgs/semaphore-protocol/discussions" target="_blank">Github</a>!</b>',
backgroundColor: "#dde6fc",
textColor: "#000000"
},
// Social media card
image: "img/social-media.png",
navbar: {
logo: {
alt: "Semaphore Logo",
src: "img/semaphore-logo.svg"
},
items: [
{
type: "docsVersionDropdown",
position: "left",
dropdownActiveClassDisabled: true
},
{
label: "Whitepaper",
to: "https://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

View File

@@ -386,12 +386,12 @@
"message": "Connect"
},
"footer.right.connect.link1": {
"message": "Discord"
"message": "Telegram"
},
"footer.right.connect.link2": {
"message": "X (Twitter)"
},
"footer.copyright": {
"message": "Copyright © 2023 Ethereum Foundation"
"message": "Copyright © 2024 Ethereum Foundation"
}
}

View File

@@ -386,12 +386,12 @@
"message": "Conecta con nosotros"
},
"footer.right.connect.link1": {
"message": "Discord"
"message": "Telegram"
},
"footer.right.connect.link2": {
"message": "X (Twitter)"
},
"footer.copyright": {
"message": "Copyright © 2023 Ethereum Foundation"
"message": "Copyright © 2024 Ethereum Foundation"
}
}

View File

@@ -40,7 +40,7 @@ For more information, see [Merkle tree in Wikipedia](https://en.wikipedia.org/wi
A value used to prevent double entry or double signalling.
See [Circuit nullifier hash](/technical-reference/circuits/#nullifier-hash).
See [Circuit nullifier hash](/V2/technical-reference/circuits/#nullifier-hash).
## Relay
@@ -48,7 +48,7 @@ A third-party who receives a fee for including relayed transactions in the block
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).
signal to that specific address (https://semaphore.pse.dev/whitepaper-v1.pdf, p.6).
## Trusted setup files
@@ -60,5 +60,5 @@ To generate or verify valid zero-knowledge proofs with Semaphore, applications m
- semaphore.wasm
- semaphore.json
For a complete list of ready-to-use files, see <http://www.trusted-setup-pse.org>.
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

@@ -20,14 +20,14 @@ title: Groups
Use Semaphore in your application or smart contract to create off-chain and on-chain groups.
A [Semaphore group](/glossary/#semaphore-group) contains [identity commitments](/glossary/#identity-commitment) of group members.
A [Semaphore group](/V2/glossary/#semaphore-group) contains [identity commitments](/V2/glossary/#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/#incremental-merkle-tree), and group members (i.e., [identity commitments](/glossary/#identity-commitments)) are tree leaves.
A Semaphore group is an [incremental Merkle tree](/V2/glossary/#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`).

View File

@@ -5,7 +5,7 @@ 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).
In order to join a [Semaphore group](/V2/glossary#semaphore-group), a user must first create a [Semaphore identity](/V2/glossary#semaphore-identity).
A Semaphore identity contains two values generated with the identity:
- Identity trapdoor

View File

@@ -7,7 +7,7 @@ title: 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:
Once a user joins their [Semaphore identity](/V2/glossary#semaphore-identity) to a [Semaphore group](/V2/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.
@@ -27,11 +27,11 @@ To generate a proof, pass the following properties to the `generateProof` functi
- `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).
- `snarkArtifacts`: The `zkey` and `wasm` [trusted setup files](/V2/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),
In the voting system use case, once all the voters have joined their [identities](/V2/guides/identities#create-identities) to the ballot [group](/V2/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
In the call to `generateProof`, the voting system passes the unique ballot ID (the [Merkle tree](/V2/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:
@@ -53,7 +53,7 @@ Use the [`@semaphore-protocol/proof`](https://github.com/semaphore-protocol/sema
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).
- _`verificationKey`_: the JavaScript object in the `semaphore.json` [trusted setup file](/V2/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:

View File

@@ -213,7 +213,7 @@ and [Chai assertions](https://www.chaijs.com/).
wget http://www.trusted-setup-pse.org/semaphore/20/semaphore.wasm
```
Learn more about [trusted setup files](/glossary/#trusted-setup-files).
Learn more about [trusted setup files](/V2/glossary/#trusted-setup-files).
3. Rename the `Lock.js` test file to `Greeter.js` and replace the content with the following:

View File

@@ -6,9 +6,9 @@ sidebar_position: 2
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)
- [**Proof of membership**](/V2/technical-reference/circuits#proof-of-membership)
- [**Nullifier hash**](/V2/technical-reference/circuits#nullifier-hash)
- [**Signal**](/V2/technical-reference/circuits#signal)
![Semaphore circuit](https://github.com/semaphore-protocol/semaphore/raw/v2.6.1/packages/circuits/scheme.png)

View File

@@ -6,9 +6,9 @@ sidebar_position: 3
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)
- [**Base contracts**](/V2/technical-reference/contracts#base-contracts)
- [**Extension contracts**](/V2/technical-reference/contracts#extension-contracts)
- [**Verifiers**](/V2/technical-reference/contracts#verifiers)
:::info
To use Semaphore contracts and interfaces in your project,
@@ -24,7 +24,7 @@ Semaphore provides the following base contracts:
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.
See our [deployed contracts](/V2/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.
@@ -41,7 +41,7 @@ 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).
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](/V2/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`:

View File

@@ -36,7 +36,7 @@ Community members connect their wallets to the dApp to take the following action
### Relay
To preserve anonymity and avoid disclosing the member's wallet address, the dApp may use a [relay](/glossary/#relay) to broadcast the vote.
To preserve anonymity and avoid disclosing the member's wallet address, the dApp may use a [relay](/V2/glossary/#relay) to broadcast the vote.
The relay calls the **contract** function that then posts the member's vote transaction to Ethereum.
## Private voting
@@ -52,7 +52,7 @@ The voting scenario has the following steps:
### 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.
A community coordinator or dApp administrator uses the deployed smart contract to create an on-chain (Ethereum) poll, a [Semaphore group](/V2/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:
@@ -78,11 +78,11 @@ function createPoll(
}
```
A poll is a Semaphore [group](/guides/groups/) that stores the following:
A poll is a Semaphore [group](/V2/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.
- [Semaphore IDs](/V2/guides/identities/) of members who joined the poll.
To create the poll, the administrator calls the smart contract function--for example:
@@ -128,10 +128,10 @@ With a member registered for a poll, learn how the dApp [records votes](#record-
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.
1. Uses the `@semaphore-protocol/proof` library to create a proof of the vote, the poll identifier, the Semaphore ID, and a [nullifier](/V2/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](/quick-setup/) guide.
- 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

@@ -15,9 +15,9 @@ Use cases include private voting, whistleblowing, anonymous DAOs and mixers.
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/).
1. [Create a Semaphore identity](/V2/guides/identities/).
2. [Add their Semaphore identity to a group (i.e. _Merkle tree_)](/V2/guides/groups/).
3. [Send a verifiable, anonymous signal (e.g a vote or endorsement)](/V2/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.

View File

@@ -14,7 +14,7 @@ También proporciona un mecanismo simple para evitar la doble señalización, lo
## ¿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).
Puede hacer preguntas sobre Semaphore en [Telegram](https://semaphore.pse.dev/telegram) o abriendo un [Semaphore Discussion](https://github.com/semaphore-protocol/semaphore/discussions).
## ¿Por qué las identidades requieren tanto `identity trapdoor` como `identity nullifier`?

View File

@@ -9,18 +9,18 @@ sidebar_position: 7
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.
- [Compromiso de identidad](#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).
El valor público de la [identidad Semaphore](#identidad-semaphore) utilizado en los [grupos Semaphore](#grupo-semaphore).
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.
Un grupo es un [árbol de Merkle](#árbol-de-merkle-merkle-tree) binario e incremental en el que cada hoja contiene un [compromiso de identidad](#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.
@@ -39,14 +39,14 @@ Para más información, vea [árbol de Merkle en Wikipedia](https://es.wikipedia
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).
Ver [hash de circuito nullifier](/V3/technical-reference/circuits#hash-anulador-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).
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://semaphore.pse.dev/whitepaper-v1.pdf, p.6).
## Archivos confiables de configuración (Trusted setup files)
@@ -58,7 +58,7 @@ Para generar o verificar pruebas válidas de conocimiento cero con Semaphore, la
- semaphore.wasm
- semaphore.json
Para ver una lista completa de archivos listos para utilizarse, vea <http://www.trusted-setup-pse.org>.
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)

View File

@@ -8,7 +8,7 @@ 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).
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/).
@@ -18,31 +18,36 @@ Hay dos formas para hacer esto, usando [`SemaphoreSubgraph`](https://github.com/
## Instalar librería
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm install @semaphore-protocol/data@^3
```
</TabItem>
```bash
npm install @semaphore-protocol/data
```
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/data@^3
```
</TabItem>
</TabItem>
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/data
```
</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).
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"
@@ -105,11 +110,12 @@ 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).
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"
@@ -170,4 +176,5 @@ const semaphoreEthers = new SemaphoreEthers("sepolia")
const members = await semaphoreEthers.getGroupMembers(groupId)
const group = new Group(groupId, 20, members)
```
:::
:::

View File

@@ -8,65 +8,70 @@ 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.
Un [grupo Semaphore](/V3/glossary/#grupo-semaphore) contiene los [identity commitments](/V3/glossary/#compromiso-de-identidad-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.
- 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.
Un grupo Semaphore es un [árbol de Merkle incremental](/V3/glossary/#árbol-de-merkle-merkle-tree), y los miembros del grupo (por ejemplo, [identity commitments](/V3/glossary/#compromiso-de-identidad-identity-commitment)) 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.
- **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**](#grupos-off-chain-externos-a-la-cadena)
- [**Grupos on-chain**](#grupos-on-chain)
## 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](#crear-un-grupo)
- [Añadir miembros](#añadir-miembros)
- [Remover o actualizar miembros](#remover-o-actualizar-miembros)
### 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.
- `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={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm install @semaphore-protocol/group@^3
```
</TabItem>
```bash
npm install @semaphore-protocol/group
```
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/group@^3
```
</TabItem>
</TabItem>
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/group
```
</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:
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"
@@ -74,7 +79,7 @@ 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:
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"

View File

@@ -8,45 +8,50 @@ 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).
Para unirse a un [grupo Semaphore](/V3/glossary#grupo-semaphore), un usuario primero deberá crear una [identidad Semaphore](/V3/glossary#identidad-semaphore).
Una identidad Semaphore contiene dos valores generados junto con la identidad:
- Identity trapdoor (Identidad trampilla)
- Identity nullifier (Anulador de 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_.
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)
- [**Crear identidades aleatorias**](#crear-identidades-aleatorias)
- [**Crear identidades determinísticas**](#crear-identidades-determinísticas)
### Instalar librería:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm install @semaphore-protocol/identity@^3
```
</TabItem>
```bash
npm install @semaphore-protocol/identity
```
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/identity@^3
```
</TabItem>
</TabItem>
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/identity
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm add @semaphore-protocol/identity@^3
```
</TabItem>
</Tabs>
### Crear identidades aleatorias
@@ -61,8 +66,8 @@ 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).
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
@@ -71,7 +76,7 @@ Ethereum y se utilizan para generar pruebas de conocimiento cero (ZKP) Semaphore
### Crear identidades determinísticas
Si transmite un mensaje como un parámetro, Semaphore genera `trapdoor` y `nullifier`
del hash _SHA256_ del mensaje.
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.

View File

@@ -8,56 +8,61 @@ 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:
Una vez que un usuario liga su [identidad Semaphore](/V3/glossary#identidad-semaphore) a un [grupo Semaphore](/V3/glossary#grupo-semaphore), 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.
- 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 externa a la cadena (off-chain)**](#generar-una-prueba-off-chain)
- [**Verificar una prueba externa a la cadena (off-chain)**](#verificar-una-prueba-off-chain)
- [**Verificar una prueba interna a la cadena (on-chain)**](#verificar-una-prueba-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).
- `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](/V3/glossary/#archivos-confiables-de-configuración-trusted-setup-files).
#### Instalar librería:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm install @semaphore-protocol/proof@^3
```
</TabItem>
```bash
npm install @semaphore-protocol/proof
```
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/proof@^3
```
</TabItem>
</TabItem>
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/proof
```
</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,
En el caso de uso de un sistema de votación, una vez que todos los votantes hayan ligado sus [identidades](/V3/guides/identities#crear-identidades) al [grupo](/V3/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
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](/V3/glossary/#árbol-de-merkle-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:
@@ -79,6 +84,7 @@ Si estás generando la prueba en el lado del cliente, puedes evitar agregar los
```ts
const fullProof = await generateProof(identity, group, externalNullifier, signal)
```
:::
## Verificar una prueba off-chain
@@ -86,8 +92,8 @@ const fullProof = await generateProof(identity, group, externalNullifier, signal
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.
- `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:
@@ -101,20 +107,20 @@ await verifyProof(fullProof, 20) // verdadero o falso.
## Verificar una prueba on-chain
Utilice el contrato [`Semaphore.sol`](/technical-reference/contracts#semaphoresol) para verificar pruebas on-chain.
Utilice el contrato [`Semaphore.sol`](/V3/technical-reference/contracts#semaphoresol) para verificar pruebas on-chain.
:::info
Vea nuestros [contratos desplegados](/deployed-contracts) para encontrar las direcciones adecuadas para su red.
Vea nuestros [contratos desplegados](/V3/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).
- `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 (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.
:::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

@@ -10,13 +10,13 @@ import TabItem from "@theme/TabItem"
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@latest create my-app --template monorepo-ethers
npx @semaphore-protocol/cli@^3 create my-app --template monorepo-ethers
```
De lo contrario, instale `@semaphore-protocol/cli` de forma global y corra el comando `init`:
De lo contrario, instale `@semaphore-protocol/cli@^3` de forma global y corra el comando `init`:
```bash
npm i -g @semaphore-protocol/cli@latest
npm i -g @semaphore-protocol/cli@^3
semaphore create my-app --template monorepo-ethers
```
@@ -31,28 +31,34 @@ El CLI [`semaphore`](https://github.com/semaphore-protocol/semaphore/tree/main/p
Para comenzar a trabajar en su proyecto, instale las siguientes dependencias:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
cd my-app
npm i
```
</TabItem>
```bash
cd my-app
npm i
```
<TabItem value="yarn">
```bash
cd my-app
yarn
```
</TabItem>
</TabItem>
<TabItem value="yarn">
```bash
cd my-app
yarn
```
</TabItem>
<TabItem value="pnpm">
```bash
cd my-app
pnpm install
```
</TabItem>
</Tabs>
## Output
@@ -63,21 +69,21 @@ El comando `create` creará un directorio con el nombre my-app (o cualquier nomb
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
└── 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
└── copy-contracts-artifacts.ts
├── .editorconfig
├── .env
├── .env.example
@@ -107,26 +113,31 @@ cd apps/contracts
Y compile sus contratos al correr:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm run compile
```
</TabItem>
```bash
npm run compile
```
<TabItem value="yarn">
```bash
yarn compile
```
</TabItem>
</TabItem>
<TabItem value="yarn">
```bash
yarn compile
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm compile
```
</TabItem>
</Tabs>
### Pruebe los contratos
@@ -134,76 +145,91 @@ yarn compile
Pruebe sus contratos al correr:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm test
```
</TabItem>
```bash
npm test
```
<TabItem value="yarn">
```bash
yarn test
```
</TabItem>
</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={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm run test:coverage
```
</TabItem>
```bash
npm run test:coverage
```
<TabItem value="yarn">
```bash
yarn test:coverage
```
</TabItem>
</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={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm run test:report-gas
```
</TabItem>
```bash
npm run test:report-gas
```
<TabItem value="yarn">
```bash
yarn test:report-gas
```
</TabItem>
</TabItem>
<TabItem value="yarn">
```bash
yarn test:report-gas
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm test:report-gas
```
</TabItem>
</Tabs>
### Desplegar contratos
@@ -214,66 +240,76 @@ 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.
:::
:::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={[
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm run deploy -- --semaphore <semaphore-address> --group <group-id> --network goerli
```
</TabItem>
```bash
npm run deploy -- --semaphore <semaphore-address> --group <group-id> --network goerli
```
<TabItem value="yarn">
```bash
yarn deploy --semaphore <semaphore-address> --group <group-id> --network goerli
```
</TabItem>
</TabItem>
<TabItem value="yarn">
<TabItem value="pnpm">
```bash
pnpm deploy --semaphore <semaphore-address> --group <group-id> --network goerli
```
</TabItem>
</Tabs>
```bash
yarn deploy --semaphore <semaphore-address> --group <group-id> --network goerli
```
:::note
Revise las direcciones de los contratos de Semaphore [aquí](/V3/deployed-contracts).
:::
</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.
:::
:::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={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm run dev
```
</TabItem>
```bash
npm run dev
```
<TabItem value="yarn">
```bash
yarn dev
```
</TabItem>
</TabItem>
<TabItem value="yarn">
```bash
yarn dev
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm dev
```
</TabItem>
</Tabs>

View File

@@ -6,7 +6,7 @@ sidebar_position: 9
## 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
[Propuesta de la comunidad: Semaphore: Señalización de conocimiento cero (ZK) en Ethereum (v1 Whitepaper)](https://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

View File

@@ -6,9 +6,9 @@ sidebar_position: 2
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)
- [**Prueba de membresía**](#prueba-de-membresía)
- [**Nullifier hash**](#hash-anulador-nullifier-hash) (hash anulador)
- [**Señal**](#señal)
![Semaphore circuit](https://github.com/semaphore-protocol/semaphore/raw/main/packages/circuits/scheme.png)

View File

@@ -6,10 +6,10 @@ sidebar_position: 3
Semaphore incluye dos tipos de contratos:
- [**Contratos base**](/technical-reference/contracts#base-contracts)
- [**Contratos para la extensión**](/technical-reference/contracts#extension-contracts)
- [**Contratos base**](#contratos-base)
- [**Contratos para la extensión**](#contratos-para-la-extensión)
así como [**Semaphore.sol**](/technical-reference/contracts#semaphoresol), el principal contrato desplegado en las redes soportadas por Semaphore.
así como [**Semaphore.sol**](#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).
@@ -23,7 +23,7 @@ Semaphore ofrece los siguientes contratos base:
- [`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.
Puede utilizarlos en su contrato o puede utilizar [**Semaphore.sol**](/V3/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.
@@ -42,9 +42,9 @@ En un futuro se incluirán más extensiones.
[`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 guarda los [hashes anuladores](/V3/technical-reference/circuits#hash-anulador-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.
Visitando [contratos desplegados](/V3/deployed-contracts) puede encontrar las direcciones correspondientes a su red.
::::

View File

@@ -7,7 +7,7 @@ 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).
Si estas sugerencias no funcionan, no dude en preguntar en las [Semaphore Discussions](https://github.com/semaphore-protocol/semaphore/discussions) o en el canal [Semaphore Telegram](https://semaphore.pse.dev/telegram).
## Usando Semaphore en the frontend
@@ -70,49 +70,59 @@ Para resolver eso:
1- Instale `@esbuild-plugins/node-globals-polyfill` y `@esbuild-plugins/node-modules-polyfill`
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm install @esbuild-plugins/node-globals-polyfill
```
</TabItem>
```bash
npm install @esbuild-plugins/node-globals-polyfill
```
<TabItem value="yarn">
```bash
yarn add @esbuild-plugins/node-globals-polyfill
```
</TabItem>
</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={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm install @esbuild-plugins/node-modules-polyfill
```
</TabItem>
```bash
npm install @esbuild-plugins/node-modules-polyfill
```
<TabItem value="yarn">
```bash
yarn add @esbuild-plugins/node-modules-polyfill
```
</TabItem>
</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:

View File

@@ -15,9 +15,9 @@ Algunos de los potenciales casos de uso son: votaciones, denuncias, DAOs anónim
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/).
1. [Crear una identidad Semaphore](/V3/guides/identities/).
2. [Agregar su identidad Semaphore a un grupo (es decir: _Árbol de Merkle_)](/V3/guides/groups/).
3. [Enviar una señal anónima, verificable (ej. un voto o una aprobación)](/V3/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).
@@ -39,7 +39,7 @@ y [librerías en JavaScript](https://github.com/semaphore-protocol/semaphore#-pa
### 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).
Los [parámetros seguros](/V3/glossary#archivos-confiables-de-configuración-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

View File

@@ -1,39 +1,45 @@
{
"name": "semaphore-docs",
"version": "2.0.0",
"private": true,
"scripts": {
"start": "docusaurus start",
"start:es": "docusaurus start --locale es",
"build": "docusaurus build",
"pre-build": "yarn workspace @semaphore-protocol/utils build",
"build": "yarn pre-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"
"write-heading-ids": "docusaurus write-heading-ids",
"format": "remark ./**/*.mdx --frail --quiet",
"format:write": "remark ./**/*.mdx --output"
},
"dependencies": {
"@docusaurus/core": "2.2.0",
"@docusaurus/preset-classic": "2.2.0",
"@mdx-js/react": "^1.6.22",
"@docusaurus/core": "3.5.2",
"@docusaurus/preset-classic": "3.5.2",
"@mdx-js/react": "^3.0.0",
"@semaphore-protocol/utils": "4.6.0",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.2.1",
"docusaurus-plugin-sass": "^0.2.2",
"docusaurus-plugin-sass": "^0.2.5",
"file-loader": "^6.2.0",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"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": "2.2.0",
"@tsconfig/docusaurus": "^1.0.6",
"@types/react": "^17.0.14",
"@types/react-helmet": "^6.1.2",
"@types/react-router-dom": "^5.1.8",
"typescript": "^4.3.5"
"@docusaurus/module-type-aliases": "3.5.2",
"@docusaurus/tsconfig": "3.5.2",
"@types/react": "^18.2.29",
"remark-cli": "^12.0.0",
"remark-frontmatter": "^5.0.0",
"remark-mdx": "^3.0.1",
"remark-preset-lint-consistent": "^6.0.0",
"remark-preset-lint-recommended": "^7.0.0",
"typescript": "~5.2.2"
},
"browserslist": {
"production": [
@@ -46,5 +52,25 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"engines": {
"node": ">=18.0"
},
"remarkConfig": {
"settings": {
"bullet": "-"
},
"plugins": [
"remark-mdx",
"remark-preset-lint-consistent",
"remark-preset-lint-recommended",
[
"remark-frontmatter",
{
"type": "yaml",
"marker": "-"
}
]
]
}
}

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,32 @@
import { deployedContracts, supportedNetworks } from "@semaphore-protocol/utils"
import Heading from "@theme/Heading"
function capitalizeFirstLetter(s: string): string {
return s.charAt(0).toUpperCase() + s.slice(1)
}
export default function DeployedContracts() {
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={`${supportedNetworks[network].explorer}/address/${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

@@ -6,8 +6,12 @@
/* You can override the default Infima variables here. */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600&display=swap");
@import url("https://fonts.googleapis.com/css2?family=DMSans:wght@400;500;600&display=swap");
@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)";
@@ -26,7 +30,7 @@
--custom-gray-1: #eeeef0;
--custom-gray-0: #f7f7f8;
--custom-blue-3: var(--ifm-color-primary);
--custom-blue-2: #758bff;
--custom-blue-2: #3555df;
--custom-blue-1: #f0f4fe;
--custom-blue-0: #f8f9ff;
@@ -58,6 +62,7 @@
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);
@@ -72,13 +77,17 @@ html[data-theme="light"] {
}
html {
font-family: "DMSans", sans-serif;
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-feature-settings:
"ss01" on,
"ss02" on,
"cv01" on,
"cv03" on;
font-weight: 400;
}
@@ -92,7 +101,7 @@ svg.custom-icon circle {
}
p {
font-family: "DMSans", sans-serif;
font-family: "DM Sans", sans-serif;
line-height: 32px;
font-weight: 400;
}
@@ -108,7 +117,6 @@ h2,
h3,
h4,
h5 {
font-family: "Outfit", sans-serif;
font-weight: 500;
}
@@ -141,8 +149,11 @@ h5 {
/* color: var( --ifm-color-primary); */
}
.alert a {
text-decoration-color: inherit;
}
.navbar {
height: 90px;
align-items: center;
box-shadow: none;
font-size: 18px;
@@ -229,6 +240,18 @@ html[data-theme="light"] {
}
}
/* 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; */
@@ -251,22 +274,6 @@ html[data-theme="light"] {
box-shadow: none !important;
}
.navbar__title {
font-family: "Outfit", sans-serif;
color: var(--ifm-color-primary);
font-weight: 500;
}
.navbar__link {
font-family: "Outfit", sans-serif;
color: var(--ifm-color-primary);
font-weight: 400;
}
.navbar__logo {
height: 25px;
}
.menu__link {
font-size: 18px;
font-weight: 400;

View File

@@ -32,7 +32,7 @@ function Footer() {
id: "footer.right.connect.title"
})}
</h3>
<Link href="https://semaphore.pse.dev/discord" target="_blank">
<Link href="https://semaphore.pse.dev/telegram" target="_blank">
{translate({
id: "footer.right.connect.link1"
})}

View File

@@ -1,30 +0,0 @@
import { useLocation } from "@docusaurus/router"
import useDocusaurusContext from "@docusaurus/useDocusaurusContext"
import OriginalNavBarItem from "@theme-original/NavbarItem"
import React from "react"
export default function NavbarItem(props: any) {
const { pathname } = useLocation()
const { i18n } = useDocusaurusContext()
const pathSegments = pathname.split("/")
let version: string
if (i18n.locales.includes(pathSegments[1])) {
;[, , version] = pathSegments
} else {
;[, version] = pathSegments
}
const { className = "" } = props
return (
(!className ||
!(
(className.includes("V1") && version !== "V1") ||
(className.includes("V2") && version !== "V2") ||
(className.includes("V3") && version !== "V3")
)) && <OriginalNavBarItem {...props} />
)
}

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

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

BIN
apps/docs/static/img/social-media.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

View File

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

3
apps/docs/vercel.json Normal file
View File

@@ -0,0 +1,3 @@
{
"cleanUrls": true
}

View File

@@ -21,7 +21,7 @@ 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
## Add, deactivate, or reactivate external nullifiers
**Contract ABI**:

View File

@@ -10,8 +10,8 @@ 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.
2. An identity nullifier, which is a random 32-byte value.
3. An identity trapdoor, which is a random 32-byte value.
An identity commitment is the Pedersen hash of:

View File

@@ -204,7 +204,7 @@ It returns an object as such:
- `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
- `identityPath`: The Merkle path to the identity commitment
- `identityPathIndex`: The leaf index of the identity commitment
- `identityPathElements`: The elements along the above Merkle path

View File

@@ -26,7 +26,7 @@ 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
## Add, deactivate, or reactivate external nullifiers
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

View File

@@ -95,7 +95,7 @@ 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
Solidity, and zk-SNARK circuits written in
[circom](https://github.com/iden3/circom). It also contains Typescript code to
execute tests.

View File

@@ -40,7 +40,7 @@ For more information, see [Merkle tree in Wikipedia](https://en.wikipedia.org/wi
A value used to prevent double entry or double signalling.
See [Circuit nullifier hash](/technical-reference/circuits/#nullifier-hash).
See [Circuit nullifier hash](/V2/technical-reference/circuits/#nullifier-hash).
## Relay
@@ -48,7 +48,7 @@ A third-party who receives a fee for including relayed transactions in the block
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).
signal to that specific address (https://semaphore.pse.dev/whitepaper-v1.pdf, p.6).
## Trusted setup files
@@ -60,5 +60,5 @@ To generate or verify valid zero-knowledge proofs with Semaphore, applications m
- semaphore.wasm
- semaphore.json
For a complete list of ready-to-use files, see <http://www.trusted-setup-pse.org>.
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

@@ -20,14 +20,14 @@ title: Groups
Use Semaphore in your application or smart contract to create off-chain and on-chain groups.
A [Semaphore group](/glossary/#semaphore-group) contains [identity commitments](/glossary/#identity-commitment) of group members.
A [Semaphore group](/V2/glossary/#semaphore-group) contains [identity commitments](/V2/glossary/#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/#incremental-merkle-tree), and group members (i.e., [identity commitments](/glossary/#identity-commitments)) are tree leaves.
A Semaphore group is an [incremental Merkle tree](/V2/glossary/#merkle-tree), and group members (i.e., [identity commitments](/V2/glossary/#identity-commitment)) 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`).

View File

@@ -5,7 +5,7 @@ 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).
In order to join a [Semaphore group](/V2/glossary#semaphore-group), a user must first create a [Semaphore identity](/V2/glossary#semaphore-identity).
A Semaphore identity contains two values generated with the identity:
- Identity trapdoor

View File

@@ -7,7 +7,7 @@ title: 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:
Once a user joins their [Semaphore identity](/V2/glossary#semaphore-identity) to a [Semaphore group](/V2/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.
@@ -27,11 +27,11 @@ To generate a proof, pass the following properties to the `generateProof` functi
- `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).
- `snarkArtifacts`: The `zkey` and `wasm` [trusted setup files](/V2/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),
In the voting system use case, once all the voters have joined their [identities](/guides/identities#create-identities) 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
In the call to `generateProof`, the voting system passes the unique ballot ID (the [Merkle tree](/V2/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:
@@ -53,7 +53,7 @@ Use the [`@semaphore-protocol/proof`](https://github.com/semaphore-protocol/sema
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).
- _`verificationKey`_: the JavaScript object in the `semaphore.json` [trusted setup file](/V2/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:

View File

@@ -213,7 +213,7 @@ and [Chai assertions](https://www.chaijs.com/).
wget http://www.trusted-setup-pse.org/semaphore/20/semaphore.wasm
```
Learn more about [trusted setup files](/glossary/#trusted-setup-files).
Learn more about [trusted setup files](/V2/glossary/#trusted-setup-files).
3. Rename the `Lock.js` test file to `Greeter.js` and replace the content with the following:

View File

@@ -6,9 +6,9 @@ sidebar_position: 2
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)
- [**Proof of membership**](/V2/technical-reference/circuits#proof-of-membership)
- [**Nullifier hash**](/V2/technical-reference/circuits#nullifier-hash)
- [**Signal**](/V2/technical-reference/circuits#signal)
![Semaphore circuit](https://github.com/semaphore-protocol/semaphore/raw/v2.6.1/packages/circuits/scheme.png)

View File

@@ -6,9 +6,9 @@ sidebar_position: 3
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)
- [**Base contracts**](/V2/technical-reference/contracts#base-contracts)
- [**Extension contracts**](/V2/technical-reference/contracts#extension-contracts)
- [**Verifiers**](/V2/technical-reference/contracts#verifiers)
:::info
To use Semaphore contracts and interfaces in your project,
@@ -24,7 +24,7 @@ Semaphore provides the following base contracts:
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/contracts/Semaphore.sol), which inherits them for you.
See our [deployed contracts](/deployed-contracts#semaphore) to find the addresses for your network.
See our [deployed contracts](/V2/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.
@@ -41,10 +41,10 @@ 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/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/contracts/verifiers) you prefer or you can use one of our [deployed verifiers](/deployed-contracts#verifiers).
You can choose to manually deploy the [verifier](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts/contracts/verifiers) you prefer or you can use one of our [deployed verifiers](/V2/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.
- The [group](/V2/guides/groups) used for the proof can have a maximum `2^20=1048576` members.

View File

@@ -36,7 +36,7 @@ Community members connect their wallets to the dApp to take the following action
### Relay
To preserve anonymity and avoid disclosing the member's wallet address, the dApp may use a [relay](/glossary/#relay) to broadcast the vote.
To preserve anonymity and avoid disclosing the member's wallet address, the dApp may use a [relay](/V2/glossary/#relay) to broadcast the vote.
The relay calls the **contract** function that then posts the member's vote transaction to Ethereum.
## Private voting
@@ -52,7 +52,7 @@ The voting scenario has the following steps:
### 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.
A community coordinator or dApp administrator uses the deployed smart contract to create an on-chain (Ethereum) poll, a [Semaphore group](/V2/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:
@@ -77,11 +77,11 @@ function createPoll(
}
```
A poll is a Semaphore [group](/guides/groups/) that stores the following:
A poll is a Semaphore [group](/V2/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.
- [Semaphore IDs](/V2/guides/identities/) of members who joined the poll.
To create the poll, the administrator calls the smart contract function--for example:
@@ -127,10 +127,10 @@ With a member registered for a poll, learn how the dApp [records votes](#record-
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.
1. Uses the `@semaphore-protocol/proof` library to create a proof of the vote, the poll identifier, the Semaphore ID, and a [nullifier](/V2/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](/quick-setup/) guide.
- 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

@@ -15,9 +15,9 @@ Use cases include private voting, whistleblowing, anonymous DAOs and mixers.
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/).
1. [Create a Semaphore identity](/V2/guides/identities/).
2. [Add their Semaphore identity to a group (i.e. _Merkle tree_)](/V2/guides/groups/).
3. [Send a verifiable, anonymous signal (e.g a vote or endorsement)](/V2/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.

View File

@@ -14,7 +14,7 @@ It also provides a simple mechanism to prevent double-signaling, which means you
## Where can I ask questions about Semaphore?
You can ask questions about Semaphore on [Discord](https://semaphore.pse.dev/discord) or by opening a [Semaphore Discussion](https://github.com/semaphore-protocol/semaphore/discussions).
You can ask questions about Semaphore on [Telegram](https://semaphore.pse.dev/telegram) or by opening a [Semaphore Discussion](https://github.com/semaphore-protocol/semaphore/discussions).
## Why do identities require both the `identity trapdoor` and the `identity nullifier`?
@@ -30,7 +30,7 @@ Finally, the nullifier hash is just the hash of the identity nullifier and the e
In the case of a voting application, if you have a group and you want all members of this group to vote only once, you can use the id of the group as an external nullifier. When a user votes the first time, you can save the hash of their identity nullifier and the group id (i.e. the nullifier hash) and prevent double-voting by checking if that hash already exists.
See the [Semaphore circuits](https://docs.semaphore.pse.dev/technical-reference/circuits) for more technical information, or the [Semaphore boilerplate](https://github.com/semaphore-protocol/boilerplate) for a real use-case.
See the [Semaphore circuits](https://docs.semaphore.pse.dev/technical-reference/circuits) for more technical information, or the [Semaphore boilerplate](https://github.com/semaphore-protocol/boilerplate/tree/version/3) for a real use-case.
## Why should I prevent proofs from being verified twice?
@@ -44,11 +44,11 @@ You can find some applications that are using Semaphore in [this blog post](http
## How can I start a project using Semaphore?
There are three ways you can start using Semaphore in your project: using the [Semaphore CLI](https://github.com/semaphore-protocol/semaphore/tree/main/packages/cli), using the [Semaphore boilerplate](https://github.com/semaphore-protocol/boilerplate) as a template or forking it, or installing the Semaphore packages manually.
There are three ways you can start using Semaphore in your project: using the [Semaphore CLI](https://github.com/semaphore-protocol/semaphore/tree/v3.15.2/packages/cli), using the [Semaphore boilerplate](https://github.com/semaphore-protocol/boilerplate/tree/version/3) as a template or forking it, or installing the Semaphore packages manually.
### Semaphore CLI
To create a new project you could use `npx` or install the [Semaphore CLI](https://github.com/semaphore-protocol/semaphore/tree/main/packages/cli) globally using `npm` and then create the new project using the `semaphore create` command. See the [Quick Setup](https://docs.semaphore.pse.dev/quick-setup) for more information.
To create a new project you could use `npx` or install the [Semaphore CLI](https://github.com/semaphore-protocol/semaphore/tree/v3.15.2/packages/cli) globally using `npm` and then create the new project using the `semaphore create` command. See the [Quick Setup](https://docs.semaphore.pse.dev/quick-setup) for more information.
There are three supported templates right now: `contracts-hardhat`, `monorepo-ethers` and `monorepo-subgraph`.
@@ -65,7 +65,7 @@ The Semaphore CLI can also be used to get group data from a supported network. T
### Semaphore boilerplate
To create a project, you could also use the [Semaphore boilerplate](https://github.com/semaphore-protocol/boilerplate). You could fork it or use it as a template.
To create a project, you could also use the [Semaphore boilerplate](https://github.com/semaphore-protocol/boilerplate/tree/version/3). You could fork it or use it as a template.
The Semaphore CLI templates and the Semaphore boilerplate contain the same code, which is a feedback application where you can create an identity, join a group, and send your feedback anonymously. They are almost the same, the only difference is that the templates use plain CSS so you can decide the CSS framework or library you want to use and the boilerplate uses [ChakraUI](https://chakra-ui.com/) by default.

View File

@@ -37,9 +37,9 @@ For more information, see [Merkle tree in Wikipedia](https://en.wikipedia.org/wi
## Nullifier
A value used to prevent double entry or double signalling.
A value used to prevent double entry or double signaling.
See [Circuit nullifier hash](/technical-reference/circuits/#nullifier-hash).
See [Circuit nullifier hash](/V3/technical-reference/circuits/#nullifier-hash).
## Relay
@@ -47,7 +47,7 @@ A third-party who receives a fee for including relayed transactions in the block
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).
signal to that specific address (https://semaphore.pse.dev/whitepaper-v1.pdf, p.6).
## Trusted setup files
@@ -59,7 +59,7 @@ To generate or verify valid zero-knowledge proofs with Semaphore, applications m
- semaphore.wasm
- semaphore.json
For a complete list of ready-to-use files, see <http://www.trusted-setup-pse.org>.
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).
## Signals

View File

@@ -8,9 +8,9 @@ import TabItem from "@theme/TabItem"
# Semaphore data
To fetch on-chain data from the [Semaphore.sol](https://github.com/semaphore-protocol/semaphore/blob/main/packages/contracts/contracts/Semaphore.sol) contract, you can use the [@semaphore-protocol/data](https://github.com/semaphore-protocol/semaphore/tree/main/packages/data) library.
To fetch on-chain data from the [Semaphore.sol](https://github.com/semaphore-protocol/semaphore/blob/v3.15.2/packages/contracts/contracts/Semaphore.sol) contract, you can use the [@semaphore-protocol/data](https://github.com/semaphore-protocol/semaphore/tree/v3.15.2/packages/data) library.
There are two ways to do this, using [`SemaphoreSubgraph`](https://github.com/semaphore-protocol/semaphore/blob/main/packages/data/src/subgraph.ts) or [`SemaphoreEthers`](https://github.com/semaphore-protocol/semaphore/blob/main/packages/data/src/ethers.ts). The `SemaphoreSubgraph` class uses the [Semaphore subgraph](https://github.com/semaphore-protocol/subgraph), which uses [The Graph Protocol](https://thegraph.com/) under the hood, and the `SemaphoreEthers` class uses [Ethers](https://github.com/ethers-io/ethers.js/).
There are two ways to do this, using [`SemaphoreSubgraph`](https://github.com/semaphore-protocol/semaphore/blob/v3.15.2/packages/data/src/subgraph.ts) or [`SemaphoreEthers`](https://github.com/semaphore-protocol/semaphore/blob/v3.15.2/packages/data/src/ethers.ts). The `SemaphoreSubgraph` class uses the [Semaphore subgraph](https://github.com/semaphore-protocol/subgraph), which uses [The Graph Protocol](https://thegraph.com/) under the hood, and the `SemaphoreEthers` class uses [Ethers](https://github.com/ethers-io/ethers.js/).
- [**Fetch data using SemaphoreSubgraph**](#fetch-data-using-semaphoresubgraph)
- [**Fetch data using SemaphoreEthers**](#fetch-data-using-semaphoreethers)
@@ -18,31 +18,36 @@ There are two ways to do this, using [`SemaphoreSubgraph`](https://github.com/se
## Install library
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm install @semaphore-protocol/data@^3
```
</TabItem>
```bash
npm install @semaphore-protocol/data
```
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/data@^3
```
</TabItem>
</TabItem>
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/data
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm add @semaphore-protocol/data@^3
```
</TabItem>
</Tabs>
## Fetch data using SemaphoreSubgraph
To fetch data using the Semaphore subgraph you can use the [`SemaphoreSubgraph`](https://github.com/semaphore-protocol/semaphore/blob/main/packages/data/src/subgraph.ts) class from the [@semaphore-protocol/data](https://github.com/semaphore-protocol/semaphore/tree/main/packages/data) package.
To fetch data using the Semaphore subgraph you can use the [`SemaphoreSubgraph`](https://github.com/semaphore-protocol/semaphore/blob/v3.15.2/packages/data/src/subgraph.ts) class from the [@semaphore-protocol/data](https://github.com/semaphore-protocol/semaphore/tree/v3.15.2/packages/data) package.
```typescript
import { SemaphoreSubgraph } from "@semaphore-protocol/data"
@@ -105,11 +110,12 @@ const semaphoreSubgraph = new SemaphoreSubgraph("sepolia")
const { members } = await semaphoreSubgraph.getGroup(groupId, { members: true })
const group = new Group(groupId, 20, members)
```
:::
## Fetch data using SemaphoreEthers
To fetch data using Ethers you can use the [`SemaphoreEthers`](https://github.com/semaphore-protocol/semaphore/blob/main/packages/data/src/ethers.ts) class from the [@semaphore-protocol/data](https://github.com/semaphore-protocol/semaphore/tree/main/packages/data) package.
To fetch data using Ethers you can use the [`SemaphoreEthers`](https://github.com/semaphore-protocol/semaphore/blob/v3.15.2/packages/data/src/ethers.ts) class from the [@semaphore-protocol/data](https://github.com/semaphore-protocol/semaphore/tree/v3.15.2/packages/data) package.
```typescript
import { SemaphoreEthers } from "@semaphore-protocol/data"
@@ -123,7 +129,7 @@ const semaphoreEthers = new SemaphoreEthers("homestead", {
})
// or:
const semaphoreEthers = new SemaphoreEthers("http://localhost:8545", {
const semaphoreEthers = new SemaphoreEthers("http://127.0.0.1:8545", {
address: "semaphore-address"
})
```
@@ -170,4 +176,5 @@ const semaphoreEthers = new SemaphoreEthers("sepolia")
const members = await semaphoreEthers.getGroupMembers(groupId)
const group = new Group(groupId, 20, members)
```
:::
:::

View File

@@ -8,65 +8,70 @@ import TabItem from "@theme/TabItem"
# Semaphore groups
A [Semaphore group](/glossary/#semaphore-group) contains [identity commitments](/glossary/#identity-commitment) of group members.
A [Semaphore group](/V3/glossary/#semaphore-group) contains [identity commitments](/V3/glossary/#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.
- 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/#incremental-merkle-tree), and group members (i.e., [identity commitments](/glossary/#identity-commitments)) are tree leaves.
A Semaphore group is an [incremental Merkle tree](/V3/glossary/#merkle-tree), and group members (i.e., [identity commitments](/V3/glossary/#identity-commitment)) are tree leaves.
Semaphore groups set the following three parameters:
- **Group id**: a unique identifier for the group;
- **Tree depth**: the maximum number of members a group can contain (`max size = 2 ^ tree depth`);
- **Members**: the list of members to initialize the group.
- **Group id**: a unique identifier for the group;
- **Tree depth**: the maximum number of members a group can contain (`max size = 2 ^ tree depth`);
- **Members**: the list of members to initialize the group.
Learn how to work with groups.
- [**Off-chain groups**](#off-chain-groups)
- [**On-chain groups**](#on-chain-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](#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/blob/main/packages/group) library `Group` class to create an off-chain group with the following parameters:
Use the [`@semaphore-protocol/group`](https://github.com/semaphore-protocol/semaphore/blob/v3.15.2/packages/group) library `Group` class to create an off-chain group with the following parameters:
- `Group id`: a unique identifier for the group;
- `Tree depth`: (_default `20`_) the maximum number of members a group can contain (`max size = 2 ^ tree depth`).
- `Members`: (_default `[]`_) the list of members to initialize the group.
- `Group id`: a unique identifier for the group;
- `Tree depth`: (*default `20`*) the maximum number of members a group can contain (`max size = 2 ^ tree depth`).
- `Members`: (*default `[]`*) the list of members to initialize the group.
#### Install library:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm install @semaphore-protocol/group@^3
```
</TabItem>
```bash
npm install @semaphore-protocol/group
```
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/group@^3
```
</TabItem>
</TabItem>
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/group
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm add @semaphore-protocol/group@^3
```
</TabItem>
</Tabs>
To create a group with default _`treeDepth`_, call the `Group` constructor without the second parameter. For example:
To create a group with default *`treeDepth`*, call the `Group` constructor without the second parameter. For example:
```ts
import { Group } from "@semaphore-protocol/group"
@@ -74,7 +79,7 @@ import { Group } from "@semaphore-protocol/group"
const group = new Group(1)
```
The following example code passes _`treeDepth`_ to create a group for `2 ^ 30 = 1073741824` members:
The following example code passes *`treeDepth`* to create a group for `2 ^ 30 = 1073741824` members:
```ts
import { Group } from "@semaphore-protocol/group"
@@ -134,13 +139,13 @@ Given that the node isn't removed, and the length of the `group.members` array d
## On-chain groups
The [`SemaphoreGroups`](https://github.com/semaphore-protocol/semaphore/blob/main/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.
The [`SemaphoreGroups`](https://github.com/semaphore-protocol/semaphore/blob/v3.15.2/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.sol` and other Semaphore contracts from the [`@semaphore-protocol/contracts`](https://github.com/semaphore-protocol/semaphore/tree/main/packages/contracts) NPM module.
You can import `SemaphoreGroups.sol` and other Semaphore contracts from the [`@semaphore-protocol/contracts`](https://github.com/semaphore-protocol/semaphore/tree/v3.15.2/packages/contracts) NPM module.
:::
Alternatively, you can use an already deployed [`Semaphore.sol`](https://github.com/semaphore-protocol/semaphore/blob/main/packages/contracts/contracts/Semaphore.sol) contract and use its group external functions.
Alternatively, you can use an already deployed [`Semaphore.sol`](https://github.com/semaphore-protocol/semaphore/blob/v3.15.2/packages/contracts/contracts/Semaphore.sol) contract and use its group external functions.
:::caution
`Semaphore.sol` does not check if a member with a specific identity commitment already exists in a group. This check must be done off-chain.

View File

@@ -8,45 +8,50 @@ import TabItem from "@theme/TabItem"
# Semaphore identities
In order to join a [Semaphore group](/glossary#semaphore-group), a user must first create a [Semaphore identity](/glossary#semaphore-identity).
In order to join a [Semaphore group](/V3/glossary#semaphore-group), a user must first create a [Semaphore identity](/V3/glossary#semaphore-identity).
A Semaphore identity contains two values generated with the identity:
- Identity trapdoor
- identity nullifier
- 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/main/packages/identity) library to create a Semaphore identity _deterministically_ (from the hash of a message) or _randomly_.
In your code, use the [`@semaphore-protocol/identity`](https://github.com/semaphore-protocol/semaphore/tree/v3.15.2/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**](#create-random-identities)
- [**Create deterministic identities**](#create-deterministic-identities)
### Install library:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm install @semaphore-protocol/identity@^3
```
</TabItem>
```bash
npm install @semaphore-protocol/identity
```
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/identity@^3
```
</TabItem>
</TabItem>
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/identity
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm add @semaphore-protocol/identity@^3
```
</TabItem>
</Tabs>
### Create random identities
@@ -61,8 +66,8 @@ 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_.
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
@@ -71,7 +76,7 @@ Ethereum private keys and are used to generate Semaphore zero-knowledge proofs a
### Create deterministic identities
If you pass a message as a parameter, Semaphore generates `trapdoor` and `nullifier`
from the _SHA256_ hash of the message.
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.

View File

@@ -8,56 +8,61 @@ import TabItem from "@theme/TabItem"
# Semaphore 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:
Once a user joins their [Semaphore identity](/V3/glossary#semaphore-identity) to a [Semaphore group](/V3/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.
- 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**](#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/main/packages/proof) library to generate an off-chain proof.
Use the [`@semaphore-protocol/proof`](https://github.com/semaphore-protocol/semaphore/tree/v3.15.2/packages/proof) library to generate an off-chain proof.
To generate a proof, pass the following parameters 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).
- `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](/V3/glossary/#trusted-setup-files).
#### Install library:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm install @semaphore-protocol/proof@^3
```
</TabItem>
```bash
npm install @semaphore-protocol/proof
```
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/proof@^3
```
</TabItem>
</TabItem>
<TabItem value="yarn">
```bash
yarn add @semaphore-protocol/proof
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm add @semaphore-protocol/proof@^3
```
</TabItem>
</Tabs>
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),
In the voting system use case, once all the voters have joined their [identities](/V3/guides/identities#create-identities) to the ballot [group](/V3/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
In the call to `generateProof`, the voting system passes the unique ballot ID (the [Merkle tree](/V3/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:
@@ -79,15 +84,16 @@ If you are generating the proof on the client side, you can avoid adding the sna
```ts
const fullProof = await generateProof(identity, group, externalNullifier, signal)
```
:::
## Verify a proof off-chain
Use the [`@semaphore-protocol/proof`](https://github.com/semaphore-protocol/semaphore/tree/main/packages/proof) library to verify a Semaphore proof off-chain.
Use the [`@semaphore-protocol/proof`](https://github.com/semaphore-protocol/semaphore/tree/v3.15.2/packages/proof) library to verify a Semaphore proof off-chain.
To verify a proof, pass the following to the `verifyProof` function:
- `fullProof`: the Semaphore proof;
- `treeDepth`: the Merkle tree depth.
- `fullProof`: the Semaphore proof;
- `treeDepth`: the Merkle tree depth.
The following code sample shows how to verify the previously generated proof:
@@ -101,21 +107,21 @@ await verifyProof(fullProof, 20) // true or false.
## Verify a proof on-chain
Use the [`Semaphore.sol`](/technical-reference/contracts#semaphoresol) contract to verify proofs on-chain.
Use the [`Semaphore.sol`](/V3/technical-reference/contracts#semaphoresol) contract to verify proofs on-chain.
:::info
See our [deployed contracts](/deployed-contracts) to find the addresses for your network.
See our [deployed contracts](/V3/deployed-contracts) to find the addresses for your network.
::::
To verify Semaphore proofs in your contract, import `ISemaphore.sol`, pass it the `Semaphore.sol` address and call the `verifyProof` method with following parameters:
- `groupId`: the identifier of the group;
- `merkleTreeRoot`: the root of the Merkle tree;
- `signal`: the signal the user wants to send anonymously;
- `nullifierHash`: a [nullifier hash](#retrieve-a-nullifier-hash);
- `externalNullifier`: the value that prevents double-signaling;
- `proof`: a [Solidity-compatible Semaphore proof](#generate-a-solidity-compatible-proof).
- `groupId`: the identifier of the group;
- `merkleTreeRoot`: the root of the Merkle tree;
- `signal`: the signal the user wants to send anonymously;
- `nullifierHash`: a nullifier hash;
- `externalNullifier`: the value that prevents double-signaling;
- `proof`: a Solidity-compatible Semaphore proof.
:::info
You can import `ISemaphore.sol` and other Semaphore contracts from the [`@semaphore-protocol/contracts`](https://github.com/semaphore-protocol/semaphore/tree/main/packages/contracts) NPM module.
You can import `ISemaphore.sol` and other Semaphore contracts from the [`@semaphore-protocol/contracts`](https://github.com/semaphore-protocol/semaphore/tree/v3.15.2/packages/contracts) NPM module.
:::

View File

@@ -10,49 +10,55 @@ import TabItem from "@theme/TabItem"
Semaphore provides an official CLI to set up your project with Hardhat. If your NPM version is 5.2 or higher you can use NPX:
```bash
npx @semaphore-protocol/cli@latest create my-app --template monorepo-ethers
npx @semaphore-protocol/cli@^3 create my-app --template monorepo-ethers
```
Otherwise, install `@semaphore-protocol/cli` globally and run the `create` command:
Otherwise, install `@semaphore-protocol/cli@^3` globally and run the `create` command:
```bash
npm i -g @semaphore-protocol/cli@latest
npm i -g @semaphore-protocol/cli@^3
semaphore create my-app --template monorepo-ethers
```
:::info
The supported templates are: [`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).
The supported templates are: [`contracts-hardhat`](https://github.com/semaphore-protocol/semaphore/tree/v3.15.2/packages/cli-template-contracts-hardhat), [`monorepo-ethers`](https://github.com/semaphore-protocol/semaphore/tree/v3.15.2/packages/cli-template-monorepo-ethers), [`monorepo-subgraph`](https://github.com/semaphore-protocol/semaphore/tree/v3.15.2/packages/cli-template-monorepo-subgraph).
:::
:::info
The [`semaphore CLI`](https://github.com/semaphore-protocol/semaphore/tree/main/packages/cli) can also be used to get group data from a supported network (e.g `semaphore get-groups --network arbitrum-goerli`).
The [`semaphore CLI`](https://github.com/semaphore-protocol/semaphore/tree/v3.15.2/packages/cli) can also be used to get group data from a supported network (e.g `semaphore get-groups --network arbitrum-goerli`).
:::
To start working on your project, install the dependencies:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
cd my-app
npm i
```
</TabItem>
```bash
cd my-app
npm i
```
<TabItem value="yarn">
```bash
cd my-app
yarn
```
</TabItem>
</TabItem>
<TabItem value="yarn">
```bash
cd my-app
yarn
```
</TabItem>
<TabItem value="pnpm">
```bash
cd my-app
pnpm install
```
</TabItem>
</Tabs>
## Output
@@ -63,21 +69,21 @@ The `create` command will create a directory called my-app (or whatever name you
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
└── 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
└── copy-contracts-artifacts.ts
├── .editorconfig
├── .env
├── .env.example
@@ -92,7 +98,7 @@ my-app
└── tsconfig.json
```
The `Feedback.sol` contract creates a Semaphore group, allows users to join that group with their Semaphore identity, and finally allows group members to send an anonymous feedback.
The `Feedback.sol` contract creates a Semaphore group, allows users to join that group with their Semaphore identity, and finally allows group members to send an anonymous feedback.
## Usage
@@ -107,26 +113,31 @@ cd apps/contracts
And compile your contracts:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm run compile
```
</TabItem>
```bash
npm run compile
```
<TabItem value="yarn">
```bash
yarn compile
```
</TabItem>
</TabItem>
<TabItem value="yarn">
```bash
yarn compile
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm compile
```
</TabItem>
</Tabs>
### Test contracts
@@ -134,76 +145,91 @@ yarn compile
Test your contracts:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm test
```
</TabItem>
```bash
npm test
```
<TabItem value="yarn">
```bash
yarn test
```
</TabItem>
</TabItem>
<TabItem value="yarn">
```bash
yarn test
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm test
```
</TabItem>
</Tabs>
Generate a test coverage report:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm run test:coverage
```
</TabItem>
```bash
npm run test:coverage
```
<TabItem value="yarn">
```bash
yarn test:coverage
```
</TabItem>
</TabItem>
<TabItem value="yarn">
```bash
yarn test:coverage
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm test:coverage
```
</TabItem>
</Tabs>
Or a test gas report:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm run test:report-gas
```
</TabItem>
```bash
npm run test:report-gas
```
<TabItem value="yarn">
```bash
yarn test:report-gas
```
</TabItem>
</TabItem>
<TabItem value="yarn">
```bash
yarn test:report-gas
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm test:report-gas
```
</TabItem>
</Tabs>
### Deploy contracts
@@ -214,66 +240,76 @@ In the project root folder:
1. Add your environment variables in the `.env` file.
:::note
You should at least set a valid Infura API Key (you could use Alchemy as well) and a private key with some ethers.
:::
:::note
You should at least set a valid Infura API Key (you could use Alchemy as well) and a private key with some ethers.
:::
2. Go to the `apps/contracts` folder and deploy your contract.
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm run deploy -- --semaphore <semaphore-address> --group <group-id> --network arbitrum-goerli
```
</TabItem>
```bash
npm run deploy -- --semaphore <semaphore-address> --group <group-id> --network arbitrum-goerli
```
<TabItem value="yarn">
```bash
yarn deploy --semaphore <semaphore-address> --group <group-id> --network arbitrum-goerli
```
</TabItem>
</TabItem>
<TabItem value="yarn">
<TabItem value="pnpm">
```bash
pnpm deploy --semaphore <semaphore-address> --group <group-id> --network arbitrum-goerli
```
</TabItem>
</Tabs>
```bash
yarn deploy --semaphore <semaphore-address> --group <group-id> --network arbitrum-goerli
```
:::note
Check the Semaphore contract addresses [here](/V3/deployed-contracts).
:::
</TabItem>
</Tabs>
:::note
Check the Semaphore contract addresses [here](/deployed-contracts).
:::
:::caution
The group id is a number.
:::
:::caution
The group id is a number.
:::
### Start app
Start the application:
<Tabs
defaultValue="npm"
groupId="package-managers"
values={[
defaultValue="npm"
groupId="package-managers"
values={[
{label: 'npm', value: 'npm'},
{label: 'Yarn', value: 'yarn'},
]}>
<TabItem value="npm">
{label: 'pnpm', value: 'pnpm'}
]}
>
<TabItem value="npm">
```bash
npm run dev
```
</TabItem>
```bash
npm run dev
```
<TabItem value="yarn">
```bash
yarn dev
```
</TabItem>
</TabItem>
<TabItem value="yarn">
```bash
yarn dev
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm dev
```
</TabItem>
</Tabs>

View File

@@ -6,12 +6,14 @@ sidebar_position: 9
## Articles
[Community Proposal: Semaphore: Zero-Knowledge Signaling on Ethereum (Whitepaper v1)](https://docs.semaphore.pse.dev/whitepaper-v1.pdf) - Kobi Gurkan, Koh Wei Jie and Barry WhiteHat
[Community Proposal: Semaphore: Zero-Knowledge Signaling on Ethereum (Whitepaper v1)](https://semaphore.pse.dev/whitepaper-v1.pdf) - Kobi Gurkan, Koh Wei Jie and Barry WhiteHat
[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
[Semaphore V2 is Live!](https://medium.com/privacy-scaling-explorations/semaphore-v2-is-live-f263e9372579) - Privacy and Scaling Explorations
[Zero-Knowledge Group Membership Management With Semaphore](https://medium.com/javascript-in-plain-english/zero-knowledge-group-membership-management-with-the-semaphore-protocol-1a63126de81c) - Laszlo Fazekas
## Videos
[Privacy in Ethereum](https://www.youtube.com/watch?v=maDHYyj30kg) - Barry WhiteHat at the Taipei Ethereum Meetup

View File

@@ -6,7 +6,7 @@ sidebar_position: 6
[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/blob/main/packages/contracts/Semaphore.sol) smart contract.
Semaphore's subgraph allows you to retrieve data from the [`Semaphore.sol`](https://github.com/semaphore-protocol/semaphore/blob/v3.15.2/packages/contracts/Semaphore.sol) smart contract.
:::tip
The Graph protocol uses the [GraphQL](https://graphql.org/) query language. 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.

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