@permissionless-technologies/upp-sdk 0.3.6 → 0.4.0

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.
Files changed (140) hide show
  1. package/dist/{asp-ZA3RGN7G.js → asp-72WUGTQE.js} +3 -3
  2. package/dist/asp-72WUGTQE.js.map +1 -0
  3. package/dist/{asp-TXSAFFD3.cjs → asp-CUE3NMBN.cjs} +14 -14
  4. package/dist/asp-CUE3NMBN.cjs.map +1 -0
  5. package/dist/{chunk-KXPZUBPI.cjs → chunk-23B5XSS4.cjs} +12 -12
  6. package/dist/{chunk-KXPZUBPI.cjs.map → chunk-23B5XSS4.cjs.map} +1 -1
  7. package/dist/{chunk-SQKBT2SH.cjs → chunk-2G22R7AJ.cjs} +18 -7
  8. package/dist/chunk-2G22R7AJ.cjs.map +1 -0
  9. package/dist/chunk-5QSSX3KR.js +64 -0
  10. package/dist/chunk-5QSSX3KR.js.map +1 -0
  11. package/dist/{chunk-P37MRZ73.js → chunk-6IEYWJVS.js} +8 -8
  12. package/dist/chunk-6IEYWJVS.js.map +1 -0
  13. package/dist/{chunk-5V5HSN6Y.js → chunk-6TFDBBAQ.js} +3 -3
  14. package/dist/{chunk-5V5HSN6Y.js.map → chunk-6TFDBBAQ.js.map} +1 -1
  15. package/dist/{chunk-ZKZV6OI3.cjs → chunk-7BNJV2ZS.cjs} +21 -21
  16. package/dist/{chunk-ZKZV6OI3.cjs.map → chunk-7BNJV2ZS.cjs.map} +1 -1
  17. package/dist/{chunk-XBNYAAMU.js → chunk-7T4CUE6E.js} +3 -3
  18. package/dist/{chunk-XBNYAAMU.js.map → chunk-7T4CUE6E.js.map} +1 -1
  19. package/dist/{chunk-OD2SDC4L.js → chunk-CEJN5ZE5.js} +3 -3
  20. package/dist/{chunk-OD2SDC4L.js.map → chunk-CEJN5ZE5.js.map} +1 -1
  21. package/dist/{chunk-2JQISXBD.js → chunk-DTEAFJG7.js} +8 -8
  22. package/dist/{chunk-2JQISXBD.js.map → chunk-DTEAFJG7.js.map} +1 -1
  23. package/dist/chunk-EHGH6TAW.js +100 -0
  24. package/dist/chunk-EHGH6TAW.js.map +1 -0
  25. package/dist/{chunk-ZU6J7KMY.js → chunk-GPF72JFR.js} +3 -3
  26. package/dist/{chunk-ZU6J7KMY.js.map → chunk-GPF72JFR.js.map} +1 -1
  27. package/dist/chunk-HEHXSV47.cjs +77 -0
  28. package/dist/chunk-HEHXSV47.cjs.map +1 -0
  29. package/dist/chunk-I5EKGD4P.cjs +113 -0
  30. package/dist/chunk-I5EKGD4P.cjs.map +1 -0
  31. package/dist/{chunk-EUP7MBAH.cjs → chunk-IIUKM5VE.cjs} +7 -7
  32. package/dist/{chunk-EUP7MBAH.cjs.map → chunk-IIUKM5VE.cjs.map} +1 -1
  33. package/dist/{chunk-CWSUBAV3.js → chunk-OBBSIPEK.js} +30 -35
  34. package/dist/chunk-OBBSIPEK.js.map +1 -0
  35. package/dist/{chunk-FVT2XRRL.cjs → chunk-Q2E432UK.cjs} +41 -46
  36. package/dist/chunk-Q2E432UK.cjs.map +1 -0
  37. package/dist/{chunk-QKI4QWLT.js → chunk-RNUG3EFC.js} +6 -6
  38. package/dist/{chunk-QKI4QWLT.js.map → chunk-RNUG3EFC.js.map} +1 -1
  39. package/dist/{chunk-3YZSIYJC.cjs → chunk-SWTNJPK5.cjs} +11 -11
  40. package/dist/{chunk-3YZSIYJC.cjs.map → chunk-SWTNJPK5.cjs.map} +1 -1
  41. package/dist/{chunk-BH24DZ5S.cjs → chunk-U3YFYMWF.cjs} +5 -5
  42. package/dist/{chunk-BH24DZ5S.cjs.map → chunk-U3YFYMWF.cjs.map} +1 -1
  43. package/dist/{chunk-3HQ7A6ZM.cjs → chunk-UFEDJJSH.cjs} +5 -5
  44. package/dist/{chunk-3HQ7A6ZM.cjs.map → chunk-UFEDJJSH.cjs.map} +1 -1
  45. package/dist/{chunk-W77GRBO4.js → chunk-UQIM2KT3.js} +3 -3
  46. package/dist/{chunk-W77GRBO4.js.map → chunk-UQIM2KT3.js.map} +1 -1
  47. package/dist/{chunk-SJDPDHSD.cjs → chunk-UTAJSERA.cjs} +4 -4
  48. package/dist/{chunk-SJDPDHSD.cjs.map → chunk-UTAJSERA.cjs.map} +1 -1
  49. package/dist/{chunk-NI62M3W3.cjs → chunk-UYE2JASE.cjs} +2 -2
  50. package/dist/{chunk-NI62M3W3.cjs.map → chunk-UYE2JASE.cjs.map} +1 -1
  51. package/dist/{chunk-S4B7GYLN.js → chunk-W3HLIKC2.js} +18 -8
  52. package/dist/chunk-W3HLIKC2.js.map +1 -0
  53. package/dist/{chunk-NDM5EJEV.cjs → chunk-XVIICZKW.cjs} +7 -7
  54. package/dist/chunk-XVIICZKW.cjs.map +1 -0
  55. package/dist/{chunk-7Q4RSSHM.js → chunk-ZTVXII74.js} +2 -2
  56. package/dist/{chunk-7Q4RSSHM.js.map → chunk-ZTVXII74.js.map} +1 -1
  57. package/dist/core/index.cjs +85 -85
  58. package/dist/core/index.d.cts +2 -2
  59. package/dist/core/index.d.ts +2 -2
  60. package/dist/core/index.js +10 -10
  61. package/dist/{index-B45-okum.d.cts → index-BgPdYxFS.d.cts} +18 -18
  62. package/dist/{index-o-Ds3YAq.d.cts → index-CL4vb3ej.d.cts} +1 -1
  63. package/dist/{index-BIcvNMPt.d.ts → index-CtcXgof_.d.ts} +18 -18
  64. package/dist/{index-DwAJBoU7.d.ts → index-D6nvfm59.d.ts} +1 -1
  65. package/dist/index.cjs +265 -266
  66. package/dist/index.cjs.map +1 -1
  67. package/dist/index.d.cts +3 -3
  68. package/dist/index.d.ts +3 -3
  69. package/dist/index.js +29 -30
  70. package/dist/index.js.map +1 -1
  71. package/dist/indexer/index.cjs +6 -6
  72. package/dist/indexer/index.d.cts +5 -5
  73. package/dist/indexer/index.d.ts +5 -5
  74. package/dist/indexer/index.js +1 -1
  75. package/dist/keys/index.cjs +18 -18
  76. package/dist/keys/index.js +4 -4
  77. package/dist/merkle-DZHEOPH3.cjs +30 -0
  78. package/dist/{merkle-HGDC6OB4.cjs.map → merkle-DZHEOPH3.cjs.map} +1 -1
  79. package/dist/merkle-IF2RMWCF.js +5 -0
  80. package/dist/{merkle-7KS2EHRF.js.map → merkle-IF2RMWCF.js.map} +1 -1
  81. package/dist/poseidon-ACM7E2OH.js +7 -0
  82. package/dist/{poseidon-UHTJLWQM.js.map → poseidon-ACM7E2OH.js.map} +1 -1
  83. package/dist/poseidon-PUSGUIVZ.cjs +61 -0
  84. package/dist/{poseidon-WHJSZSNP.cjs.map → poseidon-PUSGUIVZ.cjs.map} +1 -1
  85. package/dist/proof-JME3IZTX.js +4 -0
  86. package/dist/{proof-C4YBP6RY.js.map → proof-JME3IZTX.js.map} +1 -1
  87. package/dist/proof-XR6XE5PJ.cjs +49 -0
  88. package/dist/{proof-5OECB3RQ.cjs.map → proof-XR6XE5PJ.cjs.map} +1 -1
  89. package/dist/react/index.cjs +47 -51
  90. package/dist/react/index.cjs.map +1 -1
  91. package/dist/react/index.d.cts +2 -2
  92. package/dist/react/index.d.ts +2 -2
  93. package/dist/react/index.js +20 -24
  94. package/dist/react/index.js.map +1 -1
  95. package/dist/{transfer-BzyernBd.d.cts → transfer-D111ihqN.d.cts} +108 -56
  96. package/dist/{transfer-sqS6mJko.d.ts → transfer-DvIXqHCr.d.ts} +108 -56
  97. package/dist/transfer-MQMGSXTH.js +8 -0
  98. package/dist/{transfer-F6YOQTUL.js.map → transfer-MQMGSXTH.js.map} +1 -1
  99. package/dist/transfer-PB6D5VCW.cjs +37 -0
  100. package/dist/{transfer-42C4DXYA.cjs.map → transfer-PB6D5VCW.cjs.map} +1 -1
  101. package/dist/utils/index.cjs +60 -61
  102. package/dist/utils/index.d.cts +37 -14
  103. package/dist/utils/index.d.ts +37 -14
  104. package/dist/utils/index.js +6 -7
  105. package/package.json +4 -2
  106. package/src/contracts/interfaces/IUniversalPrivatePool.sol +10 -8
  107. package/src/contracts/interfaces/IVerifiers.sol +16 -52
  108. package/src/deployments/11155111.json +15 -12
  109. package/dist/asp-TXSAFFD3.cjs.map +0 -1
  110. package/dist/asp-ZA3RGN7G.js.map +0 -1
  111. package/dist/babyjubjub-2MGQVCKB.js +0 -5
  112. package/dist/babyjubjub-2MGQVCKB.js.map +0 -1
  113. package/dist/babyjubjub-MWZLJOVZ.cjs +0 -66
  114. package/dist/babyjubjub-MWZLJOVZ.cjs.map +0 -1
  115. package/dist/chunk-CWSUBAV3.js.map +0 -1
  116. package/dist/chunk-FVT2XRRL.cjs.map +0 -1
  117. package/dist/chunk-JWNXBALH.cjs +0 -57
  118. package/dist/chunk-JWNXBALH.cjs.map +0 -1
  119. package/dist/chunk-NDM5EJEV.cjs.map +0 -1
  120. package/dist/chunk-P37MRZ73.js.map +0 -1
  121. package/dist/chunk-PTDVGWHU.cjs +0 -10
  122. package/dist/chunk-PTDVGWHU.cjs.map +0 -1
  123. package/dist/chunk-S4B7GYLN.js.map +0 -1
  124. package/dist/chunk-SQKBT2SH.cjs.map +0 -1
  125. package/dist/chunk-TSF6HEVS.cjs +0 -201
  126. package/dist/chunk-TSF6HEVS.cjs.map +0 -1
  127. package/dist/chunk-UAVWYXDN.js +0 -8
  128. package/dist/chunk-UAVWYXDN.js.map +0 -1
  129. package/dist/chunk-V23OSL25.js +0 -48
  130. package/dist/chunk-V23OSL25.js.map +0 -1
  131. package/dist/chunk-YOWDERVC.js +0 -186
  132. package/dist/chunk-YOWDERVC.js.map +0 -1
  133. package/dist/merkle-7KS2EHRF.js +0 -5
  134. package/dist/merkle-HGDC6OB4.cjs +0 -30
  135. package/dist/poseidon-UHTJLWQM.js +0 -7
  136. package/dist/poseidon-WHJSZSNP.cjs +0 -45
  137. package/dist/proof-5OECB3RQ.cjs +0 -45
  138. package/dist/proof-C4YBP6RY.js +0 -4
  139. package/dist/transfer-42C4DXYA.cjs +0 -37
  140. package/dist/transfer-F6YOQTUL.js +0 -8
