@maci-protocol/circuits 0.0.0-ci.f433bba → 0.0.0-ci.f9da2fc

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.
@@ -32,14 +32,13 @@ include "../../utils/trees/incrementalQuinaryTree.circom";
32
32
  var STATE_TREE_ARITY = 2;
33
33
  var MSG_LENGTH = 10;
34
34
  var PACKED_CMD_LENGTH = 4;
35
- var STATE_LEAF_LENGTH = 4;
35
+ var STATE_LEAF_LENGTH = 3;
36
36
  var BALLOT_LENGTH = 2;
37
37
  var BALLOT_NONCE_IDX = 0;
38
38
  var BALLOT_VO_ROOT_IDX = 1;
39
39
  var STATE_LEAF_PUB_X_IDX = 0;
40
40
  var STATE_LEAF_PUB_Y_IDX = 1;
41
41
  var STATE_LEAF_VOICE_CREDIT_BALANCE_IDX = 2;
42
- var STATE_LEAF_TIMESTAMP_IDX = 3;
43
42
  var msgTreeZeroValue = 8370432830353022751713833565135785980866757267633941821328460903436894336785;
44
43
  // Number of options for this poll.
45
44
  var maxVoteOptions = VOTE_OPTION_TREE_ARITY ** voteOptionTreeDepth;
@@ -266,7 +265,7 @@ include "../../utils/trees/incrementalQuinaryTree.circom";
266
265
  */
