@semaphore-protocol/proof 4.0.0 → 4.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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @module @semaphore-protocol/proof
3
- * @version 4.0.0
3
+ * @version 4.0.1
4
4
  * @file A library to generate and verify Semaphore proofs.
5
5
  * @copyright Ethereum Foundation 2024
6
6
  * @license MIT
@@ -9,8 +9,8 @@
9
9
  import { packGroth16Proof, unpackGroth16Proof } from '@zk-kit/utils/proof-packing';
10
10
  export { packGroth16Proof, unpackGroth16Proof } from '@zk-kit/utils/proof-packing';
11
11
  import { MIN_DEPTH, MAX_DEPTH } from '@semaphore-protocol/utils/constants';
12
- import { requireDefined, requireObject, requireTypes, requireNumber, requireString, requireArray } from '@zk-kit/utils/error-handlers';
13
12
  import { maybeGetSnarkArtifacts, Project } from '@zk-kit/artifacts';
13
+ import { requireDefined, requireObject, requireTypes, requireNumber, requireString, requireArray } from '@zk-kit/utils/error-handlers';
14
14
  import { groth16 } from 'snarkjs';
15
15
  import { keccak256 } from 'ethers/crypto';
16
16
  import { toBeHex, toBigInt as toBigInt$1 } from 'ethers/utils';
@@ -127,7 +127,7 @@ async function generateProof(identity, groupOrMerkleProof, message, scope, merkl
127
127
  }, wasm, zkey);
128
128
  return {
129
129
  merkleTreeDepth,
130
- merkleTreeRoot: publicSignals[0],
130
+ merkleTreeRoot: merkleProof.root.toString(),
131
131
  nullifier: publicSignals[1],
132
132
  message: message.toString(),
133
133
  scope: scope.toString(),
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @module @semaphore-protocol/proof
3
- * @version 4.0.0
3
+ * @version 4.0.1
4
4
  * @file A library to generate and verify Semaphore proofs.
5
5
  * @copyright Ethereum Foundation 2024
6
6
  * @license MIT
@@ -10,8 +10,8 @@
10
10
 
11
11
  var proofPacking = require('@zk-kit/utils/proof-packing');
12
12
  var constants = require('@semaphore-protocol/utils/constants');
13
- var errorHandlers = require('@zk-kit/utils/error-handlers');
14
13
  var artifacts = require('@zk-kit/artifacts');
14
+ var errorHandlers = require('@zk-kit/utils/error-handlers');
15
15
  var snarkjs = require('snarkjs');
16
16
  var crypto = require('ethers/crypto');
17
17
  var utils = require('ethers/utils');
@@ -128,7 +128,7 @@ async function generateProof(identity, groupOrMerkleProof, message, scope, merkl
128
128
  }, wasm, zkey);
129
129
  return {
130
130
  merkleTreeDepth,
131
- merkleTreeRoot: publicSignals[0],
131
+ merkleTreeRoot: merkleProof.root.toString(),
132
132
  nullifier: publicSignals[1],
133
133
  message: message.toString(),
134
134
  scope: scope.toString(),
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @module @semaphore-protocol/proof
3
- * @version 4.0.0
3
+ * @version 4.0.1
4
4
  * @file A library to generate and verify Semaphore proofs.
5
5
  * @copyright Ethereum Foundation 2024
6
6
  * @license MIT
@@ -9,8 +9,8 @@
9
9
  import { packGroth16Proof, unpackGroth16Proof } from '@zk-kit/utils/proof-packing';
10
10
  export { packGroth16Proof, unpackGroth16Proof } from '@zk-kit/utils/proof-packing';
11
11
  import { MIN_DEPTH, MAX_DEPTH } from '@semaphore-protocol/utils/constants';
12
- import { requireDefined, requireObject, requireTypes, requireNumber, requireString, requireArray } from '@zk-kit/utils/error-handlers';
13
12
  import { maybeGetSnarkArtifacts, Project } from '@zk-kit/artifacts';
13
+ import { requireDefined, requireObject, requireTypes, requireNumber, requireString, requireArray } from '@zk-kit/utils/error-handlers';
14
14
  import { groth16 } from 'snarkjs';
15
15
  import { keccak256 } from 'ethers/crypto';
16
16
  import { toBeHex, toBigInt as toBigInt$1 } from 'ethers/utils';
@@ -127,7 +127,7 @@ async function generateProof(identity, groupOrMerkleProof, message, scope, merkl
127
127
  }, wasm, zkey);
128
128
  return {
129
129
  merkleTreeDepth,
130
- merkleTreeRoot: publicSignals[0],
130
+ merkleTreeRoot: merkleProof.root.toString(),
131
131
  nullifier: publicSignals[1],
132
132
  message: message.toString(),
133
133
  scope: scope.toString(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@semaphore-protocol/proof",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "A library to generate and verify Semaphore proofs.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -48,11 +48,11 @@
48
48
  "rollup-plugin-cleanup": "^3.2.1"
49
49
  },
50
50
  "peerDependencies": {
51
- "@semaphore-protocol/group": "4.0.0",
52
- "@semaphore-protocol/identity": "4.0.0"
51
+ "@semaphore-protocol/group": "4.0.1",
52
+ "@semaphore-protocol/identity": "4.0.1"
53
53
  },
54
54
  "dependencies": {
55
- "@semaphore-protocol/utils": "4.0.0",
55
+ "@semaphore-protocol/utils": "4.0.1",
56
56
  "@zk-kit/artifacts": "1.8.0",
57
57
  "@zk-kit/utils": "1.0.0",
58
58
  "ethers": "6.10.0",
@@ -1,11 +1,11 @@
1
1
  import type { Group, MerkleProof } from "@semaphore-protocol/group"
2
2
  import type { Identity } from "@semaphore-protocol/identity"
3
3
  import { MAX_DEPTH, MIN_DEPTH } from "@semaphore-protocol/utils/constants"
4
+ import { Project, maybeGetSnarkArtifacts, type SnarkArtifacts } from "@zk-kit/artifacts"
4
5
  import { requireDefined, requireNumber, requireObject, requireTypes } from "@zk-kit/utils/error-handlers"
5
6
  import { packGroth16Proof } from "@zk-kit/utils/proof-packing"
6
- import { maybeGetSnarkArtifacts, Project, type SnarkArtifacts } from "@zk-kit/artifacts"
7
7
  import type { BigNumberish } from "ethers"
8
- import { type NumericString, groth16 } from "snarkjs"
8
+ import { groth16, type NumericString } from "snarkjs"
9
9
  import hash from "./hash"
10
10
  import toBigInt from "./to-bigint"
11
11
  import type { SemaphoreProof } from "./types"
@@ -118,7 +118,7 @@ export default async function generateProof(
118
118
 
119
119
  return {
120
120
  merkleTreeDepth,
121
- merkleTreeRoot: publicSignals[0],
121
+ merkleTreeRoot: merkleProof.root.toString(),
122
122
  nullifier: publicSignals[1],
123
123
  message: message.toString() as NumericString,
124
124
  scope: scope.toString() as NumericString,