@@ -1,231 +1,230 @@
1
1
  'use strict';
2
2
 
3
- require('../chunk-PTDVGWHU.cjs');
4
- var chunkTSF6HEVS_cjs = require('../chunk-TSF6HEVS.cjs');
5
- var chunk3YZSIYJC_cjs = require('../chunk-3YZSIYJC.cjs');
6
- var chunkEUP7MBAH_cjs = require('../chunk-EUP7MBAH.cjs');
7
- var chunkBH24DZ5S_cjs = require('../chunk-BH24DZ5S.cjs');
8
- var chunk3HQ7A6ZM_cjs = require('../chunk-3HQ7A6ZM.cjs');
9
- var chunkJWNXBALH_cjs = require('../chunk-JWNXBALH.cjs');
3
+ var chunkI5EKGD4P_cjs = require('../chunk-I5EKGD4P.cjs');
4
+ var chunkSWTNJPK5_cjs = require('../chunk-SWTNJPK5.cjs');
5
+ var chunkIIUKM5VE_cjs = require('../chunk-IIUKM5VE.cjs');
6
+ var chunkU3YFYMWF_cjs = require('../chunk-U3YFYMWF.cjs');
7
+ var chunkUFEDJJSH_cjs = require('../chunk-UFEDJJSH.cjs');
8
+ var chunkHEHXSV47_cjs = require('../chunk-HEHXSV47.cjs');
10
9
  require('../chunk-G7VZBCD6.cjs');