267
266
  template ProcessOneNonQv(stateTreeDepth, voteOptionTreeDepth) {
268
267
  // Constants defining the structure and size of state and ballots.
269
- var STATE_LEAF_LENGTH = 4;
268
+ var STATE_LEAF_LENGTH = 3;
270
269
  var BALLOT_LENGTH = 2;
271
270
  var MSG_LENGTH = 10;
272
271
  var PACKED_CMD_LENGTH = 4;
@@ -282,8 +281,6 @@ template ProcessOneNonQv(stateTreeDepth, voteOptionTreeDepth) {
282
281
  var STATE_LEAF_PUB_Y_IDX = 1;
283
282
  // Voice Credit balance.
284
283
  var STATE_LEAF_VOICE_CREDIT_BALANCE_IDX = 2;
285
- // Timestamp.
286
- var STATE_LEAF_TIMESTAMP_IDX = 3;
287
284
  var N_BITS = 252;
288
285
 
289
286
  // Number of users that have completed the sign up.
@@ -357,7 +354,7 @@ template ProcessOneNonQv(stateTreeDepth, voteOptionTreeDepth) {
357
354
  var computedStateLeafPathIndices[stateTreeDepth] = MerkleGeneratePathIndices(stateTreeDepth)(stateIndexMux);
358
355
 
359
356
  // 3. Verify that the original state leaf exists in the given state root.
360
- var stateLeafHash = PoseidonHasher(4)(stateLeaf);
357
+ var stateLeafHash = PoseidonHasher(3)(stateLeaf);
361
358
  var stateLeafQip = BinaryMerkleRoot(stateTreeDepth)(
362
359
  stateLeafHash,
363
360
  actualStateTreeDepth,
@@ -419,11 +416,10 @@ template ProcessOneNonQv(stateTreeDepth, voteOptionTreeDepth) {
419
416
  newBallotVoRoot <== newBallotVoRootMux;
420
417
 
421
418
  // 6. Generate a new state root.
422
- var computedNewStateLeafhash = PoseidonHasher(4)([
419
+ var computedNewStateLeafhash = PoseidonHasher(3)([
423
420
  computedNewSlPubKey[STATE_LEAF_PUB_X_IDX],
424
421
  computedNewSlPubKey[STATE_LEAF_PUB_Y_IDX],
425
- voiceCreditBalanceMux,
426
- stateLeaf[STATE_LEAF_TIMESTAMP_IDX]
422
+ voiceCreditBalanceMux
427
423
  ]);
428
424
 
429
425
  var computedNewStateLeafQip = BinaryMerkleRoot(stateTreeDepth)(
@@ -32,14 +32,13 @@ template ProcessMessages(
32
32
  var STATE_TREE_ARITY = 2;
33
33
  var MSG_LENGTH = 10;
34
34
  var PACKED_CMD_LENGTH = 4;
35
- var STATE_LEAF_LENGTH = 4;
35
+ var STATE_LEAF_LENGTH = 3;
36
36
  var BALLOT_LENGTH = 2;
37
37
  var BALLOT_NONCE_IDX = 0;
38
38
  var BALLOT_VO_ROOT_IDX = 1;
39
39
  var STATE_LEAF_PUB_X_IDX = 0;
40
40
  var STATE_LEAF_PUB_Y_IDX = 1;
41
41
  var STATE_LEAF_VOICE_CREDIT_BALANCE_IDX = 2;
42
- var STATE_LEAF_TIMESTAMP_IDX = 3;
43
42
  var msgTreeZeroValue = 8370432830353022751713833565135785980866757267633941821328460903436894336785;
44
43
  // Number of options for this poll.
45
44
  var maxVoteOptions = VOTE_OPTION_TREE_ARITY ** voteOptionTreeDepth;
@@ -260,7 +259,7 @@ template ProcessMessages(
260
259
  */
261
260
  template ProcessOne(stateTreeDepth, voteOptionTreeDepth) {
262
261
  // Constants defining the structure and size of state and ballots.
263
- var STATE_LEAF_LENGTH = 4;
262
+ var STATE_LEAF_LENGTH = 3;
264
263
  var BALLOT_LENGTH = 2;
265
264
  var MSG_LENGTH = 10;
266
265
  var PACKED_CMD_LENGTH = 4;
@@ -276,8 +275,6 @@ template ProcessOne(stateTreeDepth, voteOptionTreeDepth) {
276
275
  var STATE_LEAF_PUB_Y_IDX = 1;
277
276
  // Voice Credit balance.
278
277
  var STATE_LEAF_VOICE_CREDIT_BALANCE_IDX = 2;
279
- // Timestamp.
280
- var STATE_LEAF_TIMESTAMP_IDX = 3;
281
278
  var N_BITS = 252;
282
279
 
283
280
  // Number of users that have completed the sign up.
@@ -356,7 +353,7 @@ template ProcessOne(stateTreeDepth, voteOptionTreeDepth) {
356
353
  var computedStateLeafPathIndices[stateTreeDepth] = MerkleGeneratePathIndices(stateTreeDepth)(stateIndexMux);
357
354
 
358
355
  // 3. Verify that the original state leaf exists in the given state root.
359
- var stateLeafHash = PoseidonHasher(4)(stateLeaf);
356
+ var stateLeafHash = PoseidonHasher(3)(stateLeaf);
360
357
  var stateLeafQip = BinaryMerkleRoot(stateTreeDepth)(
361
358
  stateLeafHash,
362
359
  actualStateTreeDepth,
@@ -421,11 +418,10 @@ template ProcessOne(stateTreeDepth, voteOptionTreeDepth) {
421
418
  newBallotVoRoot <== newBallotVoRootMux;
422
419
 
423
420
  // 6. Generate a new state root.
424
- var computedNewStateLeafhash = PoseidonHasher(4)([
421
+ var computedNewStateLeafhash = PoseidonHasher(3)([
425
422
  computedNewSlPubKey[STATE_LEAF_PUB_X_IDX],
426
423
  computedNewSlPubKey[STATE_LEAF_PUB_Y_IDX],
427
- voiceCreditBalanceMux,
428
- stateLeaf[STATE_LEAF_TIMESTAMP_IDX]
424
+ voiceCreditBalanceMux
429
425
  ]);
430
426
 
431
427
  var computedNewStateLeafQip = BinaryMerkleRoot(stateTreeDepth)(
@@ -65,8 +65,6 @@ template PollJoined(stateTreeDepth) {
65
65
  signal input privKey;
66
66
  // User's voice credits balance
67
67
  signal input voiceCreditsBalance;
68
- // Poll's joined timestamp
69
- signal input joinTimestamp;
70
68
  // Path elements
71
69
  signal input pathElements[stateTreeDepth][STATE_TREE_ARITY - 1];
72
70
  // Path indices
@@ -79,7 +77,7 @@ template PollJoined(stateTreeDepth) {
79
77
  // User private to public key
80
78
  var derivedPubKey[2] = PrivToPubKey()(privKey);
81
79
 
82
- var stateLeaf = PoseidonHasher(4)([derivedPubKey[0], derivedPubKey[1], voiceCreditsBalance, joinTimestamp]);
80
+ var stateLeaf = PoseidonHasher(3)([derivedPubKey[0], derivedPubKey[1], voiceCreditsBalance]);
83
81
 
84
82
  // Inclusion proof
85
83
  var stateLeafQip = BinaryMerkleRoot(stateTreeDepth)(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maci-protocol/circuits",
3
- "version": "0.0.0-ci.f433bba",
3
+ "version": "0.0.0-ci.f9da2fc",
4
4
  "private": false,
5
5
  "description": "zk-SNARK circuits for MACI",
6
6
  "main": "build/ts/index.js",
@@ -43,10 +43,10 @@
43
43
  "test:pollJoined": "pnpm run mocha-test ts/__tests__/PollJoined.test.ts"
44
44
  },
45
45
  "dependencies": {
46
- "@maci-protocol/core": "0.0.0-ci.f433bba",
47
- "@maci-protocol/crypto": "0.0.0-ci.f433bba",
48
- "@maci-protocol/domainobjs": "0.0.0-ci.f433bba",
49
- "@maci-protocol/sdk": "0.0.0-ci.f433bba",
46
+ "@maci-protocol/core": "0.0.0-ci.f9da2fc",
47
+ "@maci-protocol/crypto": "0.0.0-ci.f9da2fc",
48
+ "@maci-protocol/domainobjs": "0.0.0-ci.f9da2fc",
49
+ "@maci-protocol/sdk": "0.0.0-ci.f9da2fc",
50
50
  "@zk-kit/circuits": "^0.4.0",
51
51
  "circomkit": "^0.3.2",
52
52
  "circomlib": "^2.0.5"
@@ -67,5 +67,5 @@
67
67
  "ts-node": "^10.9.1",
68
68
  "typescript": "^5.8.3"
69
69
  },
70
- "gitHead": "19dddc7fd79cc2d375fe8e7d540906f9b4f0c3ac"
70
+ "gitHead": "6dbb127aeeb12898e9a75377c8a633a06b9a8132"
71
71
  }