Compare commits
613 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bada8b8792 | ||
|
|
e93b19c566 | ||
|
|
862f715d05 | ||
|
|
3ed6c38587 | ||
|
|
7e183f3d2c | ||
|
|
901d0954c0 | ||
|
|
caebc1a4ab | ||
|
|
9b419f0c78 | ||
|
|
c67b888eb6 | ||
|
|
376cd11808 | ||
|
|
58132a9478 | ||
|
|
fadcf19206 | ||
|
|
3be17268ab | ||
|
|
82cdc60af6 | ||
|
|
6c9ede6931 | ||
|
|
e6576cdc47 | ||
|
|
c07dc88490 | ||
|
|
67060dd412 | ||
|
|
a4e540d8f4 | ||
|
|
79976f33cb | ||
|
|
822530f2cf | ||
|
|
b3f862979d | ||
|
|
06e11d5c34 | ||
|
|
88d4470b11 | ||
|
|
bb1c6984b2 | ||
|
|
5841327477 | ||
|
|
eab3ab30c6 | ||
|
|
cd6dc38f9e | ||
|
|
3cb1b5757d | ||
|
|
a8db8393c1 | ||
|
|
391b571c31 | ||
|
|
4c2769099f | ||
|
|
29cabb49d6 | ||
|
|
48b0694586 | ||
|
|
28684fdb1a | ||
|
|
49a16635d8 | ||
|
|
4bfe6d8791 | ||
|
|
a3d97795fe | ||
|
|
4c8d297902 | ||
|
|
fdbadf5b71 | ||
|
|
4496eee137 | ||
|
|
215a12e25c | ||
|
|
87331114c1 | ||
|
|
0d41562dad | ||
|
|
c435712656 | ||
|
|
7d48311474 | ||
|
|
5ef73e2819 | ||
|
|
de7bdd6d17 | ||
|
|
21c2739f19 | ||
|
|
1ed170d0db | ||
|
|
bc041486b0 | ||
|
|
5db1bccb84 | ||
|
|
b2da0a685a | ||
|
|
9329eed754 | ||
|
|
75563ee0d5 | ||
|
|
368bbd4bcd | ||
|
|
da2fae673d | ||
|
|
ff61aae040 | ||
|
|
44ad964beb | ||
|
|
d54d67345d | ||
|
|
b5f8ee7929 | ||
|
|
698cef0a80 | ||
|
|
af4aec2127 | ||
|
|
af4fe8de82 | ||
|
|
90caadf5dc | ||
|
|
1e4e63cc31 | ||
|
|
4e54c159e6 | ||
|
|
0d55ccbb15 | ||
|
|
57747467bd | ||
|
|
d9fff6129c | ||
|
|
0f6505c014 | ||
|
|
6c9be1bb5e | ||
|
|
fe5cf653c1 | ||
|
|
ced5f6a2d5 | ||
|
|
1b046fd8d1 | ||
|
|
5fe6e4cd5f | ||
|
|
e63209914d | ||
|
|
504c0f7f9c | ||
|
|
a1628f635a | ||
|
|
bb1975a949 | ||
|
|
b9a163e613 | ||
|
|
7ec35c22f8 | ||
|
|
f19daf7896 | ||
|
|
3572f4493d | ||
|
|
2830d3d0dc | ||
|
|
62b6b170a6 | ||
|
|
5d513f92fb | ||
|
|
0c942220b6 | ||
|
|
9237e147b8 | ||
|
|
1dbc310333 | ||
|
|
4870175577 | ||
|
|
55e887c111 | ||
|
|
f934c02214 | ||
|
|
43fba00845 | ||
|
|
7b3621a701 | ||
|
|
f3f3688476 | ||
|
|
0fa785bc58 | ||
|
|
51ebe9db4d | ||
|
|
c88175bb2d | ||
|
|
ea175fa90c | ||
|
|
f9e41fb306 | ||
|
|
47bfebd4ed | ||
|
|
9e5b2285fc | ||
|
|
de15989638 | ||
|
|
2e56ab6b07 | ||
|
|
3329922077 | ||
|
|
6b6bc6a98e | ||
|
|
b9fa75cba3 | ||
|
|
1b34ad312d | ||
|
|
74df3c204d | ||
|
|
08af4a315f | ||
|
|
ddfe4ffd56 | ||
|
|
87f63451e3 | ||
|
|
f8deb64285 | ||
|
|
82bc47fb24 | ||
|
|
5ced7db5f8 | ||
|
|
5c224f214c | ||
|
|
0b9ba376db | ||
|
|
a9410fa6d1 | ||
|
|
79bd8d6305 | ||
|
|
c5448fe1f0 | ||
|
|
cf1cffdf65 | ||
|
|
41a85e0e45 | ||
|
|
6502c17f7b | ||
|
|
1849055e88 | ||
|
|
e536debb16 | ||
|
|
4ba367bee4 | ||
|
|
ce6d622202 | ||
|
|
3b08b67175 | ||
|
|
68181aa1fb | ||
|
|
6225b9b7c0 | ||
|
|
940db25a87 | ||
|
|
9dc768376c | ||
|
|
ba8132561a | ||
|
|
5aaa9e4f69 | ||
|
|
f19b632e1e | ||
|
|
b40f9f13e9 | ||
|
|
e884186488 | ||
|
|
a4a6837f5a | ||
|
|
2aee16e082 | ||
|
|
7c99c74fac | ||
|
|
8e246c48bf | ||
|
|
75eac56e9f | ||
|
|
d9d5de1569 | ||
|
|
a522fff448 | ||
|
|
d9d97de09c | ||
|
|
88df87e339 | ||
|
|
9c2968eecd | ||
|
|
c795ddce35 | ||
|
|
764ff52516 | ||
|
|
2b7dbf3519 | ||
|
|
ea2145471d | ||
|
|
197a7ae204 | ||
|
|
663bea73d0 | ||
|
|
072d94fdee | ||
|
|
a20d3db122 | ||
|
|
d00c0a3309 | ||
|
|
c071d5b6e5 | ||
|
|
c1ab686a6c | ||
|
|
1942afe766 | ||
|
|
f57f4979ce | ||
|
|
65a6983c54 | ||
|
|
30844cee5f | ||
|
|
5fecb53438 | ||
|
|
3f7eb28051 | ||
|
|
1fb6e99cd0 | ||
|
|
a3f86d9ad3 | ||
|
|
832b0d6887 | ||
|
|
a159c23b91 | ||
|
|
825a52cc4d | ||
|
|
e0057a56af | ||
|
|
7afcd53649 | ||
|
|
f569b2fc70 | ||
|
|
aa0c9ceba2 | ||
|
|
4a68eb5e03 | ||
|
|
32944c412b | ||
|
|
8d8fb82407 | ||
|
|
73a306241b | ||
|
|
9b023041e8 | ||
|
|
b6ffad5b8c | ||
|
|
8abfb93b4c | ||
|
|
138e5339bd | ||
|
|
784cddb483 | ||
|
|
5898a175b0 | ||
|
|
6e8f84025f | ||
|
|
6b659a80d0 | ||
|
|
5caa3c7fd8 | ||
|
|
619459e64b | ||
|
|
11eff59b3b | ||
|
|
0e2e6dfd0e | ||
|
|
ecfcda70cc | ||
|
|
601a339d9b | ||
|
|
6d0d7444b6 | ||
|
|
b441be91a4 | ||
|
|
0d4d8508fc | ||
|
|
b215c6cbde | ||
|
|
27956f1676 | ||
|
|
9c7afa888f | ||
|
|
96cb583861 | ||
|
|
b603dbaf81 | ||
|
|
4fc4675678 | ||
|
|
6f0fdddae5 | ||
|
|
31b05dba43 | ||
|
|
94bdb44a45 | ||
|
|
2bc10b0d5e | ||
|
|
7ab9898beb | ||
|
|
9e5f8351cc | ||
|
|
b6e6a8db03 | ||
|
|
9eebaf4967 | ||
|
|
9e5c464237 | ||
|
|
2ea5d5c1cf | ||
|
|
e9e24b04d1 | ||
|
|
2c5b0641c7 | ||
|
|
9e6d386748 | ||
|
|
546d9f9dd6 | ||
|
|
38b14a515c | ||
|
|
193be0e1d5 | ||
|
|
dfb5473414 | ||
|
|
25847c4422 | ||
|
|
7b8a35470a | ||
|
|
ee26734d94 | ||
|
|
b50cddad2e | ||
|
|
4578fc63de | ||
|
|
eb1f3ad5e2 | ||
|
|
6049a27308 | ||
|
|
7943fcd665 | ||
|
|
66be942cb2 | ||
|
|
b93ad8e14d | ||
|
|
7c69037745 | ||
|
|
fcb3634e07 | ||
|
|
b5825c52e5 | ||
|
|
8795302788 | ||
|
|
3c2db6f724 | ||
|
|
fb79707e3e | ||
|
|
c5378b6914 | ||
|
|
8709b373e8 | ||
|
|
3c993ab150 | ||
|
|
541007d4a5 | ||
|
|
f3971efb55 | ||
|
|
c8db909122 | ||
|
|
ab0366aa07 | ||
|
|
d4bda547ff | ||
|
|
d1f5fb331a | ||
|
|
14fe011ad7 | ||
|
|
2897754358 | ||
|
|
4a0ea1201c | ||
|
|
634c2b11e6 | ||
|
|
ac830458fa | ||
|
|
7b46be0725 | ||
|
|
f7fa9fe50d | ||
|
|
ca944c6eed | ||
|
|
8bfebd3431 | ||
|
|
f7403cbdc7 | ||
|
|
e81b4907da | ||
|
|
0c540072c6 | ||
|
|
aaf2079274 | ||
|
|
42991c5917 | ||
|
|
4e84441770 | ||
|
|
41f0b2909f | ||
|
|
517fd44a23 | ||
|
|
5d2a98d399 | ||
|
|
448f25841f | ||
|
|
b81098d144 | ||
|
|
6cfcb571ac | ||
|
|
ffd85050bd | ||
|
|
22d55d943c | ||
|
|
683a0bb982 | ||
|
|
89fd8a7681 | ||
|
|
6e2cd546f5 | ||
|
|
09655719d5 | ||
|
|
fab5c3d6f4 | ||
|
|
dd57c27b63 | ||
|
|
b73c8aa7d0 | ||
|
|
5eb3e168da | ||
|
|
a4fba4ed85 | ||
|
|
fa772876ed | ||
|
|
c6f6b69cbb | ||
|
|
da7accec9c | ||
|
|
fdfabbb3f2 | ||
|
|
146bdacb2b | ||
|
|
b038f925e5 | ||
|
|
b07aee03d4 | ||
|
|
9cbb5a1c18 | ||
|
|
e028644973 | ||
|
|
6703ff08c2 | ||
|
|
7119ee4904 | ||
|
|
4fabf7ce9c | ||
|
|
e2e4ee5254 | ||
|
|
b8e22aef4e | ||
|
|
75628f3958 | ||
|
|
24157b7586 | ||
|
|
d9fdc4ee12 | ||
|
|
89882f3b8b | ||
|
|
30234960ca | ||
|
|
275dd501eb | ||
|
|
f36bb460af | ||
|
|
1bfa09926b | ||
|
|
c88c151e8d | ||
|
|
ac71302781 | ||
|
|
44afe68a37 | ||
|
|
51efe510a4 | ||
|
|
165ee6f469 | ||
|
|
d7d31423bb | ||
|
|
a81edc09b0 | ||
|
|
c98326e078 | ||
|
|
8617657bff | ||
|
|
57f135e305 | ||
|
|
8d4b3a6c9e | ||
|
|
7616cd64e5 | ||
|
|
dbfc34df39 | ||
|
|
f348495d9c | ||
|
|
27fc8e6b75 | ||
|
|
b59ba20463 | ||
|
|
bbc2b15058 | ||
|
|
d45fd99cf2 | ||
|
|
cf5937998f | ||
|
|
e848bb6136 | ||
|
|
9282405a0b | ||
|
|
067ddfd1be | ||
|
|
444b4fa791 | ||
|
|
a9b535f96e | ||
|
|
f1a5262e34 | ||
|
|
1e6473bfc9 | ||
|
|
4c9bf61170 | ||
|
|
245ede6a89 | ||
|
|
6315011a8e | ||
|
|
4ca4172a1f | ||
|
|
3a70a732c4 | ||
|
|
7a5afad2a5 | ||
|
|
58affaadea | ||
|
|
64c5a35570 | ||
|
|
491d949c52 | ||
|
|
9af6153026 | ||
|
|
0581607649 | ||
|
|
1922f64f7c | ||
|
|
a00ea5434c | ||
|
|
6e66085293 | ||
|
|
85fd006209 | ||
|
|
8f3d2e5455 | ||
|
|
5d4c592c3b | ||
|
|
f2be01ecdd | ||
|
|
a0f6e0db13 | ||
|
|
95aad1a154 | ||
|
|
ff47c8ba0b | ||
|
|
5390830e41 | ||
|
|
f4bfe0ca2f | ||
|
|
3c38e393f6 | ||
|
|
ba6df1d6fd | ||
|
|
cb607be9b5 | ||
|
|
2074dbf15f | ||
|
|
d4b41fcef6 | ||
|
|
90447781b9 | ||
|
|
f292155979 | ||
|
|
10f922cbf6 | ||
|
|
5450809424 | ||
|
|
18bc5d9bb9 | ||
|
|
0171f03008 | ||
|
|
58cf5d117c | ||
|
|
3e8e4a0b07 | ||
|
|
a3ac2f3382 | ||
|
|
2592d477dc | ||
|
|
f5faea9673 | ||
|
|
778338b176 | ||
|
|
1b9b45296c | ||
|
|
42acccce4f | ||
|
|
75530e6ee4 | ||
|
|
9b4b278972 | ||
|
|
2679040263 | ||
|
|
f5e997d8a3 | ||
|
|
3542352286 | ||
|
|
a1a5dd90a3 | ||
|
|
cb4fe9d22f | ||
|
|
f8283f1ae9 | ||
|
|
5a3c4f169f | ||
|
|
2699451caa | ||
|
|
c8d7c49beb | ||
|
|
81603e4017 | ||
|
|
4634be1ba5 | ||
|
|
3c1b83b82d | ||
|
|
6572e6c121 | ||
|
|
2264cd6556 | ||
|
|
9e39cc1013 | ||
|
|
9a098ddca7 | ||
|
|
a015ed9af7 | ||
|
|
05a6db4f99 | ||
|
|
5df6476e4d | ||
|
|
6bd973fdea | ||
|
|
f1f353d250 | ||
|
|
5c3c6555c5 | ||
|
|
12557ac56b | ||
|
|
434149b16a | ||
|
|
9691c0a88f | ||
|
|
d426ff9bf2 | ||
|
|
a6a16e2dd8 | ||
|
|
ec8c28a017 | ||
|
|
f65636d1d7 | ||
|
|
574f5a03f3 | ||
|
|
b810ee571c | ||
|
|
72f672e584 | ||
|
|
376c718e50 | ||
|
|
53313199b8 | ||
|
|
a94ba7e7b5 | ||
|
|
2c4f32af98 | ||
|
|
a96c7db540 | ||
|
|
3a312eed5c | ||
|
|
0115fd7c33 | ||
|
|
18acd376e0 | ||
|
|
9be60b133f | ||
|
|
fd5f7bf8c6 | ||
|
|
34498db202 | ||
|
|
1846b5f05d | ||
|
|
155604ee0b | ||
|
|
441d2b1f3b | ||
|
|
5e19c57ade | ||
|
|
e38a84de9e | ||
|
|
636b7c062b | ||
|
|
f820aff127 | ||
|
|
bf3af771cc | ||
|
|
6a87363981 | ||
|
|
f2b5c66d9a | ||
|
|
4aea83b35f | ||
|
|
d7d6e593c3 | ||
|
|
6bbfc925fb | ||
|
|
e849cd5e33 | ||
|
|
3ab09e5821 | ||
|
|
f09daf8f8b | ||
|
|
4c9f03f2ea | ||
|
|
61f84b606f | ||
|
|
15e01818d4 | ||
|
|
a62aa89d0a | ||
|
|
4510147627 | ||
|
|
fc1c170a18 | ||
|
|
a59d59e40e | ||
|
|
2873208a82 | ||
|
|
3cf6787bb9 | ||
|
|
fd95d3e0e6 | ||
|
|
c6bfadbfa2 | ||
|
|
a623a5a7b0 | ||
|
|
e2365668bd | ||
|
|
bdc95a3f36 | ||
|
|
c327656552 | ||
|
|
7b8b17a4a9 | ||
|
|
396443b711 | ||
|
|
18ce15d07b | ||
|
|
a4ee95ca81 | ||
|
|
f3789cbccc | ||
|
|
c52120bd3b | ||
|
|
9b5fa8e4e6 | ||
|
|
64f1b580a7 | ||
|
|
3ba8cd91e8 | ||
|
|
9ca04ffd50 | ||
|
|
67bab077a7 | ||
|
|
646d1f425d | ||
|
|
83989422db | ||
|
|
82c97d8b15 | ||
|
|
185e9a27a9 | ||
|
|
781b3fff51 | ||
|
|
99977eb96a | ||
|
|
143259ff66 | ||
|
|
eebb372229 | ||
|
|
94a3983c0a | ||
|
|
c97dc39963 | ||
|
|
1b6c140d70 | ||
|
|
ddf4ff6faf | ||
|
|
61566e9423 | ||
|
|
6fcc95e029 | ||
|
|
2bac205863 | ||
|
|
258edd8ba4 | ||
|
|
71d7793b7e | ||
|
|
b131b135c7 | ||
|
|
4146d558fe | ||
|
|
d04b5e8b25 | ||
|
|
2805d616a8 | ||
|
|
4450ec1939 | ||
|
|
32f37cdaee | ||
|
|
c653e5e0be | ||
|
|
45d4f340be | ||
|
|
0e4a60c8d2 | ||
|
|
35291cb1c5 | ||
|
|
f9cf442609 | ||
|
|
d0fcdac77d | ||
|
|
b124456a79 | ||
|
|
2423bb966a | ||
|
|
660395b594 | ||
|
|
205fff7147 | ||
|
|
4d714385a4 | ||
|
|
bd1687474a | ||
|
|
f70c9463f4 | ||
|
|
7dad2b67b8 | ||
|
|
5a44daf58d | ||
|
|
f30daa5a6b | ||
|
|
7a4c4bfcae | ||
|
|
eaba98441d | ||
|
|
4d141773b6 | ||
|
|
c6f8b33c85 | ||
|
|
7023db71b4 | ||
|
|
669a746805 | ||
|
|
2a7dea10d2 | ||
|
|
df2002166c | ||
|
|
ab3d65f2bf | ||
|
|
57df6a2964 | ||
|
|
6c797d85b5 | ||
|
|
d60a44713e | ||
|
|
ef389af160 | ||
|
|
b1d2e2affb | ||
|
|
c0d135c900 | ||
|
|
bb7b3fa9a3 | ||
|
|
b4ab189185 | ||
|
|
6e9ebe1fcb | ||
|
|
36c366df63 | ||
|
|
45e4c59001 | ||
|
|
143678f40a | ||
|
|
d64a44f835 | ||
|
|
05d14ca80e | ||
|
|
6ce24e2067 | ||
|
|
3caf2ed692 | ||
|
|
e8008aa9e1 | ||
|
|
c0946f4fbd | ||
|
|
79b3dcc630 | ||
|
|
782a8d5c97 | ||
|
|
3208a5cc39 | ||
|
|
c4f4212a55 | ||
|
|
73217208ae | ||
|
|
42beff4980 | ||
|
|
bae5020048 | ||
|
|
cba6b7e432 | ||
|
|
d0e77fcadf | ||
|
|
a54a2cc8b0 | ||
|
|
316c5a63b9 | ||
|
|
044db31d2b | ||
|
|
589a19a388 | ||
|
|
a3d21c1243 | ||
|
|
375352d28a | ||
|
|
bdb285528f | ||
|
|
f25fcab110 | ||
|
|
a3bf9ab78f | ||
|
|
862f87ae0b | ||
|
|
b2c4025e58 | ||
|
|
8a013e6eef | ||
|
|
4fff8f164c | ||
|
|
e5c85f0358 | ||
|
|
12f2b22cda | ||
|
|
a7f3157f00 | ||
|
|
99d71c2297 | ||
|
|
c0409c8d6e | ||
|
|
f328cf3ce7 | ||
|
|
dd7014b196 | ||
|
|
5cda3eb342 | ||
|
|
4a2e806bc1 | ||
|
|
ac069af22a | ||
|
|
b845a785a0 | ||
|
|
ecacc381d4 | ||
|
|
b9a3be699a | ||
|
|
2227d44ebd | ||
|
|
e8ef43b2fa | ||
|
|
fb7b683c9e | ||
|
|
4c94ab9e0f | ||
|
|
a8875e3079 | ||
|
|
4588422642 | ||
|
|
390623ed02 | ||
|
|
26feae6d2c | ||
|
|
7f4f3743ef | ||
|
|
0309211f82 | ||
|
|
c6286da06b | ||
|
|
6042ab7b33 | ||
|
|
1808614af4 | ||
|
|
a47c8d752b | ||
|
|
8a7bffe027 | ||
|
|
6497a941e4 | ||
|
|
37a4f7d104 | ||
|
|
c634b582b8 | ||
|
|
d76d8287c0 | ||
|
|
19f33e80d5 | ||
|
|
9ff53b1f6c | ||
|
|
38ac45f634 | ||
|
|
d90a104c10 | ||
|
|
01f120115d | ||
|
|
a986b88cc7 | ||
|
|
9d9328900e | ||
|
|
88e4684e53 | ||
|
|
d94e7ba221 | ||
|
|
1bbd4387db | ||
|
|
e64ecdd680 | ||
|
|
edfd3579a8 | ||
|
|
c6571b31f0 | ||
|
|
29be015567 | ||
|
|
883e11ea31 | ||
|
|
57cbe8298b | ||
|
|
d8d3c17e13 | ||
|
|
87f01fa004 | ||
|
|
dcac32401f | ||
|
|
9db1c36be4 | ||
|
|
3786b4f721 | ||
|
|
236c6f7ae6 | ||
|
|
d84a245547 | ||
|
|
439ba48c33 | ||
|
|
c8c22a0a40 | ||
|
|
74d63912f3 | ||
|
|
3571e03288 | ||
|
|
24de0587de | ||
|
|
e29eaf8c4d | ||
|
|
41a44e710f | ||
|
|
754f40aad5 | ||
|
|
7856b94525 | ||
|
|
4d388ac631 | ||
|
|
e768a416bb | ||
|
|
456d85b587 | ||
|
|
89185c36de | ||
|
|
db41f9fea7 | ||
|
|
10cdbb935a | ||
|
|
e6ab94a314 | ||
|
|
c37bb31992 | ||
|
|
94c8666db6 |
21
.commitlintrc.js
Normal 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"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"extends": ["@commitlint/config-conventional"]
|
||||
}
|
||||
@@ -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=
|
||||
|
||||
@@ -24,6 +24,10 @@ dist
|
||||
build
|
||||
/docs
|
||||
|
||||
# subgraph
|
||||
subgraph.template.yaml
|
||||
generated
|
||||
|
||||
# Docusaurus cache and generated files
|
||||
.docusaurus
|
||||
.cache-loader
|
||||
|
||||
@@ -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
@@ -0,0 +1 @@
|
||||
* @semaphore-protocol/core-devs
|
||||
17
.github/ISSUE_TEMPLATE/♻️-refactoring.md
vendored
Normal 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.
|
||||
42
.github/pull_request_template.md
vendored
@@ -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
|
||||
|
||||
14
.github/workflows/auto-assign.yml
vendored
@@ -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
|
||||
35
.github/workflows/docs.yml
vendored
@@ -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
|
||||
|
||||
|
||||
86
.github/workflows/production.yml
vendored
@@ -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 }}
|
||||
|
||||
149
.github/workflows/pull-requests.yml
vendored
@@ -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
|
||||
|
||||
41
.github/workflows/release.yml
vendored
@@ -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
@@ -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
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
npx lint-staged
|
||||
6
.husky/prepare-commit-msg
Normal 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
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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
@@ -0,0 +1 @@
|
||||
package.json
|
||||
@@ -1 +0,0 @@
|
||||
87de4f440a77841135f97a187e09140c6d4e6ae2
|
||||
1
.yarn/releases/yarn-3.2.1.cjs.REMOVED.git-id
vendored
@@ -1 +0,0 @@
|
||||
b3cadff6efb37a12712d12c2553ec703dbcaa4dd
|
||||
893
.yarn/releases/yarn-4.1.0.cjs
vendored
Executable file
12
.yarnrc.yml
@@ -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
|
||||
|
||||
@@ -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).
|
||||
|
||||
2
LICENSE
@@ -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
|
||||
|
||||
90
README.md
@@ -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> | </span>
|
||||
<a href="https://semaphore.pse.dev/discord">
|
||||
<a href="https://semaphore.pse.dev/telegram">
|
||||
🗣️ Chat & Support
|
||||
</a>
|
||||
<span> | </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.
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
🔎 Issues
|
||||
</a>
|
||||
<span> | </span>
|
||||
<a href="https://semaphore.pse.dev/discord">
|
||||
<a href="https://semaphore.pse.dev/telegram">
|
||||
🗣️ Chat & Support
|
||||
</a>
|
||||
</h4>
|
||||
|
||||
BIN
apps/docs/assets/img-benchmarks/browser/browser-benchmarks.png
Normal file
|
After Width: | Height: | Size: 315 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 223 KiB |
|
After Width: | Height: | Size: 182 KiB |
|
After Width: | Height: | Size: 201 KiB |
|
After Width: | Height: | Size: 126 KiB |
|
After Width: | Height: | Size: 133 KiB |
|
After Width: | Height: | Size: 130 KiB |
|
After Width: | Height: | Size: 134 KiB |
|
After Width: | Height: | Size: 125 KiB |
@@ -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
|
||||
}
|
||||
})
|
||||
}
|
||||
129
apps/docs/docusaurus.config.ts
Normal 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
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 relayer’s 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).
|
||||
|
||||
@@ -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`).
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -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`:
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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`?
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
```
|
||||
:::
|
||||
|
||||
:::
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -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.
|
||||
::::
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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": "-"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
25
apps/docs/src/components/Articles.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
32
apps/docs/src/components/DeployedContracts.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
21
apps/docs/src/components/RemoteCode.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
25
apps/docs/src/components/Videos.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
})}
|
||||
|
||||
@@ -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
BIN
apps/docs/static/img/favicon.ico
vendored
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
BIN
apps/docs/static/img/social-media.png
vendored
Normal file
|
After Width: | Height: | Size: 190 KiB |
@@ -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
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"cleanUrls": true
|
||||
}
|
||||
@@ -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**:
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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 relayer’s 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).
|
||||
|
||||
@@ -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`).
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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 relayer’s 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
|
||||
|
||||
@@ -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)
|
||||
```
|
||||
:::
|
||||
|
||||
:::
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
:::
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||