11
10
 
12
11
 
13
12
 
14
13
  Object.defineProperty(exports, "addPoints", {
15
14
  enumerable: true,
16
- get: function () { return chunkTSF6HEVS_cjs.addPoints; }
15
+ get: function () { return chunkI5EKGD4P_cjs.addPoints; }
17
16
  });
18
17
  Object.defineProperty(exports, "computeSharedSecret", {
19
18
  enumerable: true,
20
- get: function () { return chunkTSF6HEVS_cjs.computeSharedSecret; }
19
+ get: function () { return chunkI5EKGD4P_cjs.computeSharedSecret; }
21
20
  });
22
21
  Object.defineProperty(exports, "deriveDecryptionViewingKey", {
23
22
  enumerable: true,
24
- get: function () { return chunkTSF6HEVS_cjs.deriveDecryptionViewingKey; }
23
+ get: function () { return chunkI5EKGD4P_cjs.deriveDecryptionViewingKey; }
25
24
  });
26
25
  Object.defineProperty(exports, "deriveEncryptionViewingKey", {
27
26
  enumerable: true,
28
- get: function () { return chunkTSF6HEVS_cjs.deriveEncryptionViewingKey; }
27
+ get: function () { return chunkI5EKGD4P_cjs.deriveEncryptionViewingKey; }
29
28
  });
30
29
  Object.defineProperty(exports, "getBasePoint", {
31
30
  enumerable: true,
32
- get: function () { return chunkTSF6HEVS_cjs.getBasePoint; }
31
+ get: function () { return chunkI5EKGD4P_cjs.getBasePoint; }
33
32
  });
34
33
  Object.defineProperty(exports, "getSubOrder", {
35
34
  enumerable: true,
36
- get: function () { return chunkTSF6HEVS_cjs.getSubOrder; }
35
+ get: function () { return chunkI5EKGD4P_cjs.getSubOrder; }
37
36
  });
38
37
  Object.defineProperty(exports, "isOnCurve", {
39
38
  enumerable: true,
40
- get: function () { return chunkTSF6HEVS_cjs.isOnCurve; }
39
+ get: function () { return chunkI5EKGD4P_cjs.isOnCurve; }
41
40
  });
42
41
  Object.defineProperty(exports, "mulPointScalar", {
43
42
  enumerable: true,
44
- get: function () { return chunkTSF6HEVS_cjs.mulPointScalar; }
43
+ get: function () { return chunkI5EKGD4P_cjs.mulPointScalar; }
45
44
  });
46
45
  Object.defineProperty(exports, "packPoint", {
47
46
  enumerable: true,
48
- get: function () { return chunkTSF6HEVS_cjs.packPoint; }
47
+ get: function () { return chunkI5EKGD4P_cjs.packPoint; }
49
48
  });
50
49
  Object.defineProperty(exports, "pointToTuple", {
51
50
  enumerable: true,
52
- get: function () { return chunkTSF6HEVS_cjs.pointToTuple; }
51
+ get: function () { return chunkI5EKGD4P_cjs.pointToTuple; }
53
52
  });
54
53
  Object.defineProperty(exports, "privateToPublic", {
55
54
  enumerable: true,
56
- get: function () { return chunkTSF6HEVS_cjs.privateToPublic; }
55
+ get: function () { return chunkI5EKGD4P_cjs.privateToPublic; }
57
56
  });
58
57
  Object.defineProperty(exports, "tupleToPoint", {
59
58
  enumerable: true,
60
- get: function () { return chunkTSF6HEVS_cjs.tupleToPoint; }
59
+ get: function () { return chunkI5EKGD4P_cjs.tupleToPoint; }
61
60
  });
62
61
  Object.defineProperty(exports, "STARK_AMOUNT_SCALE", {
63
62
  enumerable: true,
64
- get: function () { return chunk3YZSIYJC_cjs.STARK_AMOUNT_SCALE; }
63
+ get: function () { return chunkSWTNJPK5_cjs.STARK_AMOUNT_SCALE; }
65
64
  });
66
65
  Object.defineProperty(exports, "STARK_ASP_TREE_DEPTH", {
67
66
  enumerable: true,
68
- get: function () { return chunk3YZSIYJC_cjs.STARK_ASP_TREE_DEPTH; }
67
+ get: function () { return chunkSWTNJPK5_cjs.STARK_ASP_TREE_DEPTH; }
69
68
  });
