@velumdotcash/sdk 2.0.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 (49) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +142 -0
  3. package/dist/__tests__/paylink.test.d.ts +9 -0
  4. package/dist/__tests__/paylink.test.js +254 -0
  5. package/dist/config.d.ts +9 -0
  6. package/dist/config.js +12 -0
  7. package/dist/deposit.d.ts +22 -0
  8. package/dist/deposit.js +445 -0
  9. package/dist/depositSPL.d.ts +24 -0
  10. package/dist/depositSPL.js +499 -0
  11. package/dist/errors.d.ts +78 -0
  12. package/dist/errors.js +127 -0
  13. package/dist/exportUtils.d.ts +10 -0
  14. package/dist/exportUtils.js +10 -0
  15. package/dist/getUtxos.d.ts +30 -0
  16. package/dist/getUtxos.js +335 -0
  17. package/dist/getUtxosSPL.d.ts +34 -0
  18. package/dist/getUtxosSPL.js +442 -0
  19. package/dist/index.d.ts +183 -0
  20. package/dist/index.js +436 -0
  21. package/dist/models/keypair.d.ts +26 -0
  22. package/dist/models/keypair.js +43 -0
  23. package/dist/models/utxo.d.ts +51 -0
  24. package/dist/models/utxo.js +99 -0
  25. package/dist/test_paylink_logic.test.d.ts +1 -0
  26. package/dist/test_paylink_logic.test.js +114 -0
  27. package/dist/utils/address_lookup_table.d.ts +9 -0
  28. package/dist/utils/address_lookup_table.js +45 -0
  29. package/dist/utils/constants.d.ts +27 -0
  30. package/dist/utils/constants.js +56 -0
  31. package/dist/utils/debug-logger.d.ts +250 -0
  32. package/dist/utils/debug-logger.js +688 -0
  33. package/dist/utils/encryption.d.ts +152 -0
  34. package/dist/utils/encryption.js +700 -0
  35. package/dist/utils/logger.d.ts +9 -0
  36. package/dist/utils/logger.js +35 -0
  37. package/dist/utils/merkle_tree.d.ts +92 -0
  38. package/dist/utils/merkle_tree.js +186 -0
  39. package/dist/utils/node-shim.d.ts +14 -0
  40. package/dist/utils/node-shim.js +21 -0
  41. package/dist/utils/prover.d.ts +36 -0
  42. package/dist/utils/prover.js +169 -0
  43. package/dist/utils/utils.d.ts +64 -0
  44. package/dist/utils/utils.js +165 -0
  45. package/dist/withdraw.d.ts +22 -0
  46. package/dist/withdraw.js +290 -0
  47. package/dist/withdrawSPL.d.ts +24 -0
  48. package/dist/withdrawSPL.js +329 -0
  49. package/package.json +59 -0
