@semaphore-protocol/proof 0.3.2 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/index.mjs +1 -2
- package/dist/index.node.js +1 -2
- package/package.json +3 -3
- package/src/generateProof.ts +0 -2
package/README.md
CHANGED
|
@@ -38,7 +38,8 @@
|
|
|
38
38
|
</h4>
|
|
39
39
|
</div>
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
| This library provides utility functions to generate and verify Semaphore proofs compatible with the Semaphore [circuits](https://github.com/semaphore-protocol/semaphore/tree/main/circuits). Generating valid zero-knowledge proofs requires files that can only be obtained in an attested [trusted-setup ceremony](https://storage.googleapis.com/trustedsetup-a86f4.appspot.com/semaphore/semaphore_top_index.html). For a complete list of ready-to-use files visit [trusted-setup-pse.org](http://www.trusted-setup-pse.org/). |
|
|
42
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
42
43
|
|
|
43
44
|
## 🛠 Install
|
|
44
45
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module @semaphore-protocol/proof
|
|
3
|
-
* @version 0.
|
|
3
|
+
* @version 2.0.1
|
|
4
4
|
* @file A library to generate and verify Semaphore proofs.
|
|
5
5
|
* @copyright Ethereum Foundation 2022
|
|
6
6
|
* @license MIT
|
|
@@ -95,7 +95,6 @@ function generateProof(identity, group, externalNullifier, signal, snarkArtifact
|
|
|
95
95
|
throw new Error("The identity is not part of the group");
|
|
96
96
|
}
|
|
97
97
|
merkleProof = group.generateProofOfMembership(index);
|
|
98
|
-
merkleProof.siblings = merkleProof.siblings.map(function (s) { return s[0]; });
|
|
99
98
|
return [4 /*yield*/, groth16.fullProve({
|
|
100
99
|
identityTrapdoor: identity.getTrapdoor(),
|
|
101
100
|
identityNullifier: identity.getNullifier(),
|
package/dist/index.node.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module @semaphore-protocol/proof
|
|
3
|
-
* @version 0.
|
|
3
|
+
* @version 2.0.1
|
|
4
4
|
* @file A library to generate and verify Semaphore proofs.
|
|
5
5
|
* @copyright Ethereum Foundation 2022
|
|
6
6
|
* @license MIT
|
|
@@ -99,7 +99,6 @@ function generateProof(identity, group, externalNullifier, signal, snarkArtifact
|
|
|
99
99
|
throw new Error("The identity is not part of the group");
|
|
100
100
|
}
|
|
101
101
|
merkleProof = group.generateProofOfMembership(index);
|
|
102
|
-
merkleProof.siblings = merkleProof.siblings.map(function (s) { return s[0]; });
|
|
103
102
|
return [4 /*yield*/, snarkjs.groth16.fullProve({
|
|
104
103
|
identityTrapdoor: identity.getTrapdoor(),
|
|
105
104
|
identityNullifier: identity.getNullifier(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semaphore-protocol/proof",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "A library to generate and verify Semaphore proofs.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.node.js",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"@ethersproject/bytes": "^5.5.0",
|
|
38
38
|
"@ethersproject/solidity": "^5.5.0",
|
|
39
39
|
"@ethersproject/strings": "^5.5.0",
|
|
40
|
-
"@semaphore-protocol/group": "0.
|
|
41
|
-
"@semaphore-protocol/identity": "0.
|
|
40
|
+
"@semaphore-protocol/group": "2.0.0",
|
|
41
|
+
"@semaphore-protocol/identity": "2.0.0",
|
|
42
42
|
"circomlibjs": "0.0.8",
|
|
43
43
|
"snarkjs": "^0.4.13"
|
|
44
44
|
}
|
package/src/generateProof.ts
CHANGED
|
@@ -20,8 +20,6 @@ export default async function generateProof(
|
|
|
20
20
|
|
|
21
21
|
const merkleProof = group.generateProofOfMembership(index)
|
|
22
22
|
|
|
23
|
-
merkleProof.siblings = merkleProof.siblings.map((s) => s[0])
|
|
24
|
-
|
|
25
23
|
const { proof, publicSignals } = await groth16.fullProve(
|
|
26
24
|
{
|
|
27
25
|
identityTrapdoor: identity.getTrapdoor(),
|