70
69
  Object.defineProperty(exports, "STARK_STATE_TREE_DEPTH", {
71
70
  enumerable: true,
72
- get: function () { return chunk3YZSIYJC_cjs.STARK_STATE_TREE_DEPTH; }
71
+ get: function () { return chunkSWTNJPK5_cjs.STARK_STATE_TREE_DEPTH; }
73
72
  });
74
73
  Object.defineProperty(exports, "addressToM31", {
75
74
  enumerable: true,
76
- get: function () { return chunk3YZSIYJC_cjs.addressToM31; }
75
+ get: function () { return chunkSWTNJPK5_cjs.addressToM31; }
77
76
  });
78
77
  Object.defineProperty(exports, "buildStarkTransferWitness", {
79
78
  enumerable: true,
80
- get: function () { return chunk3YZSIYJC_cjs.buildStarkTransferWitness; }
79
+ get: function () { return chunkSWTNJPK5_cjs.buildStarkTransferWitness; }
81
80
  });
82
81
  Object.defineProperty(exports, "buildStarkWithdrawWitness", {
83
82
  enumerable: true,
84
- get: function () { return chunk3YZSIYJC_cjs.buildStarkWithdrawWitness; }
83
+ get: function () { return chunkSWTNJPK5_cjs.buildStarkWithdrawWitness; }
85
84
  });
86
85
  Object.defineProperty(exports, "computeTransferPublicInputsSeed", {
87
86
  enumerable: true,
88
- get: function () { return chunk3YZSIYJC_cjs.computeTransferPublicInputsSeed; }
87
+ get: function () { return chunkSWTNJPK5_cjs.computeTransferPublicInputsSeed; }
89
88
  });
90
89
  Object.defineProperty(exports, "computeWithdrawPublicInputsSeed", {
91
90
  enumerable: true,
92
- get: function () { return chunk3YZSIYJC_cjs.computeWithdrawPublicInputsSeed; }
91
+ get: function () { return chunkSWTNJPK5_cjs.computeWithdrawPublicInputsSeed; }
93
92
  });
94
93
  Object.defineProperty(exports, "isStarkAligned", {
95
94
  enumerable: true,
96
- get: function () { return chunk3YZSIYJC_cjs.isStarkAligned; }
95
+ get: function () { return chunkSWTNJPK5_cjs.isStarkAligned; }
97
96
  });
98
97
  Object.defineProperty(exports, "packM31Digest", {
99
98
  enumerable: true,
100
- get: function () { return chunk3YZSIYJC_cjs.packM31Digest; }
99
+ get: function () { return chunkSWTNJPK5_cjs.packM31Digest; }
101
100
  });
102
101
  Object.defineProperty(exports, "scaleAmountForStark", {
103
102
  enumerable: true,
104
- get: function () { return chunk3YZSIYJC_cjs.scaleAmountForStark; }
103
+ get: function () { return chunkSWTNJPK5_cjs.scaleAmountForStark; }
105
104
  });
106
105
  Object.defineProperty(exports, "splitSecretToM31Limbs", {
107
106
  enumerable: true,
108
- get: function () { return chunk3YZSIYJC_cjs.splitSecretToM31Limbs; }
107
+ get: function () { return chunkSWTNJPK5_cjs.splitSecretToM31Limbs; }
109
108
  });
110
109
  Object.defineProperty(exports, "truncateToM31", {
111
110
  enumerable: true,
112
- get: function () { return chunk3YZSIYJC_cjs.truncateToM31; }
111
+ get: function () { return chunkSWTNJPK5_cjs.truncateToM31; }
113
112
  });
114
113
  Object.defineProperty(exports, "MAX_TREE_DEPTH", {
115
114
  enumerable: true,
116
- get: function () { return chunkEUP7MBAH_cjs.MAX_TREE_DEPTH; }
115
+ get: function () { return chunkIIUKM5VE_cjs.MAX_TREE_DEPTH; }
117
116
  });
118
117
  Object.defineProperty(exports, "MerkleTree", {
119
118
  enumerable: true,
120
- get: function () { return chunkEUP7MBAH_cjs.MerkleTree; }
119
+ get: function () { return chunkIIUKM5VE_cjs.MerkleTree; }
121
120
  });
122
121
  Object.defineProperty(exports, "buildMerkleTree", {
123
122
  enumerable: true,
124
- get: function () { return chunkEUP7MBAH_cjs.buildMerkleTree; }
123
+ get: function () { return chunkIIUKM5VE_cjs.buildMerkleTree; }
125
124
  });
126
125
  Object.defineProperty(exports, "getMerkleProof", {
127
126
  enumerable: true,
128
- get: function () { return chunkEUP7MBAH_cjs.getMerkleProof; }
127
+ get: function () { return chunkIIUKM5VE_cjs.getMerkleProof; }
129
128
  });
130
129
  Object.defineProperty(exports, "verifyMerkleProof", {
131
130
  enumerable: true,
132
- get: function () { return chunkEUP7MBAH_cjs.verifyMerkleProof; }
131
+ get: function () { return chunkIIUKM5VE_cjs.verifyMerkleProof; }
133
132
  });
134
133
  Object.defineProperty(exports, "DIGEST_SIZE", {
135
134
  enumerable: true,
136
- get: function () { return chunkBH24DZ5S_cjs.DIGEST_SIZE; }
135
+ get: function () { return chunkU3YFYMWF_cjs.DIGEST_SIZE; }
137
136
  });
138
137
  Object.defineProperty(exports, "M31_P", {
139
138
  enumerable: true,
140
- get: function () { return chunkBH24DZ5S_cjs.M31_P; }
139
+ get: function () { return chunkU3YFYMWF_cjs.M31_P; }
141
140
  });
