@izi-noir/sdk 0.1.9 → 0.1.10

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/dist/index.cjs CHANGED
@@ -392,6 +392,7 @@ authors = [""]
392
392
  circuit.verifyingKey = setupResult.verifying_key;
393
393
  circuit.verifyingKeyGnark = setupResult.verifying_key_gnark;
394
394
  }
395
+ const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
395
396
  console.log("=== ARKWORKS PROVE DEBUG ===");
396
397
  console.log("Witness JSON:", witnessJson);
397
398
  console.log("R1CS JSON:", circuit.r1csJson);
@@ -400,7 +401,7 @@ authors = [""]
400
401
  console.log("Proof gnark base64 length:", proofResult.proof_gnark.length);
401
402
  const proofBytes = base64ToUint8Array(proofResult.proof_gnark);
402
403
  console.log("Proof bytes length:", proofBytes.length);
403
- console.log("Proof bytes hex:", Buffer.from(proofBytes).toString("hex"));
404
+ console.log("Proof bytes hex:", toHex(proofBytes));
404
405
  console.log("============================");
405
406
  return {
406
407
  proof: proofBytes,
@@ -1416,14 +1417,15 @@ var IziNoir = class _IziNoir {
1416
1417
  const connection = new Connection(networkConfig.rpcUrl, "confirmed");
1417
1418
  const vkKeypair = Keypair.generate();
1418
1419
  const authority = wallet.publicKey;
1420
+ const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
1419
1421
  console.log("=== DEPLOY VK DEBUG ===");
1420
1422
  console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
1421
1423
  console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
1422
- console.log("VK bytes (first 64 - alpha_g1):", import_buffer.Buffer.from(proofData.verifyingKey.bytes.slice(0, 64)).toString("hex"));
1423
- console.log("VK bytes (64-192 - beta_g2):", import_buffer.Buffer.from(proofData.verifyingKey.bytes.slice(64, 192)).toString("hex"));
1424
- console.log("VK bytes (192-320 - gamma_g2):", import_buffer.Buffer.from(proofData.verifyingKey.bytes.slice(192, 320)).toString("hex"));
1425
- console.log("VK bytes (320-448 - delta_g2):", import_buffer.Buffer.from(proofData.verifyingKey.bytes.slice(320, 448)).toString("hex"));
1426
- console.log("VK bytes (448+ - k elements):", import_buffer.Buffer.from(proofData.verifyingKey.bytes.slice(448)).toString("hex"));
1424
+ console.log("VK bytes (first 64 - alpha_g1):", toHex(proofData.verifyingKey.bytes.slice(0, 64)));
1425
+ console.log("VK bytes (64-192 - beta_g2):", toHex(proofData.verifyingKey.bytes.slice(64, 192)));
1426
+ console.log("VK bytes (192-320 - gamma_g2):", toHex(proofData.verifyingKey.bytes.slice(192, 320)));
1427
+ console.log("VK bytes (320-448 - delta_g2):", toHex(proofData.verifyingKey.bytes.slice(320, 448)));
1428
+ console.log("VK bytes (448+ - k elements):", toHex(proofData.verifyingKey.bytes.slice(448)));
1427
1429
  console.log("=======================");
1428
1430
  const builder = new SolanaTransactionBuilder({
1429
1431
  programId: networkConfig.programId,
@@ -1515,16 +1517,17 @@ var IziNoir = class _IziNoir {
1515
1517
  `VK account ${vk} has invalid data (${accountInfo.data.length} bytes). Expected at least 8 bytes for a valid account.`
1516
1518
  );
1517
1519
  }
1520
+ const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
1518
1521
  console.log("=== VERIFY ON-CHAIN DEBUG ===");
1519
1522
  console.log("VK Account:", vk);
1520
1523
  console.log("VK Account data length:", accountInfo.data.length, "bytes");
1521
1524
  console.log("Proof size:", proofData.proof.bytes.length, "bytes");
1522
- console.log("Proof (first 64 bytes - A point):", import_buffer.Buffer.from(proofData.proof.bytes.slice(0, 64)).toString("hex"));
1523
- console.log("Proof (bytes 64-192 - B point):", import_buffer.Buffer.from(proofData.proof.bytes.slice(64, 192)).toString("hex"));
1524
- console.log("Proof (bytes 192-256 - C point):", import_buffer.Buffer.from(proofData.proof.bytes.slice(192, 256)).toString("hex"));
1525
+ console.log("Proof (first 64 bytes - A point):", toHex(proofData.proof.bytes.slice(0, 64)));
1526
+ console.log("Proof (bytes 64-192 - B point):", toHex(proofData.proof.bytes.slice(64, 192)));
1527
+ console.log("Proof (bytes 192-256 - C point):", toHex(proofData.proof.bytes.slice(192, 256)));
1525
1528
  console.log("Public inputs count:", proofData.publicInputs.bytes.length);
1526
1529
  proofData.publicInputs.bytes.forEach((input, i) => {
1527
- console.log(` Public input[${i}]:`, import_buffer.Buffer.from(input).toString("hex"));
1530
+ console.log(` Public input[${i}]:`, toHex(input));
1528
1531
  });
1529
1532
  console.log("Public inputs hex:", proofData.publicInputs.hex);
1530
1533
  console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
package/dist/index.js CHANGED
@@ -369,6 +369,7 @@ authors = [""]
369
369
  circuit.verifyingKey = setupResult.verifying_key;
370
370
  circuit.verifyingKeyGnark = setupResult.verifying_key_gnark;
371
371
  }
372
+ const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
372
373
  console.log("=== ARKWORKS PROVE DEBUG ===");
373
374
  console.log("Witness JSON:", witnessJson);
374
375
  console.log("R1CS JSON:", circuit.r1csJson);
@@ -377,7 +378,7 @@ authors = [""]
377
378
  console.log("Proof gnark base64 length:", proofResult.proof_gnark.length);
378
379
  const proofBytes = base64ToUint8Array(proofResult.proof_gnark);
379
380
  console.log("Proof bytes length:", proofBytes.length);
380
- console.log("Proof bytes hex:", Buffer.from(proofBytes).toString("hex"));
381
+ console.log("Proof bytes hex:", toHex(proofBytes));
381
382
  console.log("============================");
382
383
  return {
383
384
  proof: proofBytes,
@@ -1348,14 +1349,15 @@ var IziNoir = class _IziNoir {
1348
1349
  const connection = new Connection(networkConfig.rpcUrl, "confirmed");
1349
1350
  const vkKeypair = Keypair.generate();
1350
1351
  const authority = wallet.publicKey;
1352
+ const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
1351
1353
  console.log("=== DEPLOY VK DEBUG ===");
1352
1354
  console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
1353
1355
  console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
1354
- console.log("VK bytes (first 64 - alpha_g1):", Buffer2.from(proofData.verifyingKey.bytes.slice(0, 64)).toString("hex"));
1355
- console.log("VK bytes (64-192 - beta_g2):", Buffer2.from(proofData.verifyingKey.bytes.slice(64, 192)).toString("hex"));
1356
- console.log("VK bytes (192-320 - gamma_g2):", Buffer2.from(proofData.verifyingKey.bytes.slice(192, 320)).toString("hex"));
1357
- console.log("VK bytes (320-448 - delta_g2):", Buffer2.from(proofData.verifyingKey.bytes.slice(320, 448)).toString("hex"));
1358
- console.log("VK bytes (448+ - k elements):", Buffer2.from(proofData.verifyingKey.bytes.slice(448)).toString("hex"));
1356
+ console.log("VK bytes (first 64 - alpha_g1):", toHex(proofData.verifyingKey.bytes.slice(0, 64)));
1357
+ console.log("VK bytes (64-192 - beta_g2):", toHex(proofData.verifyingKey.bytes.slice(64, 192)));
1358
+ console.log("VK bytes (192-320 - gamma_g2):", toHex(proofData.verifyingKey.bytes.slice(192, 320)));
1359
+ console.log("VK bytes (320-448 - delta_g2):", toHex(proofData.verifyingKey.bytes.slice(320, 448)));
1360
+ console.log("VK bytes (448+ - k elements):", toHex(proofData.verifyingKey.bytes.slice(448)));
1359
1361
  console.log("=======================");
1360
1362
  const builder = new SolanaTransactionBuilder({
1361
1363
  programId: networkConfig.programId,
@@ -1447,16 +1449,17 @@ var IziNoir = class _IziNoir {
1447
1449
  `VK account ${vk} has invalid data (${accountInfo.data.length} bytes). Expected at least 8 bytes for a valid account.`
1448
1450
  );
1449
1451
  }
1452
+ const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
1450
1453
  console.log("=== VERIFY ON-CHAIN DEBUG ===");
1451
1454
  console.log("VK Account:", vk);
1452
1455
  console.log("VK Account data length:", accountInfo.data.length, "bytes");
1453
1456
  console.log("Proof size:", proofData.proof.bytes.length, "bytes");
1454
- console.log("Proof (first 64 bytes - A point):", Buffer2.from(proofData.proof.bytes.slice(0, 64)).toString("hex"));
1455
- console.log("Proof (bytes 64-192 - B point):", Buffer2.from(proofData.proof.bytes.slice(64, 192)).toString("hex"));
1456
- console.log("Proof (bytes 192-256 - C point):", Buffer2.from(proofData.proof.bytes.slice(192, 256)).toString("hex"));
1457
+ console.log("Proof (first 64 bytes - A point):", toHex(proofData.proof.bytes.slice(0, 64)));
1458
+ console.log("Proof (bytes 64-192 - B point):", toHex(proofData.proof.bytes.slice(64, 192)));
1459
+ console.log("Proof (bytes 192-256 - C point):", toHex(proofData.proof.bytes.slice(192, 256)));
1457
1460
  console.log("Public inputs count:", proofData.publicInputs.bytes.length);
1458
1461
  proofData.publicInputs.bytes.forEach((input, i) => {
1459
- console.log(` Public input[${i}]:`, Buffer2.from(input).toString("hex"));
1462
+ console.log(` Public input[${i}]:`, toHex(input));
1460
1463
  });
1461
1464
  console.log("Public inputs hex:", proofData.publicInputs.hex);
1462
1465
  console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
@@ -297,6 +297,7 @@ authors = [""]
297
297
  circuit.verifyingKey = setupResult.verifying_key;
298
298
  circuit.verifyingKeyGnark = setupResult.verifying_key_gnark;
299
299
  }
300
+ const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
300
301
  console.log("=== ARKWORKS PROVE DEBUG ===");
301
302
  console.log("Witness JSON:", witnessJson);
302
303
  console.log("R1CS JSON:", circuit.r1csJson);
@@ -305,7 +306,7 @@ authors = [""]
305
306
  console.log("Proof gnark base64 length:", proofResult.proof_gnark.length);
306
307
  const proofBytes = base64ToUint8Array(proofResult.proof_gnark);
307
308
  console.log("Proof bytes length:", proofBytes.length);
308
- console.log("Proof bytes hex:", Buffer.from(proofBytes).toString("hex"));
309
+ console.log("Proof bytes hex:", toHex(proofBytes));
309
310
  console.log("============================");
310
311
  return {
311
312
  proof: proofBytes,
@@ -1294,14 +1295,15 @@ var IziNoir = class _IziNoir {
1294
1295
  const connection = new Connection(networkConfig.rpcUrl, "confirmed");
1295
1296
  const vkKeypair = Keypair.generate();
1296
1297
  const authority = wallet.publicKey;
1298
+ const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
1297
1299
  console.log("=== DEPLOY VK DEBUG ===");
1298
1300
  console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
1299
1301
  console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
1300
- console.log("VK bytes (first 64 - alpha_g1):", import_buffer.Buffer.from(proofData.verifyingKey.bytes.slice(0, 64)).toString("hex"));
1301
- console.log("VK bytes (64-192 - beta_g2):", import_buffer.Buffer.from(proofData.verifyingKey.bytes.slice(64, 192)).toString("hex"));
1302
- console.log("VK bytes (192-320 - gamma_g2):", import_buffer.Buffer.from(proofData.verifyingKey.bytes.slice(192, 320)).toString("hex"));
1303
- console.log("VK bytes (320-448 - delta_g2):", import_buffer.Buffer.from(proofData.verifyingKey.bytes.slice(320, 448)).toString("hex"));
1304
- console.log("VK bytes (448+ - k elements):", import_buffer.Buffer.from(proofData.verifyingKey.bytes.slice(448)).toString("hex"));
1302
+ console.log("VK bytes (first 64 - alpha_g1):", toHex(proofData.verifyingKey.bytes.slice(0, 64)));
1303
+ console.log("VK bytes (64-192 - beta_g2):", toHex(proofData.verifyingKey.bytes.slice(64, 192)));
1304
+ console.log("VK bytes (192-320 - gamma_g2):", toHex(proofData.verifyingKey.bytes.slice(192, 320)));
1305
+ console.log("VK bytes (320-448 - delta_g2):", toHex(proofData.verifyingKey.bytes.slice(320, 448)));
1306
+ console.log("VK bytes (448+ - k elements):", toHex(proofData.verifyingKey.bytes.slice(448)));
1305
1307
  console.log("=======================");
1306
1308
  const builder = new SolanaTransactionBuilder({
1307
1309
  programId: networkConfig.programId,
@@ -1393,16 +1395,17 @@ var IziNoir = class _IziNoir {
1393
1395
  `VK account ${vk} has invalid data (${accountInfo.data.length} bytes). Expected at least 8 bytes for a valid account.`
1394
1396
  );
1395
1397
  }
1398
+ const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
1396
1399
  console.log("=== VERIFY ON-CHAIN DEBUG ===");
1397
1400
  console.log("VK Account:", vk);
1398
1401
  console.log("VK Account data length:", accountInfo.data.length, "bytes");
1399
1402
  console.log("Proof size:", proofData.proof.bytes.length, "bytes");
1400
- console.log("Proof (first 64 bytes - A point):", import_buffer.Buffer.from(proofData.proof.bytes.slice(0, 64)).toString("hex"));
1401
- console.log("Proof (bytes 64-192 - B point):", import_buffer.Buffer.from(proofData.proof.bytes.slice(64, 192)).toString("hex"));
1402
- console.log("Proof (bytes 192-256 - C point):", import_buffer.Buffer.from(proofData.proof.bytes.slice(192, 256)).toString("hex"));
1403
+ console.log("Proof (first 64 bytes - A point):", toHex(proofData.proof.bytes.slice(0, 64)));
1404
+ console.log("Proof (bytes 64-192 - B point):", toHex(proofData.proof.bytes.slice(64, 192)));
1405
+ console.log("Proof (bytes 192-256 - C point):", toHex(proofData.proof.bytes.slice(192, 256)));
1403
1406
  console.log("Public inputs count:", proofData.publicInputs.bytes.length);
1404
1407
  proofData.publicInputs.bytes.forEach((input, i) => {
1405
- console.log(` Public input[${i}]:`, import_buffer.Buffer.from(input).toString("hex"));
1408
+ console.log(` Public input[${i}]:`, toHex(input));
1406
1409
  });
1407
1410
  console.log("Public inputs hex:", proofData.publicInputs.hex);
1408
1411
  console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
@@ -274,6 +274,7 @@ authors = [""]
274
274
  circuit.verifyingKey = setupResult.verifying_key;
275
275
  circuit.verifyingKeyGnark = setupResult.verifying_key_gnark;
276
276
  }
277
+ const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
277
278
  console.log("=== ARKWORKS PROVE DEBUG ===");
278
279
  console.log("Witness JSON:", witnessJson);
279
280
  console.log("R1CS JSON:", circuit.r1csJson);
@@ -282,7 +283,7 @@ authors = [""]
282
283
  console.log("Proof gnark base64 length:", proofResult.proof_gnark.length);
283
284
  const proofBytes = base64ToUint8Array(proofResult.proof_gnark);
284
285
  console.log("Proof bytes length:", proofBytes.length);
285
- console.log("Proof bytes hex:", Buffer.from(proofBytes).toString("hex"));
286
+ console.log("Proof bytes hex:", toHex(proofBytes));
286
287
  console.log("============================");
287
288
  return {
288
289
  proof: proofBytes,
@@ -1261,14 +1262,15 @@ var IziNoir = class _IziNoir {
1261
1262
  const connection = new Connection(networkConfig.rpcUrl, "confirmed");
1262
1263
  const vkKeypair = Keypair.generate();
1263
1264
  const authority = wallet.publicKey;
1265
+ const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
1264
1266
  console.log("=== DEPLOY VK DEBUG ===");
1265
1267
  console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
1266
1268
  console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
1267
- console.log("VK bytes (first 64 - alpha_g1):", Buffer2.from(proofData.verifyingKey.bytes.slice(0, 64)).toString("hex"));
1268
- console.log("VK bytes (64-192 - beta_g2):", Buffer2.from(proofData.verifyingKey.bytes.slice(64, 192)).toString("hex"));
1269
- console.log("VK bytes (192-320 - gamma_g2):", Buffer2.from(proofData.verifyingKey.bytes.slice(192, 320)).toString("hex"));
1270
- console.log("VK bytes (320-448 - delta_g2):", Buffer2.from(proofData.verifyingKey.bytes.slice(320, 448)).toString("hex"));
1271
- console.log("VK bytes (448+ - k elements):", Buffer2.from(proofData.verifyingKey.bytes.slice(448)).toString("hex"));
1269
+ console.log("VK bytes (first 64 - alpha_g1):", toHex(proofData.verifyingKey.bytes.slice(0, 64)));
1270
+ console.log("VK bytes (64-192 - beta_g2):", toHex(proofData.verifyingKey.bytes.slice(64, 192)));
1271
+ console.log("VK bytes (192-320 - gamma_g2):", toHex(proofData.verifyingKey.bytes.slice(192, 320)));
1272
+ console.log("VK bytes (320-448 - delta_g2):", toHex(proofData.verifyingKey.bytes.slice(320, 448)));
1273
+ console.log("VK bytes (448+ - k elements):", toHex(proofData.verifyingKey.bytes.slice(448)));
1272
1274
  console.log("=======================");
1273
1275
  const builder = new SolanaTransactionBuilder({
1274
1276
  programId: networkConfig.programId,
@@ -1360,16 +1362,17 @@ var IziNoir = class _IziNoir {
1360
1362
  `VK account ${vk} has invalid data (${accountInfo.data.length} bytes). Expected at least 8 bytes for a valid account.`
1361
1363
  );
1362
1364
  }
1365
+ const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
1363
1366
  console.log("=== VERIFY ON-CHAIN DEBUG ===");
1364
1367
  console.log("VK Account:", vk);
1365
1368
  console.log("VK Account data length:", accountInfo.data.length, "bytes");
1366
1369
  console.log("Proof size:", proofData.proof.bytes.length, "bytes");
1367
- console.log("Proof (first 64 bytes - A point):", Buffer2.from(proofData.proof.bytes.slice(0, 64)).toString("hex"));
1368
- console.log("Proof (bytes 64-192 - B point):", Buffer2.from(proofData.proof.bytes.slice(64, 192)).toString("hex"));
1369
- console.log("Proof (bytes 192-256 - C point):", Buffer2.from(proofData.proof.bytes.slice(192, 256)).toString("hex"));
1370
+ console.log("Proof (first 64 bytes - A point):", toHex(proofData.proof.bytes.slice(0, 64)));
1371
+ console.log("Proof (bytes 64-192 - B point):", toHex(proofData.proof.bytes.slice(64, 192)));
1372
+ console.log("Proof (bytes 192-256 - C point):", toHex(proofData.proof.bytes.slice(192, 256)));
1370
1373
  console.log("Public inputs count:", proofData.publicInputs.bytes.length);
1371
1374
  proofData.publicInputs.bytes.forEach((input, i) => {
1372
- console.log(` Public input[${i}]:`, Buffer2.from(input).toString("hex"));
1375
+ console.log(` Public input[${i}]:`, toHex(input));
1373
1376
  });
1374
1377
  console.log("Public inputs hex:", proofData.publicInputs.hex);
1375
1378
  console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
@@ -392,6 +392,7 @@ authors = [""]
392
392
  circuit.verifyingKey = setupResult.verifying_key;
393
393
  circuit.verifyingKeyGnark = setupResult.verifying_key_gnark;
394
394
  }
395
+ const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
395
396
  console.log("=== ARKWORKS PROVE DEBUG ===");
396
397
  console.log("Witness JSON:", witnessJson);
397
398
  console.log("R1CS JSON:", circuit.r1csJson);
@@ -400,7 +401,7 @@ authors = [""]
400
401
  console.log("Proof gnark base64 length:", proofResult.proof_gnark.length);
401
402
  const proofBytes = base64ToUint8Array(proofResult.proof_gnark);
402
403
  console.log("Proof bytes length:", proofBytes.length);
403
- console.log("Proof bytes hex:", Buffer.from(proofBytes).toString("hex"));
404
+ console.log("Proof bytes hex:", toHex(proofBytes));
404
405
  console.log("============================");
405
406
  return {
406
407
  proof: proofBytes,
@@ -1293,14 +1294,15 @@ var IziNoir = class _IziNoir {
1293
1294
  const connection = new Connection(networkConfig.rpcUrl, "confirmed");
1294
1295
  const vkKeypair = Keypair.generate();
1295
1296
  const authority = wallet.publicKey;
1297
+ const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
1296
1298
  console.log("=== DEPLOY VK DEBUG ===");
1297
1299
  console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
1298
1300
  console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
1299
- console.log("VK bytes (first 64 - alpha_g1):", import_buffer.Buffer.from(proofData.verifyingKey.bytes.slice(0, 64)).toString("hex"));
1300
- console.log("VK bytes (64-192 - beta_g2):", import_buffer.Buffer.from(proofData.verifyingKey.bytes.slice(64, 192)).toString("hex"));
1301
- console.log("VK bytes (192-320 - gamma_g2):", import_buffer.Buffer.from(proofData.verifyingKey.bytes.slice(192, 320)).toString("hex"));
1302
- console.log("VK bytes (320-448 - delta_g2):", import_buffer.Buffer.from(proofData.verifyingKey.bytes.slice(320, 448)).toString("hex"));
1303
- console.log("VK bytes (448+ - k elements):", import_buffer.Buffer.from(proofData.verifyingKey.bytes.slice(448)).toString("hex"));
1301
+ console.log("VK bytes (first 64 - alpha_g1):", toHex(proofData.verifyingKey.bytes.slice(0, 64)));
1302
+ console.log("VK bytes (64-192 - beta_g2):", toHex(proofData.verifyingKey.bytes.slice(64, 192)));
1303
+ console.log("VK bytes (192-320 - gamma_g2):", toHex(proofData.verifyingKey.bytes.slice(192, 320)));
1304
+ console.log("VK bytes (320-448 - delta_g2):", toHex(proofData.verifyingKey.bytes.slice(320, 448)));
1305
+ console.log("VK bytes (448+ - k elements):", toHex(proofData.verifyingKey.bytes.slice(448)));
1304
1306
  console.log("=======================");
1305
1307
  const builder = new SolanaTransactionBuilder({
1306
1308
  programId: networkConfig.programId,
@@ -1392,16 +1394,17 @@ var IziNoir = class _IziNoir {
1392
1394
  `VK account ${vk} has invalid data (${accountInfo.data.length} bytes). Expected at least 8 bytes for a valid account.`
1393
1395
  );
1394
1396
  }
1397
+ const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
1395
1398
  console.log("=== VERIFY ON-CHAIN DEBUG ===");
1396
1399
  console.log("VK Account:", vk);
1397
1400
  console.log("VK Account data length:", accountInfo.data.length, "bytes");
1398
1401
  console.log("Proof size:", proofData.proof.bytes.length, "bytes");
1399
- console.log("Proof (first 64 bytes - A point):", import_buffer.Buffer.from(proofData.proof.bytes.slice(0, 64)).toString("hex"));
1400
- console.log("Proof (bytes 64-192 - B point):", import_buffer.Buffer.from(proofData.proof.bytes.slice(64, 192)).toString("hex"));
1401
- console.log("Proof (bytes 192-256 - C point):", import_buffer.Buffer.from(proofData.proof.bytes.slice(192, 256)).toString("hex"));
1402
+ console.log("Proof (first 64 bytes - A point):", toHex(proofData.proof.bytes.slice(0, 64)));
1403
+ console.log("Proof (bytes 64-192 - B point):", toHex(proofData.proof.bytes.slice(64, 192)));
1404
+ console.log("Proof (bytes 192-256 - C point):", toHex(proofData.proof.bytes.slice(192, 256)));
1402
1405
  console.log("Public inputs count:", proofData.publicInputs.bytes.length);
1403
1406
  proofData.publicInputs.bytes.forEach((input, i) => {
1404
- console.log(` Public input[${i}]:`, import_buffer.Buffer.from(input).toString("hex"));
1407
+ console.log(` Public input[${i}]:`, toHex(input));
1405
1408
  });
1406
1409
  console.log("Public inputs hex:", proofData.publicInputs.hex);
1407
1410
  console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
@@ -369,6 +369,7 @@ authors = [""]
369
369
  circuit.verifyingKey = setupResult.verifying_key;
370
370
  circuit.verifyingKeyGnark = setupResult.verifying_key_gnark;
371
371
  }
372
+ const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
372
373
  console.log("=== ARKWORKS PROVE DEBUG ===");
373
374
  console.log("Witness JSON:", witnessJson);
374
375
  console.log("R1CS JSON:", circuit.r1csJson);
@@ -377,7 +378,7 @@ authors = [""]
377
378
  console.log("Proof gnark base64 length:", proofResult.proof_gnark.length);
378
379
  const proofBytes = base64ToUint8Array(proofResult.proof_gnark);
379
380
  console.log("Proof bytes length:", proofBytes.length);
380
- console.log("Proof bytes hex:", Buffer.from(proofBytes).toString("hex"));
381
+ console.log("Proof bytes hex:", toHex(proofBytes));
381
382
  console.log("============================");
382
383
  return {
383
384
  proof: proofBytes,
@@ -1261,14 +1262,15 @@ var IziNoir = class _IziNoir {
1261
1262
  const connection = new Connection(networkConfig.rpcUrl, "confirmed");
1262
1263
  const vkKeypair = Keypair.generate();
1263
1264
  const authority = wallet.publicKey;
1265
+ const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
1264
1266
  console.log("=== DEPLOY VK DEBUG ===");
1265
1267
  console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
1266
1268
  console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
1267
- console.log("VK bytes (first 64 - alpha_g1):", Buffer2.from(proofData.verifyingKey.bytes.slice(0, 64)).toString("hex"));
1268
- console.log("VK bytes (64-192 - beta_g2):", Buffer2.from(proofData.verifyingKey.bytes.slice(64, 192)).toString("hex"));
1269
- console.log("VK bytes (192-320 - gamma_g2):", Buffer2.from(proofData.verifyingKey.bytes.slice(192, 320)).toString("hex"));
1270
- console.log("VK bytes (320-448 - delta_g2):", Buffer2.from(proofData.verifyingKey.bytes.slice(320, 448)).toString("hex"));
1271
- console.log("VK bytes (448+ - k elements):", Buffer2.from(proofData.verifyingKey.bytes.slice(448)).toString("hex"));
1269
+ console.log("VK bytes (first 64 - alpha_g1):", toHex(proofData.verifyingKey.bytes.slice(0, 64)));
1270
+ console.log("VK bytes (64-192 - beta_g2):", toHex(proofData.verifyingKey.bytes.slice(64, 192)));
1271
+ console.log("VK bytes (192-320 - gamma_g2):", toHex(proofData.verifyingKey.bytes.slice(192, 320)));
1272
+ console.log("VK bytes (320-448 - delta_g2):", toHex(proofData.verifyingKey.bytes.slice(320, 448)));
1273
+ console.log("VK bytes (448+ - k elements):", toHex(proofData.verifyingKey.bytes.slice(448)));
1272
1274
  console.log("=======================");
1273
1275
  const builder = new SolanaTransactionBuilder({
1274
1276
  programId: networkConfig.programId,
@@ -1360,16 +1362,17 @@ var IziNoir = class _IziNoir {
1360
1362
  `VK account ${vk} has invalid data (${accountInfo.data.length} bytes). Expected at least 8 bytes for a valid account.`
1361
1363
  );
1362
1364
  }
1365
+ const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
1363
1366
  console.log("=== VERIFY ON-CHAIN DEBUG ===");
1364
1367
  console.log("VK Account:", vk);
1365
1368
  console.log("VK Account data length:", accountInfo.data.length, "bytes");
1366
1369
  console.log("Proof size:", proofData.proof.bytes.length, "bytes");
1367
- console.log("Proof (first 64 bytes - A point):", Buffer2.from(proofData.proof.bytes.slice(0, 64)).toString("hex"));
1368
- console.log("Proof (bytes 64-192 - B point):", Buffer2.from(proofData.proof.bytes.slice(64, 192)).toString("hex"));
1369
- console.log("Proof (bytes 192-256 - C point):", Buffer2.from(proofData.proof.bytes.slice(192, 256)).toString("hex"));
1370
+ console.log("Proof (first 64 bytes - A point):", toHex(proofData.proof.bytes.slice(0, 64)));
1371
+ console.log("Proof (bytes 64-192 - B point):", toHex(proofData.proof.bytes.slice(64, 192)));
1372
+ console.log("Proof (bytes 192-256 - C point):", toHex(proofData.proof.bytes.slice(192, 256)));
1370
1373
  console.log("Public inputs count:", proofData.publicInputs.bytes.length);
1371
1374
  proofData.publicInputs.bytes.forEach((input, i) => {
1372
- console.log(` Public input[${i}]:`, Buffer2.from(input).toString("hex"));
1375
+ console.log(` Public input[${i}]:`, toHex(input));
1373
1376
  });
1374
1377
  console.log("Public inputs hex:", proofData.publicInputs.hex);
1375
1378
  console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@izi-noir/sdk",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Write ZK circuits in JavaScript/TypeScript, generate Noir code and proofs automatically",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",