@@ -0,0 +1,329 @@
1
+ import { PublicKey, } from "@solana/web3.js";
2
+ import BN from "bn.js";
3
+ import { Buffer } from "buffer";
4
+ import { Keypair as UtxoKeypair } from "./models/keypair.js";
5
+ import { Utxo } from "./models/utxo.js";
6
+ import { parseProofToBytesArray, parseToBytesArray, prove, } from "./utils/prover.js";
7
+ import { ALT_ADDRESS, FEE_RECIPIENT, FIELD_SIZE, RELAYER_API_URL, MERKLE_TREE_DEPTH, PROGRAM_ID, tokens, } from "./utils/constants.js";
8
+ import { serializeProofAndExtData, } from "./utils/encryption.js";
9
+ import { fetchMerkleProof, findNullifierPDAs, getProgramAccounts, queryRemoteTreeState, findCrossCheckNullifierPDAs, getMintAddressField, getExtDataHash, } from "./utils/utils.js";
10
+ import { getUtxosSPL } from "./getUtxosSPL.js";
11
+ import { logger } from "./utils/logger.js";
12
+ import { getConfig } from "./config.js";
13
+ import { getAssociatedTokenAddressSync, getMint } from "@solana/spl-token";
14
+ // Indexer API endpoint
15
+ // Function to submit withdraw request to indexer backend
16
+ async function submitWithdrawToIndexer(params) {
17
+ try {
18
+ const response = await fetch(`${RELAYER_API_URL}/withdraw/spl`, {
19
+ method: "POST",
20
+ headers: {
21
+ "Content-Type": "application/json",
22
+ },
23
+ body: JSON.stringify(params),
24
+ });
25
+ if (!response.ok) {
26
+ const errorData = (await response.json());
27
+ throw new Error(errorData.error);
28
+ }
29
+ const result = (await response.json());
30
+ logger.debug("Withdraw request submitted successfully!");
31
+ logger.debug("Response:", result);
32
+ return result.signature;
33
+ }
34
+ catch (error) {
35
+ logger.debug("Failed to submit withdraw request to indexer:", typeof error, error);
36
+ throw error;
37
+ }
38
+ }
39
+ export async function withdrawSPL({ recipient, lightWasm, storage, publicKey, connection, base_units, amount, encryptionService, keyBasePath, mintAddress, referrer, }) {
40
+ if (typeof mintAddress == "string") {
41
+ mintAddress = new PublicKey(mintAddress);
42
+ }
43
+ let token = tokens.find((t) => t.pubkey.toString() == mintAddress.toString());
44
+ if (!token) {
45
+ throw new Error("token not found: " + mintAddress.toString());
46
+ }
47
+ if (amount) {
48
+ base_units = amount * token.units_per_token;
49
+ }
50
+ if (!base_units) {
51
+ throw new Error('You must input at leaset one of "base_units" or "amount"');
52
+ }
53
+ let mintInfo = await getMint(connection, token.pubkey);
54
+ let units_per_token = 10 ** mintInfo.decimals;
55
+ let withdraw_fee_rate = await getConfig("withdraw_fee_rate");
56
+ let withdraw_rent_fees = await getConfig("rent_fees");
57
+ let token_rent_fee = withdraw_rent_fees[token.name];
58
+ if (!token_rent_fee) {
59
+ throw new Error("can not find token_rent_fee for " + token.name);
60
+ }
61
+ let fee_base_units = Math.floor(base_units * withdraw_fee_rate + units_per_token * token_rent_fee);
62
+ base_units = Math.floor(base_units - fee_base_units);
63
+ if (base_units <= 0) {
64
+ throw new Error("withdraw amount too low, at least " + fee_base_units / token_rent_fee);
65
+ }
66
+ let isPartial = false;
67
+ let recipient_ata = getAssociatedTokenAddressSync(token.pubkey, recipient, true);
68
+ let feeRecipientTokenAccount = getAssociatedTokenAddressSync(token.pubkey, FEE_RECIPIENT, true);
69
+ let signerTokenAccount = getAssociatedTokenAddressSync(token.pubkey, publicKey);
70
+ logger.debug("Encryption key generated from user keypair");
71
+ // Derive tree account PDA with mint address for SPL (different from SOL version)
72
+ const [treeAccount] = PublicKey.findProgramAddressSync([Buffer.from("merkle_tree"), token.pubkey.toBuffer()], PROGRAM_ID);
73
+ const { globalConfigAccount, treeTokenAccount } = getProgramAccounts();
74
+ // Get current tree state
75
+ const { root, nextIndex: currentNextIndex } = await queryRemoteTreeState(token.name);
76
+ logger.debug(`Using tree root: ${root}`);
77
+ logger.debug(`New UTXOs will be inserted at indices: ${currentNextIndex} and ${currentNextIndex + 1}`);
78
+ // Generate a deterministic private key derived from the wallet keypair
79
+ const utxoPrivateKey = encryptionService.deriveUtxoPrivateKey();
80
+ // Create a UTXO keypair that will be used for all inputs and outputs
81
+ const utxoKeypair = new UtxoKeypair(utxoPrivateKey, lightWasm);
82
+ logger.debug("Using wallet-derived UTXO keypair for withdrawal");
83
+ // Generate a deterministic private key derived from the wallet keypair (V2)
84
+ const utxoPrivateKeyV2 = encryptionService.getUtxoPrivateKeyV2();
85
+ const utxoKeypairV2 = new UtxoKeypair(utxoPrivateKeyV2, lightWasm);
86
+ // Fetch existing UTXOs for this user
87
+ logger.debug("\nFetching existing UTXOs...");
88
+ const mintUtxos = await getUtxosSPL({
89
+ connection,
90
+ publicKey,
91
+ encryptionService,
92
+ storage,
93
+ mintAddress,
94
+ });
95
+ logger.debug(`Found ${mintUtxos.length} total UTXOs for ${token.name}`);
96
+ // Calculate and log total unspent UTXO balance
97
+ const totalUnspentBalance = mintUtxos.reduce((sum, utxo) => sum.add(utxo.amount), new BN(0));
98
+ logger.debug(`Total unspent UTXO balance before: ${totalUnspentBalance.toString()} lamports (${totalUnspentBalance.toNumber() / 1e9} SOL)`);
99
+ if (mintUtxos.length < 1) {
100
+ throw new Error("Need at least 1 unspent UTXO to perform a withdrawal");
101
+ }
102
+ // Sort UTXOs by amount in descending order to use the largest ones first
103
+ mintUtxos.sort((a, b) => b.amount.cmp(a.amount));
104
+ // Use the largest UTXO as first input, and either second largest UTXO or dummy UTXO as second input
105
+ const firstInput = mintUtxos[0];
106
+ const secondInput = mintUtxos.length > 1
107
+ ? mintUtxos[1]
108
+ : new Utxo({
109
+ lightWasm,
110
+ keypair: utxoKeypair,
111
+ amount: "0",
112
+ mintAddress: token.pubkey.toString(),
113
+ });
114
+ const inputs = [firstInput, secondInput];
115
+ logger.debug(`firstInput index: ${firstInput.index}, commitment: ${firstInput.getCommitment()}`);
116
+ logger.debug(`secondInput index: ${secondInput.index}, commitment: ${secondInput.getCommitment()}`);
117
+ const totalInputAmount = firstInput.amount.add(secondInput.amount);
118
+ logger.debug(`Using UTXO with amount: ${firstInput.amount.toString()} and ${secondInput.amount.gt(new BN(0)) ? "second UTXO with amount: " + secondInput.amount.toString() : "dummy UTXO"}`);
119
+ if (totalInputAmount.toNumber() === 0) {
120
+ throw new Error("no balance");
121
+ }
122
+ if (totalInputAmount.lt(new BN(base_units + fee_base_units))) {
123
+ isPartial = true;
124
+ base_units = totalInputAmount.toNumber();
125
+ base_units -= fee_base_units;
126
+ }
127
+ // Calculate the change amount (what's left after withdrawal and fee)
128
+ const changeAmount = totalInputAmount
129
+ .sub(new BN(base_units))
130
+ .sub(new BN(fee_base_units));
131
+ logger.debug(`Withdrawing ${base_units} lamports with ${fee_base_units} fee, ${changeAmount.toString()} as change`);
132
+ // Get Merkle proofs for both input UTXOs
133
+ const inputMerkleProofs = await Promise.all(inputs.map(async (utxo, index) => {
134
+ // For dummy UTXO (amount is 0), use a zero-filled proof
135
+ if (utxo.amount.eq(new BN(0))) {
136
+ return {
137
+ pathElements: [...new Array(MERKLE_TREE_DEPTH).fill("0")],
138
+ pathIndices: Array(MERKLE_TREE_DEPTH).fill(0),
139
+ };
140
+ }
141
+ // For real UTXOs, fetch the proof from API
142
+ const commitment = await utxo.getCommitment();
143
+ return fetchMerkleProof(commitment, token.name);
144
+ }));
145
+ // Extract path elements and indices
146
+ const inputMerklePathElements = inputMerkleProofs.map((proof) => proof.pathElements);
147
+ const inputMerklePathIndices = inputs.map((utxo) => utxo.index || 0);
148
+ // Create outputs: first output is change, second is dummy (required by protocol)
149
+ const outputs = [
150
+ new Utxo({
151
+ lightWasm,
152
+ amount: changeAmount.toString(),
153
+ keypair: utxoKeypairV2,
154
+ index: currentNextIndex,
155
+ mintAddress: token.pubkey.toString(),
156
+ }), // Change output
157
+ new Utxo({
158
+ lightWasm,
159
+ amount: "0",
160
+ keypair: utxoKeypairV2,
161
+ index: currentNextIndex + 1,
162
+ mintAddress: token.pubkey.toString(),
163
+ }), // Empty UTXO
164
+ ];
165
+ // For withdrawals, extAmount is negative (funds leaving the system)
166
+ const extAmount = -base_units;
167
+ const publicAmountForCircuit = new BN(extAmount)
168
+ .sub(new BN(fee_base_units))
169
+ .add(FIELD_SIZE)
170
+ .mod(FIELD_SIZE);
171
+ logger.debug(`Public amount calculation: (${extAmount} - ${fee_base_units} + FIELD_SIZE) % FIELD_SIZE = ${publicAmountForCircuit.toString()}`);
172
+ // Verify this matches the circuit balance equation: sumIns + publicAmount = sumOuts
173
+ const sumIns = inputs.reduce((sum, input) => sum.add(input.amount), new BN(0));
174
+ const sumOuts = outputs.reduce((sum, output) => sum.add(output.amount), new BN(0));
175
+ logger.debug(`Circuit balance check: sumIns(${sumIns.toString()}) + publicAmount(${publicAmountForCircuit.toString()}) should equal sumOuts(${sumOuts.toString()})`);
176
+ // Convert to circuit-compatible format
177
+ const publicAmountCircuitResult = sumIns
178
+ .add(publicAmountForCircuit)
179
+ .mod(FIELD_SIZE);
180
+ logger.debug(`Balance verification: ${sumIns.toString()} + ${publicAmountForCircuit.toString()} (mod FIELD_SIZE) = ${publicAmountCircuitResult.toString()}`);
181
+ logger.debug(`Expected sum of outputs: ${sumOuts.toString()}`);
182
+ logger.debug(`Balance equation satisfied: ${publicAmountCircuitResult.eq(sumOuts)}`);
183
+ // Generate nullifiers and commitments
184
+ const inputNullifiers = await Promise.all(inputs.map((x) => x.getNullifier()));
185
+ const outputCommitments = await Promise.all(outputs.map((x) => x.getCommitment()));
186
+ // Save original commitment and nullifier values for verification
187
+ logger.debug("\n=== UTXO VALIDATION ===");
188
+ logger.debug("Output 0 Commitment:", outputCommitments[0]);
189
+ logger.debug("Output 1 Commitment:", outputCommitments[1]);
190
+ // Encrypt the UTXO data using a compact format that includes the keypair
191
+ logger.debug("\nEncrypting UTXOs with keypair data...");
192
+ const encryptedOutput1 = encryptionService.encryptUtxo(outputs[0]);
193
+ const encryptedOutput2 = encryptionService.encryptUtxo(outputs[1]);
194
+ logger.debug(`\nOutput[0] (change):`);
195
+ await outputs[0].log();
196
+ logger.debug(`\nOutput[1] (empty):`);
197
+ await outputs[1].log();
198
+ logger.debug(`Encrypted output 1: ${encryptedOutput1.toString("hex")}`);
199
+ logger.debug(`Encrypted output 2: ${encryptedOutput2.toString("hex")}`);
200
+ logger.debug(`\nEncrypted output 1 size: ${encryptedOutput1.length} bytes`);
201
+ logger.debug(`Encrypted output 2 size: ${encryptedOutput2.length} bytes`);
202
+ logger.debug(`Total encrypted outputs size: ${encryptedOutput1.length + encryptedOutput2.length} bytes`);
203
+ // Test decryption to verify commitment values match
204
+ logger.debug("\n=== TESTING DECRYPTION ===");
205
+ logger.debug("Decrypting output 1 to verify commitment matches...");
206
+ const decryptedUtxo1 = await encryptionService.decryptUtxo(encryptedOutput1, lightWasm);
207
+ if (decryptedUtxo1) {
208
+ const decryptedCommitment1 = await decryptedUtxo1.getCommitment();
209
+ logger.debug("Original commitment:", outputCommitments[0]);
210
+ logger.debug("Decrypted commitment:", decryptedCommitment1);
211
+ logger.debug("Commitment matches:", outputCommitments[0] === decryptedCommitment1);
212
+ }
213
+ // Create the withdrawal ExtData with real encrypted outputs
214
+ const extData = {
215
+ // it can be any address
216
+ recipient: recipient_ata,
217
+ extAmount: new BN(extAmount),
218
+ encryptedOutput1: encryptedOutput1,
219
+ encryptedOutput2: encryptedOutput2,
220
+ fee: new BN(fee_base_units),
221
+ feeRecipient: feeRecipientTokenAccount,
222
+ mintAddress: token.pubkey.toString(),
223
+ };
224
+ // Calculate the extDataHash with the encrypted outputs
225
+ const calculatedExtDataHash = getExtDataHash(extData);
226
+ // Create the input for the proof generation
227
+ const input = {
228
+ // Common transaction data
229
+ root: root,
230
+ mintAddress: getMintAddressField(token.pubkey), // new mint address
231
+ publicAmount: publicAmountForCircuit.toString(), // Use proper field arithmetic result
232
+ extDataHash: calculatedExtDataHash,
233
+ // Input UTXO data (UTXOs being spent) - ensure all values are in decimal format
234
+ inAmount: inputs.map((x) => x.amount.toString(10)),
235
+ inPrivateKey: inputs.map((x) => x.keypair.privkey),
236
+ inBlinding: inputs.map((x) => x.blinding.toString(10)),
237
+ inPathIndices: inputMerklePathIndices,
238
+ inPathElements: inputMerklePathElements,
239
+ inputNullifier: inputNullifiers, // Use resolved values instead of Promise objects
240
+ // Output UTXO data (UTXOs being created) - ensure all values are in decimal format
241
+ outAmount: outputs.map((x) => x.amount.toString(10)),
242
+ outBlinding: outputs.map((x) => x.blinding.toString(10)),
243
+ outPubkey: outputs.map((x) => x.pubkey),
244
+ outputCommitment: outputCommitments,
245
+ };
246
+ logger.info("generating ZK proof...");
247
+ // Generate the zero-knowledge proof
248
+ const { proof, publicSignals } = await prove(input, keyBasePath);
249
+ // Parse the proof and public signals into byte arrays
250
+ const proofInBytes = parseProofToBytesArray(proof);
251
+ const inputsInBytes = parseToBytesArray(publicSignals);
252
+ // Create the proof object to submit to the program
253
+ const proofToSubmit = {
254
+ proofA: proofInBytes.proofA,
255
+ proofB: proofInBytes.proofB.flat(),
256
+ proofC: proofInBytes.proofC,
257
+ root: inputsInBytes[0],
258
+ publicAmount: inputsInBytes[1],
259
+ extDataHash: inputsInBytes[2],
260
+ inputNullifiers: [inputsInBytes[3], inputsInBytes[4]],
261
+ outputCommitments: [inputsInBytes[5], inputsInBytes[6]],
262
+ };
263
+ // Find PDAs for nullifiers and commitments
264
+ const { nullifier0PDA, nullifier1PDA } = findNullifierPDAs(proofToSubmit);
265
+ const { nullifier2PDA, nullifier3PDA } = findCrossCheckNullifierPDAs(proofToSubmit);
266
+ // Serialize the proof and extData
267
+ const serializedProof = serializeProofAndExtData(proofToSubmit, extData, true);
268
+ logger.debug(`Total instruction data size: ${serializedProof.length} bytes`);
269
+ const [globalConfigPda, globalConfigPdaBump] = await PublicKey.findProgramAddressSync([Buffer.from("global_config")], PROGRAM_ID);
270
+ const treeAta = getAssociatedTokenAddressSync(token.pubkey, globalConfigPda, true);
271
+ // Prepare withdraw parameters for indexer backend
272
+ const withdrawParams = {
273
+ serializedProof: serializedProof.toString("base64"),
274
+ treeAccount: treeAccount.toString(),
275
+ nullifier0PDA: nullifier0PDA.toString(),
276
+ nullifier1PDA: nullifier1PDA.toString(),
277
+ nullifier2PDA: nullifier2PDA.toString(),
278
+ nullifier3PDA: nullifier3PDA.toString(),
279
+ treeTokenAccount: treeTokenAccount.toString(),
280
+ globalConfigAccount: globalConfigAccount.toString(),
281
+ recipient: recipient.toString(),
282
+ feeRecipientAccount: FEE_RECIPIENT.toString(),
283
+ extAmount: extAmount,
284
+ fee: fee_base_units,
285
+ lookupTableAddress: ALT_ADDRESS.toString(),
286
+ senderAddress: publicKey.toString(),
287
+ treeAta: treeAta.toString(),
288
+ recipientAta: recipient_ata.toString(),
289
+ mintAddress: token.pubkey.toString(),
290
+ feeRecipientTokenAccount: feeRecipientTokenAccount.toString(),
291
+ referralWalletAddress: referrer,
292
+ };
293
+ logger.debug("Prepared withdraw parameters for indexer backend");
294
+ // Submit to indexer backend instead of directly to Solana
295
+ logger.info("submitting transaction to relayer...");
296
+ const signature = await submitWithdrawToIndexer(withdrawParams);
297
+ // Wait a moment for the transaction to be confirmed
298
+ logger.info("waiting for transaction confirmation...");
299
+ let retryTimes = 0;
300
+ let itv = 2;
301
+ const encryptedOutputStr = Buffer.from(encryptedOutput1).toString("hex");
302
+ let start = Date.now();
303
+ while (true) {
304
+ logger.info("Confirming transaction..");
305
+ logger.debug(`retryTimes: ${retryTimes}`);
306
+ await new Promise((resolve) => setTimeout(resolve, itv * 1000));
307
+ logger.info("Fetching updated tree state...");
308
+ let res = await fetch(RELAYER_API_URL +
309
+ "/utxos/check/" +
310
+ encryptedOutputStr +
311
+ "?token=" +
312
+ token.name);
313
+ let resJson = await res.json();
314
+ logger.debug("resJson:", resJson);
315
+ if (resJson.exists) {
316
+ return {
317
+ isPartial,
318
+ tx: signature,
319
+ recipient: recipient.toString(),
320
+ base_units,
321
+ fee_base_units,
322
+ };
323
+ }
324
+ if (retryTimes >= 10) {
325
+ throw new Error("Refresh the page to see latest balance.");
326
+ }
327
+ retryTimes++;
328
+ }
329
+ }
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@velumdotcash/sdk",
3
+ "version": "2.0.0",
4
+ "description": "TypeScript SDK for private payments on Solana using Zero-Knowledge proofs",
5
+ "main": "dist/index.js",
6
+ "exports": {
7
+ ".": "./dist/index.js",
8
+ "./utils": "./dist/exportUtils.js"
9
+ },
10
+ "types": "dist/index.d.ts",
11
+ "type": "module",
12
+ "sideEffects": false,
13
+ "files": ["dist", "README.md", "LICENSE"],
14
+ "scripts": {
15
+ "build": "tsc",
16
+ "prepublishOnly": "npm run build",
17
+ "test": "vitest run --exclude \"**/__tests__/e2e.test.ts\" --exclude \"**/__tests__/e2espl.test.ts\" --exclude \"**/test_paylink_logic.test.ts\"",
18
+ "teste2e": "vitest run e2e.test.ts",
19
+ "teste2espl": "vitest run e2espl.test.ts"
20
+ },
21
+ "keywords": ["solana", "privacy", "zk-proofs", "payments", "sdk"],
22
+ "author": "Velum",
23
+ "license": "MIT",
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "engines": {
28
+ "node": ">=18"
29
+ },
30
+ "dependencies": {
31
+ "@coral-xyz/anchor": "^0.31.1",
32
+ "@ethersproject/keccak256": "^5.8.0",
33
+ "@ethersproject/sha2": "^5.8.0",
34
+ "@lightprotocol/hasher.rs": "^0.2.1",
35
+ "@noble/ciphers": "^1.2.1",
36
+ "@noble/hashes": "^1.8.0",
37
+ "@solana/spl-token": "^0.4.14",
38
+ "@solana/web3.js": "^1.98.4",
39
+ "@types/bn.js": "^5.2.0",
40
+ "@types/snarkjs": "^0.7.9",
41
+ "bn.js": "^5.2.2",
42
+ "borsh": "^2.0.0",
43
+ "bs58": "^6.0.0",
44
+ "dotenv": "^17.2.2",
45
+ "ethers": "^6.15.0",
46
+ "ffjavascript": "^0.3.1",
47
+ "snarkjs": "^0.7.5",
48
+ "tmp-promise": "^3.0.3",
49
+ "tweetnacl": "^1.0.3"
50
+ },
51
+ "devDependencies": {
52
+ "@types/bn.js": "^5.1.5",
53
+ "@types/node": "^24.3.0",
54
+ "@types/snarkjs": "^0.7.9",
55
+ "@types/tmp": "^0.2.6",
56
+ "typescript": "^5.9.2",
57
+ "vitest": "^3.2.4"
58
+ }
59
+ }