142
141
  Object.defineProperty(exports, "SECRET_LIMBS", {
143
142
  enumerable: true,
144
- get: function () { return chunkBH24DZ5S_cjs.SECRET_LIMBS; }
143
+ get: function () { return chunkU3YFYMWF_cjs.SECRET_LIMBS; }
145
144
  });
146
145
  Object.defineProperty(exports, "computeStarkCommitment", {
147
146
  enumerable: true,
148
- get: function () { return chunkBH24DZ5S_cjs.computeStarkCommitment; }
147
+ get: function () { return chunkU3YFYMWF_cjs.computeStarkCommitment; }
149
148
  });
150
149
  Object.defineProperty(exports, "computeStarkNullifier", {
151
150
  enumerable: true,
152
- get: function () { return chunkBH24DZ5S_cjs.computeStarkNullifier; }
151
+ get: function () { return chunkU3YFYMWF_cjs.computeStarkNullifier; }
153
152
  });
154
153
  Object.defineProperty(exports, "computeStarkOwnerHash", {
155
154
  enumerable: true,
156
- get: function () { return chunkBH24DZ5S_cjs.computeStarkOwnerHash; }
155
+ get: function () { return chunkU3YFYMWF_cjs.computeStarkOwnerHash; }
157
156
  });
158
157
  Object.defineProperty(exports, "keccakHashTwo", {
159
158
  enumerable: true,
160
- get: function () { return chunkBH24DZ5S_cjs.keccakHashTwo; }
159
+ get: function () { return chunkU3YFYMWF_cjs.keccakHashTwo; }
161
160
  });
162
161
  Object.defineProperty(exports, "keccakM31", {
163
162
  enumerable: true,
164
- get: function () { return chunkBH24DZ5S_cjs.keccakM31; }
163
+ get: function () { return chunkU3YFYMWF_cjs.keccakM31; }
165
164
  });
166
165
  Object.defineProperty(exports, "splitToM31Limbs", {
167
166
  enumerable: true,
168
- get: function () { return chunkBH24DZ5S_cjs.splitToM31Limbs; }
167
+ get: function () { return chunkU3YFYMWF_cjs.splitToM31Limbs; }
169
168
  });
170
169
  Object.defineProperty(exports, "bigintToBytes", {
171
170
  enumerable: true,
172
- get: function () { return chunk3HQ7A6ZM_cjs.bigintToBytes; }
171
+ get: function () { return chunkUFEDJJSH_cjs.bigintToBytes; }
173
172
  });
174
173
  Object.defineProperty(exports, "bytesToBigint", {
175
174
  enumerable: true,
176
- get: function () { return chunk3HQ7A6ZM_cjs.bytesToBigint; }
175
+ get: function () { return chunkUFEDJJSH_cjs.bytesToBigint; }
177
176
  });
178
177
  Object.defineProperty(exports, "bytesToHex", {
179
178
  enumerable: true,
180
- get: function () { return chunk3HQ7A6ZM_cjs.bytesToHex; }
179
+ get: function () { return chunkUFEDJJSH_cjs.bytesToHex; }
181
180
  });
182
181
  Object.defineProperty(exports, "hexToBytes", {
183
182
  enumerable: true,
184
- get: function () { return chunk3HQ7A6ZM_cjs.hexToBytes; }
183
+ get: function () { return chunkUFEDJJSH_cjs.hexToBytes; }
185
184
  });
186
185
  Object.defineProperty(exports, "randomBytes", {
187
186
  enumerable: true,
188
- get: function () { return chunk3HQ7A6ZM_cjs.randomBytes; }
187
+ get: function () { return chunkUFEDJJSH_cjs.randomBytes; }
189
188
  });
190
189
  Object.defineProperty(exports, "randomFieldElement", {
191
190
  enumerable: true,
192
- get: function () { return chunk3HQ7A6ZM_cjs.randomFieldElement; }
191
+ get: function () { return chunkUFEDJJSH_cjs.randomFieldElement; }
193
192
  });
194
193
  Object.defineProperty(exports, "BABYJUBJUB_SUBORDER", {
195
194
  enumerable: true,
196
- get: function () { return chunkJWNXBALH_cjs.BABYJUBJUB_SUBORDER; }
195
+ get: function () { return chunkHEHXSV47_cjs.BABYJUBJUB_SUBORDER; }
197
196
  });
198
197
  Object.defineProperty(exports, "FIELD_PRIME", {
199
198
  enumerable: true,
200
- get: function () { return chunkJWNXBALH_cjs.FIELD_PRIME; }
199
+ get: function () { return chunkHEHXSV47_cjs.FIELD_PRIME; }
201
200
  });
202
201
  Object.defineProperty(exports, "addressToField", {
203
202
  enumerable: true,
204
- get: function () { return chunkJWNXBALH_cjs.addressToField; }
203
+ get: function () { return chunkHEHXSV47_cjs.addressToField; }
205
204
  });
206
205
  Object.defineProperty(exports, "fieldToAddress", {
207
206
  enumerable: true,
208
- get: function () { return chunkJWNXBALH_cjs.fieldToAddress; }
207
+ get: function () { return chunkHEHXSV47_cjs.fieldToAddress; }
209
208
  });
210
209
  Object.defineProperty(exports, "isValidFieldElement", {
211
210
  enumerable: true,
212
- get: function () { return chunkJWNXBALH_cjs.isValidFieldElement; }
211
+ get: function () { return chunkHEHXSV47_cjs.isValidFieldElement; }
213
212
  });
214
213
  Object.defineProperty(exports, "poseidon", {
215
214
  enumerable: true,
216
- get: function () { return chunkJWNXBALH_cjs.poseidon; }
215
+ get: function () { return chunkHEHXSV47_cjs.poseidon; }
217
216
  });
218
217
  Object.defineProperty(exports, "poseidonHash", {
219
218
  enumerable: true,
220
- get: function () { return chunkJWNXBALH_cjs.poseidonHash; }
219
+ get: function () { return chunkHEHXSV47_cjs.poseidonHash; }
221
220
  });
222
221
  Object.defineProperty(exports, "poseidonScalar", {
223
222
  enumerable: true,
224
- get: function () { return chunkJWNXBALH_cjs.poseidonScalar; }
223
+ get: function () { return chunkHEHXSV47_cjs.poseidonScalar; }
225
224
  });
226
225
  Object.defineProperty(exports, "toFieldElement", {
227
226
  enumerable: true,
228
- get: function () { return chunkJWNXBALH_cjs.toFieldElement; }
227
+ get: function () { return chunkHEHXSV47_cjs.toFieldElement; }
229
228
  });
230
229
  //# sourceMappingURL=index.cjs.map
231
230
  //# sourceMappingURL=index.cjs.map
@@ -4,28 +4,49 @@ export { D as DIGEST_SIZE, a as M31Digest, M as M31Secret, b as M31_P, S as SECR
4
4
  import 'viem';
5
5
 
6
6
  /**
7
- * Poseidon Hash Utilities
7
+ * Poseidon Hash Utilities (BLS12-381)
8
8
  *
9
- * Wrapper around circomlibjs Poseidon hash implementation.
10
- * Used for commitments, nullifiers, and key derivation.
9
+ * Poseidon hash over the BLS12-381 scalar field (128-bit security).
10
+ * Uses the poseidon-bls12381 package for hash computation.
11
+ *
12
+ * This replaces the previous circomlibjs BN254 Poseidon implementation.
13
+ * The BLS12-381 field provides 128-bit security (vs ~100-bit for BN254),
14
+ * meeting the NIST 128-bit minimum standard.
11
15
  */
12
16
  /**
13
- * BN254 field prime (same as used in Circom/snarkjs)
17
+ * BLS12-381 scalar field prime (Fr)
18
+ *
19
+ * r = 0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001
20
+ * = 52435875175126190479447740508185965837690552500527637822603658699938581184513
21
+ *
22
+ * This is ~255 bits, providing 128-bit security.
14
23
  */
15
- declare const FIELD_PRIME = 21888242871839275222246405745257275088548364400416034343698204186575808495617n;
24
+ declare const FIELD_PRIME = 52435875175126190479447740508185965837690552500527637822603658699938581184513n;
16
25
  /**
17
- * BabyJubJub subgroup order
26
+ * @deprecated BabyJubJub is no longer used in BLS12-381 circuits.
27
+ * Hash-based ownership (ownerHash = Poseidon(secret)) replaces curve operations.
28
+ * Kept temporarily for backward compatibility with off-chain stealth address code.
18
29
  */
19
30
  declare const BABYJUBJUB_SUBORDER = 2736030358979909402780800718157159386076813972158567259200215660948447373041n;
20
31
  /**
21
- * Compute Poseidon hash of inputs
32
+ * Compute Poseidon hash over BLS12-381 scalar field
33
+ *
34
+ * Synchronous — no initialization needed (unlike circomlibjs).
35
+ * The async signature is preserved for backward compatibility.
22
36
  *
23
- * @param inputs - Array of field elements to hash (up to 16 elements)
24
- * @returns Hash as bigint
37
+ * @param inputs - Array of field elements to hash (1-6 elements)
38
+ * @returns Hash as bigint in BLS12-381 scalar field
25
39
  *
26
40
  * @example
27
41
  * ```ts
28
- * const commitment = await poseidon([amount, blinding, origin, token])
42
+ * // Note commitment (5 inputs)
43
+ * const commitment = await poseidon([amount, ownerHash, blinding, origin, token])
44
+ *
45
+ * // Nullifier (3 inputs)
46
+ * const nullifier = await poseidon([oneTimeSecret, leafIndex, commitment])
47
+ *
48
+ * // Owner hash (1 input)
49
+ * const ownerHash = await poseidon([oneTimeSecret])
29
50
  * ```
30
51
  */
31
52
  declare function poseidon(inputs: bigint[]): Promise<bigint>;
@@ -34,8 +55,10 @@ declare function poseidon(inputs: bigint[]): Promise<bigint>;
34
55
  */
35
56
  declare function poseidonHash(inputs: bigint[]): Promise<`0x${string}`>;
36
57
  /**
37
- * Compute Poseidon hash modulo BabyJubJub suborder
38
- * Used for deriving scalars for curve operations
58
+ * @deprecated BabyJubJub scalars are no longer used. Use poseidon() directly.
59
+ *
60
+ * Compute Poseidon hash modulo BabyJubJub suborder.
61
+ * Kept for backward compatibility with off-chain stealth address code.
39
62
  */
40
63
  declare function poseidonScalar(inputs: bigint[]): Promise<bigint>;
41
64
  /**
@@ -47,11 +70,11 @@ declare function addressToField(address: `0x${string}`): bigint;
47
70
  */
48
71
  declare function fieldToAddress(field: bigint): `0x${string}`;
49
72
  /**
50
- * Check if a value is within the field
73
+ * Check if a value is within the BLS12-381 scalar field
51
74
  */
52
75
  declare function isValidFieldElement(value: bigint): boolean;
53
76
  /**
54
- * Reduce a value modulo field prime
77
+ * Reduce a value modulo BLS12-381 field prime
55
78
  */
56
79
  declare function toFieldElement(value: bigint): bigint;
57
80
 
@@ -4,28 +4,49 @@ export { D as DIGEST_SIZE, a as M31Digest, M as M31Secret, b as M31_P, S as SECR
4
4
  import 'viem';
5
5
 
6
6
  /**
7
- * Poseidon Hash Utilities
7
+ * Poseidon Hash Utilities (BLS12-381)
8
8
  *
9
- * Wrapper around circomlibjs Poseidon hash implementation.
10
- * Used for commitments, nullifiers, and key derivation.
9
+ * Poseidon hash over the BLS12-381 scalar field (128-bit security).
10
+ * Uses the poseidon-bls12381 package for hash computation.
11
+ *
12
+ * This replaces the previous circomlibjs BN254 Poseidon implementation.
13
+ * The BLS12-381 field provides 128-bit security (vs ~100-bit for BN254),
14
+ * meeting the NIST 128-bit minimum standard.
11
15
  */
12
16
  /**
13
- * BN254 field prime (same as used in Circom/snarkjs)
17
+ * BLS12-381 scalar field prime (Fr)
18
+ *
19
+ * r = 0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001
20
+ * = 52435875175126190479447740508185965837690552500527637822603658699938581184513
21
+ *
22
+ * This is ~255 bits, providing 128-bit security.
14
23
  */
15
- declare const FIELD_PRIME = 21888242871839275222246405745257275088548364400416034343698204186575808495617n;
24
+ declare const FIELD_PRIME = 52435875175126190479447740508185965837690552500527637822603658699938581184513n;
16
25
  /**
17
- * BabyJubJub subgroup order
26
+ * @deprecated BabyJubJub is no longer used in BLS12-381 circuits.
27
+ * Hash-based ownership (ownerHash = Poseidon(secret)) replaces curve operations.
28
+ * Kept temporarily for backward compatibility with off-chain stealth address code.
18
29
  */
19
30
  declare const BABYJUBJUB_SUBORDER = 2736030358979909402780800718157159386076813972158567259200215660948447373041n;
20
31
  /**
21
- * Compute Poseidon hash of inputs
32
+ * Compute Poseidon hash over BLS12-381 scalar field
33
+ *
34
+ * Synchronous — no initialization needed (unlike circomlibjs).
35
+ * The async signature is preserved for backward compatibility.
22
36
  *
23
- * @param inputs - Array of field elements to hash (up to 16 elements)
24
- * @returns Hash as bigint
37
+ * @param inputs - Array of field elements to hash (1-6 elements)
38
+ * @returns Hash as bigint in BLS12-381 scalar field
25
39
  *
26
40
  * @example
27
41
  * ```ts
28
- * const commitment = await poseidon([amount, blinding, origin, token])
42
+ * // Note commitment (5 inputs)
43
+ * const commitment = await poseidon([amount, ownerHash, blinding, origin, token])
44
+ *
45
+ * // Nullifier (3 inputs)
46
+ * const nullifier = await poseidon([oneTimeSecret, leafIndex, commitment])
47
+ *
48
+ * // Owner hash (1 input)
49
+ * const ownerHash = await poseidon([oneTimeSecret])
29
50
  * ```
30
51
  */
31
52
  declare function poseidon(inputs: bigint[]): Promise<bigint>;
@@ -34,8 +55,10 @@ declare function poseidon(inputs: bigint[]): Promise<bigint>;
34
55
  */
35
56
  declare function poseidonHash(inputs: bigint[]): Promise<`0x${string}`>;
36
57
  /**
37
- * Compute Poseidon hash modulo BabyJubJub suborder
38
- * Used for deriving scalars for curve operations
58
+ * @deprecated BabyJubJub scalars are no longer used. Use poseidon() directly.
59
+ *
60
+ * Compute Poseidon hash modulo BabyJubJub suborder.
61
+ * Kept for backward compatibility with off-chain stealth address code.
39
62
  */
40
63
  declare function poseidonScalar(inputs: bigint[]): Promise<bigint>;
41
64
  /**
@@ -47,11 +70,11 @@ declare function addressToField(address: `0x${string}`): bigint;
47
70
  */
48
71
  declare function fieldToAddress(field: bigint): `0x${string}`;
49
72
  /**
50
- * Check if a value is within the field
73
+ * Check if a value is within the BLS12-381 scalar field
51
74
  */
52
75
  declare function isValidFieldElement(value: bigint): boolean;
53
76
  /**
54
- * Reduce a value modulo field prime
77
+ * Reduce a value modulo BLS12-381 field prime
55
78
  */
56
79
  declare function toFieldElement(value: bigint): bigint;
57
80
 
@@ -1,10 +1,9 @@
1
- import '../chunk-UAVWYXDN.js';
2
- export { addPoints, computeSharedSecret, deriveDecryptionViewingKey, deriveEncryptionViewingKey, getBasePoint, getSubOrder, isOnCurve, mulPointScalar, packPoint, pointToTuple, privateToPublic, tupleToPoint } from '../chunk-YOWDERVC.js';
3
- export { STARK_AMOUNT_SCALE, STARK_ASP_TREE_DEPTH, STARK_STATE_TREE_DEPTH, addressToM31, buildStarkTransferWitness, buildStarkWithdrawWitness, computeTransferPublicInputsSeed, computeWithdrawPublicInputsSeed, isStarkAligned, packM31Digest, scaleAmountForStark, splitSecretToM31Limbs, truncateToM31 } from '../chunk-XBNYAAMU.js';
4
- export { MAX_TREE_DEPTH, MerkleTree, buildMerkleTree, getMerkleProof, verifyMerkleProof } from '../chunk-ZU6J7KMY.js';
5
- export { DIGEST_SIZE, M31_P, SECRET_LIMBS, computeStarkCommitment, computeStarkNullifier, computeStarkOwnerHash, keccakHashTwo, keccakM31, splitToM31Limbs } from '../chunk-5V5HSN6Y.js';
6
- export { bigintToBytes, bytesToBigint, bytesToHex, hexToBytes, randomBytes, randomFieldElement } from '../chunk-W77GRBO4.js';
7
- export { BABYJUBJUB_SUBORDER, FIELD_PRIME, addressToField, fieldToAddress, isValidFieldElement, poseidon, poseidonHash, poseidonScalar, toFieldElement } from '../chunk-V23OSL25.js';
1
+ export { addPoints, computeSharedSecret, deriveDecryptionViewingKey, deriveEncryptionViewingKey, getBasePoint, getSubOrder, isOnCurve, mulPointScalar, packPoint, pointToTuple, privateToPublic, tupleToPoint } from '../chunk-EHGH6TAW.js';
2
+ export { STARK_AMOUNT_SCALE, STARK_ASP_TREE_DEPTH, STARK_STATE_TREE_DEPTH, addressToM31, buildStarkTransferWitness, buildStarkWithdrawWitness, computeTransferPublicInputsSeed, computeWithdrawPublicInputsSeed, isStarkAligned, packM31Digest, scaleAmountForStark, splitSecretToM31Limbs, truncateToM31 } from '../chunk-7T4CUE6E.js';
3
+ export { MAX_TREE_DEPTH, MerkleTree, buildMerkleTree, getMerkleProof, verifyMerkleProof } from '../chunk-GPF72JFR.js';
4
+ export { DIGEST_SIZE, M31_P, SECRET_LIMBS, computeStarkCommitment, computeStarkNullifier, computeStarkOwnerHash, keccakHashTwo, keccakM31, splitToM31Limbs } from '../chunk-6TFDBBAQ.js';
5
+ export { bigintToBytes, bytesToBigint, bytesToHex, hexToBytes, randomBytes, randomFieldElement } from '../chunk-UQIM2KT3.js';
6
+ export { BABYJUBJUB_SUBORDER, FIELD_PRIME, addressToField, fieldToAddress, isValidFieldElement, poseidon, poseidonHash, poseidonScalar, toFieldElement } from '../chunk-5QSSX3KR.js';
8
7
  import '../chunk-Z6ZWNWWR.js';
9
8
  //# sourceMappingURL=index.js.map
10
9
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@permissionless-technologies/upp-sdk",
3
- "version": "0.3.6",
3
+ "version": "0.4.0",
4
4
  "description": "Universal Private Pool SDK - Privacy-preserving token operations for any ERC20",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -90,12 +90,13 @@
90
90
  },
91
91
  "dependencies": {
92
92
  "@noble/curves": "^1.4.0",
93
- "@permissionless-technologies/upc-sdk": "^0.1.0",
93
+ "@permissionless-technologies/upc-sdk": "^0.3.0",
94
94
  "@zk-kit/lean-imt.sol": "^2.0.1",
95
95
  "@zk-kit/poseidon-cipher": "^0.3.0",
96
96
  "bech32": "^2.0.0",
97
97
  "circomlib": "^2.0.5",
98
98
  "circomlibjs": "^0.1.7",
99
+ "poseidon-bls12381": "^1.0.2",
99
100
  "poseidon-solidity": "^0.0.5",
100
101
  "snarkjs": "^0.7.4"
101
102
  },
@@ -107,6 +108,7 @@
107
108
  "@types/react-dom": "^19.2.3",
108
109
  "@types/snarkjs": "^0.7.8",
109
110
  "eslint": "^8.0.0",
111
+ "poseidon-bls12381-circom": "^1.0.0",
110
112
  "react": "^19.0.0",
111
113
  "tsup": "^8.0.0",
112
114
  "typescript": "^5.0.0",
@@ -1,6 +1,8 @@
1
1
  // SPDX-License-Identifier: MIT
2
2
  pragma solidity ^0.8.20;
3
3
 
4
+ import "../src/PlonkVerifierBLS12381.sol";
5
+
4
6
  /// @notice Interface for the Universal Private Pool
5
7
  interface IUniversalPrivatePool {
6
8
  // ============ Events ============
@@ -129,7 +131,7 @@ interface IUniversalPrivatePool {
129
131
  // ============ Transfer ============
130
132
 
131
133
  function transfer(
132
- uint256[8] calldata proof,
134
+ PlonkVerifierBLS12381.Proof calldata proof,
133
135
  bytes32 nullifier,
134
136
  uint256 stateRoot,
135
137
  uint256 aspRoot,
@@ -143,7 +145,7 @@ interface IUniversalPrivatePool {
143
145
  // ============ Merge ============
144
146
 
145
147
  function merge(
146
- uint256[8] calldata proof,
148
+ PlonkVerifierBLS12381.Proof calldata proof,
147
149
  bytes32 nullifier1,
148
150
  bytes32 nullifier2,
149
151
  uint256 stateRoot,
@@ -155,7 +157,7 @@ interface IUniversalPrivatePool {
155
157
  // ============ Withdraw ============
156
158
 
157
159
  function withdraw(
158
- uint256[8] calldata proof,
160
+ PlonkVerifierBLS12381.Proof calldata proof,
159
161
  bytes32 nullifier,
160
162
  uint256 stateRoot,
161
163
  uint256 aspRoot,
@@ -169,7 +171,7 @@ interface IUniversalPrivatePool {
169
171
  // ============ JoinSplit ============
170
172
 
171
173
  function joinSplit(
172
- uint256[8] calldata proof,
174
+ PlonkVerifierBLS12381.Proof calldata proof,
173
175
  bytes32[4] calldata nullifiers,
174
176
  uint256 stateRoot,
175
177
  uint256 aspRoot,
@@ -184,7 +186,7 @@ interface IUniversalPrivatePool {
184
186
  // ============ MergeTransfer ============
185
187
 
186
188
  function mergeTransfer2x2(
187
- uint256[8] calldata proof,
189
+ PlonkVerifierBLS12381.Proof calldata proof,
188
190
  bytes32 nullifier1,
189
191
  bytes32 nullifier2,
190
192
  uint256 stateRoot,
@@ -196,7 +198,7 @@ interface IUniversalPrivatePool {
196
198
  ) external;
197
199
 
198
200
  function mergeTransfer4x2(
199
- uint256[8] calldata proof,
201
+ PlonkVerifierBLS12381.Proof calldata proof,
200
202
  bytes32[4] calldata nullifiers,
201
203
  uint256 stateRoot,
202
204
  address token,
@@ -209,7 +211,7 @@ interface IUniversalPrivatePool {
209
211
  // ============ Swap ============
210
212
 
211
213
  function swapOrder(
212
- uint256[8] calldata proof,
214
+ PlonkVerifierBLS12381.Proof calldata proof,
213
215
  bytes32 nullifier,
214
216
  uint256 stateRoot,
215
217
  uint256 aspRoot,
@@ -225,7 +227,7 @@ interface IUniversalPrivatePool {
225
227
 
226
228
  function swapFill(
227
229
  bytes32 orderId,
228
- uint256[8] calldata proof,
230
+ PlonkVerifierBLS12381.Proof calldata proof,
229
231
  bytes32 nullifier,
230
232
  uint256 stateRoot,
231
233
  uint256 aspRoot,