@izi-noir/sdk 0.1.8 → 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 +35 -0
- package/dist/index.js +35 -0
- package/dist/providers/arkworks.cjs +35 -0
- package/dist/providers/arkworks.js +35 -0
- package/dist/providers/barretenberg.cjs +35 -0
- package/dist/providers/barretenberg.js +35 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -392,8 +392,17 @@ 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("");
|
|
396
|
+
console.log("=== ARKWORKS PROVE DEBUG ===");
|
|
397
|
+
console.log("Witness JSON:", witnessJson);
|
|
398
|
+
console.log("R1CS JSON:", circuit.r1csJson);
|
|
395
399
|
const proofResult = wasm.prove_from_r1cs(provingKey, circuit.r1csJson, witnessJson);
|
|
400
|
+
console.log("Proof result public_inputs:", proofResult.public_inputs);
|
|
401
|
+
console.log("Proof gnark base64 length:", proofResult.proof_gnark.length);
|
|
396
402
|
const proofBytes = base64ToUint8Array(proofResult.proof_gnark);
|
|
403
|
+
console.log("Proof bytes length:", proofBytes.length);
|
|
404
|
+
console.log("Proof bytes hex:", toHex(proofBytes));
|
|
405
|
+
console.log("============================");
|
|
397
406
|
return {
|
|
398
407
|
proof: proofBytes,
|
|
399
408
|
publicInputs: proofResult.public_inputs
|
|
@@ -1408,6 +1417,16 @@ var IziNoir = class _IziNoir {
|
|
|
1408
1417
|
const connection = new Connection(networkConfig.rpcUrl, "confirmed");
|
|
1409
1418
|
const vkKeypair = Keypair.generate();
|
|
1410
1419
|
const authority = wallet.publicKey;
|
|
1420
|
+
const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1421
|
+
console.log("=== DEPLOY VK DEBUG ===");
|
|
1422
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1423
|
+
console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
|
|
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)));
|
|
1429
|
+
console.log("=======================");
|
|
1411
1430
|
const builder = new SolanaTransactionBuilder({
|
|
1412
1431
|
programId: networkConfig.programId,
|
|
1413
1432
|
computeUnits: 4e5
|
|
@@ -1498,6 +1517,22 @@ var IziNoir = class _IziNoir {
|
|
|
1498
1517
|
`VK account ${vk} has invalid data (${accountInfo.data.length} bytes). Expected at least 8 bytes for a valid account.`
|
|
1499
1518
|
);
|
|
1500
1519
|
}
|
|
1520
|
+
const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1521
|
+
console.log("=== VERIFY ON-CHAIN DEBUG ===");
|
|
1522
|
+
console.log("VK Account:", vk);
|
|
1523
|
+
console.log("VK Account data length:", accountInfo.data.length, "bytes");
|
|
1524
|
+
console.log("Proof size:", proofData.proof.bytes.length, "bytes");
|
|
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)));
|
|
1528
|
+
console.log("Public inputs count:", proofData.publicInputs.bytes.length);
|
|
1529
|
+
proofData.publicInputs.bytes.forEach((input, i) => {
|
|
1530
|
+
console.log(` Public input[${i}]:`, toHex(input));
|
|
1531
|
+
});
|
|
1532
|
+
console.log("Public inputs hex:", proofData.publicInputs.hex);
|
|
1533
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1534
|
+
console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
|
|
1535
|
+
console.log("=============================");
|
|
1501
1536
|
const builder = new SolanaTransactionBuilder({
|
|
1502
1537
|
programId: networkConfig.programId,
|
|
1503
1538
|
computeUnits: 4e5
|
package/dist/index.js
CHANGED
|
@@ -369,8 +369,17 @@ 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("");
|
|
373
|
+
console.log("=== ARKWORKS PROVE DEBUG ===");
|
|
374
|
+
console.log("Witness JSON:", witnessJson);
|
|
375
|
+
console.log("R1CS JSON:", circuit.r1csJson);
|
|
372
376
|
const proofResult = wasm.prove_from_r1cs(provingKey, circuit.r1csJson, witnessJson);
|
|
377
|
+
console.log("Proof result public_inputs:", proofResult.public_inputs);
|
|
378
|
+
console.log("Proof gnark base64 length:", proofResult.proof_gnark.length);
|
|
373
379
|
const proofBytes = base64ToUint8Array(proofResult.proof_gnark);
|
|
380
|
+
console.log("Proof bytes length:", proofBytes.length);
|
|
381
|
+
console.log("Proof bytes hex:", toHex(proofBytes));
|
|
382
|
+
console.log("============================");
|
|
374
383
|
return {
|
|
375
384
|
proof: proofBytes,
|
|
376
385
|
publicInputs: proofResult.public_inputs
|
|
@@ -1340,6 +1349,16 @@ var IziNoir = class _IziNoir {
|
|
|
1340
1349
|
const connection = new Connection(networkConfig.rpcUrl, "confirmed");
|
|
1341
1350
|
const vkKeypair = Keypair.generate();
|
|
1342
1351
|
const authority = wallet.publicKey;
|
|
1352
|
+
const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1353
|
+
console.log("=== DEPLOY VK DEBUG ===");
|
|
1354
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1355
|
+
console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
|
|
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)));
|
|
1361
|
+
console.log("=======================");
|
|
1343
1362
|
const builder = new SolanaTransactionBuilder({
|
|
1344
1363
|
programId: networkConfig.programId,
|
|
1345
1364
|
computeUnits: 4e5
|
|
@@ -1430,6 +1449,22 @@ var IziNoir = class _IziNoir {
|
|
|
1430
1449
|
`VK account ${vk} has invalid data (${accountInfo.data.length} bytes). Expected at least 8 bytes for a valid account.`
|
|
1431
1450
|
);
|
|
1432
1451
|
}
|
|
1452
|
+
const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1453
|
+
console.log("=== VERIFY ON-CHAIN DEBUG ===");
|
|
1454
|
+
console.log("VK Account:", vk);
|
|
1455
|
+
console.log("VK Account data length:", accountInfo.data.length, "bytes");
|
|
1456
|
+
console.log("Proof size:", proofData.proof.bytes.length, "bytes");
|
|
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)));
|
|
1460
|
+
console.log("Public inputs count:", proofData.publicInputs.bytes.length);
|
|
1461
|
+
proofData.publicInputs.bytes.forEach((input, i) => {
|
|
1462
|
+
console.log(` Public input[${i}]:`, toHex(input));
|
|
1463
|
+
});
|
|
1464
|
+
console.log("Public inputs hex:", proofData.publicInputs.hex);
|
|
1465
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1466
|
+
console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
|
|
1467
|
+
console.log("=============================");
|
|
1433
1468
|
const builder = new SolanaTransactionBuilder({
|
|
1434
1469
|
programId: networkConfig.programId,
|
|
1435
1470
|
computeUnits: 4e5
|
|
@@ -297,8 +297,17 @@ 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("");
|
|
301
|
+
console.log("=== ARKWORKS PROVE DEBUG ===");
|
|
302
|
+
console.log("Witness JSON:", witnessJson);
|
|
303
|
+
console.log("R1CS JSON:", circuit.r1csJson);
|
|
300
304
|
const proofResult = wasm.prove_from_r1cs(provingKey, circuit.r1csJson, witnessJson);
|
|
305
|
+
console.log("Proof result public_inputs:", proofResult.public_inputs);
|
|
306
|
+
console.log("Proof gnark base64 length:", proofResult.proof_gnark.length);
|
|
301
307
|
const proofBytes = base64ToUint8Array(proofResult.proof_gnark);
|
|
308
|
+
console.log("Proof bytes length:", proofBytes.length);
|
|
309
|
+
console.log("Proof bytes hex:", toHex(proofBytes));
|
|
310
|
+
console.log("============================");
|
|
302
311
|
return {
|
|
303
312
|
proof: proofBytes,
|
|
304
313
|
publicInputs: proofResult.public_inputs
|
|
@@ -1286,6 +1295,16 @@ var IziNoir = class _IziNoir {
|
|
|
1286
1295
|
const connection = new Connection(networkConfig.rpcUrl, "confirmed");
|
|
1287
1296
|
const vkKeypair = Keypair.generate();
|
|
1288
1297
|
const authority = wallet.publicKey;
|
|
1298
|
+
const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1299
|
+
console.log("=== DEPLOY VK DEBUG ===");
|
|
1300
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1301
|
+
console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
|
|
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)));
|
|
1307
|
+
console.log("=======================");
|
|
1289
1308
|
const builder = new SolanaTransactionBuilder({
|
|
1290
1309
|
programId: networkConfig.programId,
|
|
1291
1310
|
computeUnits: 4e5
|
|
@@ -1376,6 +1395,22 @@ var IziNoir = class _IziNoir {
|
|
|
1376
1395
|
`VK account ${vk} has invalid data (${accountInfo.data.length} bytes). Expected at least 8 bytes for a valid account.`
|
|
1377
1396
|
);
|
|
1378
1397
|
}
|
|
1398
|
+
const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1399
|
+
console.log("=== VERIFY ON-CHAIN DEBUG ===");
|
|
1400
|
+
console.log("VK Account:", vk);
|
|
1401
|
+
console.log("VK Account data length:", accountInfo.data.length, "bytes");
|
|
1402
|
+
console.log("Proof size:", proofData.proof.bytes.length, "bytes");
|
|
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)));
|
|
1406
|
+
console.log("Public inputs count:", proofData.publicInputs.bytes.length);
|
|
1407
|
+
proofData.publicInputs.bytes.forEach((input, i) => {
|
|
1408
|
+
console.log(` Public input[${i}]:`, toHex(input));
|
|
1409
|
+
});
|
|
1410
|
+
console.log("Public inputs hex:", proofData.publicInputs.hex);
|
|
1411
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1412
|
+
console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
|
|
1413
|
+
console.log("=============================");
|
|
1379
1414
|
const builder = new SolanaTransactionBuilder({
|
|
1380
1415
|
programId: networkConfig.programId,
|
|
1381
1416
|
computeUnits: 4e5
|
|
@@ -274,8 +274,17 @@ 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("");
|
|
278
|
+
console.log("=== ARKWORKS PROVE DEBUG ===");
|
|
279
|
+
console.log("Witness JSON:", witnessJson);
|
|
280
|
+
console.log("R1CS JSON:", circuit.r1csJson);
|
|
277
281
|
const proofResult = wasm.prove_from_r1cs(provingKey, circuit.r1csJson, witnessJson);
|
|
282
|
+
console.log("Proof result public_inputs:", proofResult.public_inputs);
|
|
283
|
+
console.log("Proof gnark base64 length:", proofResult.proof_gnark.length);
|
|
278
284
|
const proofBytes = base64ToUint8Array(proofResult.proof_gnark);
|
|
285
|
+
console.log("Proof bytes length:", proofBytes.length);
|
|
286
|
+
console.log("Proof bytes hex:", toHex(proofBytes));
|
|
287
|
+
console.log("============================");
|
|
279
288
|
return {
|
|
280
289
|
proof: proofBytes,
|
|
281
290
|
publicInputs: proofResult.public_inputs
|
|
@@ -1253,6 +1262,16 @@ var IziNoir = class _IziNoir {
|
|
|
1253
1262
|
const connection = new Connection(networkConfig.rpcUrl, "confirmed");
|
|
1254
1263
|
const vkKeypair = Keypair.generate();
|
|
1255
1264
|
const authority = wallet.publicKey;
|
|
1265
|
+
const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1266
|
+
console.log("=== DEPLOY VK DEBUG ===");
|
|
1267
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1268
|
+
console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
|
|
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)));
|
|
1274
|
+
console.log("=======================");
|
|
1256
1275
|
const builder = new SolanaTransactionBuilder({
|
|
1257
1276
|
programId: networkConfig.programId,
|
|
1258
1277
|
computeUnits: 4e5
|
|
@@ -1343,6 +1362,22 @@ var IziNoir = class _IziNoir {
|
|
|
1343
1362
|
`VK account ${vk} has invalid data (${accountInfo.data.length} bytes). Expected at least 8 bytes for a valid account.`
|
|
1344
1363
|
);
|
|
1345
1364
|
}
|
|
1365
|
+
const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1366
|
+
console.log("=== VERIFY ON-CHAIN DEBUG ===");
|
|
1367
|
+
console.log("VK Account:", vk);
|
|
1368
|
+
console.log("VK Account data length:", accountInfo.data.length, "bytes");
|
|
1369
|
+
console.log("Proof size:", proofData.proof.bytes.length, "bytes");
|
|
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)));
|
|
1373
|
+
console.log("Public inputs count:", proofData.publicInputs.bytes.length);
|
|
1374
|
+
proofData.publicInputs.bytes.forEach((input, i) => {
|
|
1375
|
+
console.log(` Public input[${i}]:`, toHex(input));
|
|
1376
|
+
});
|
|
1377
|
+
console.log("Public inputs hex:", proofData.publicInputs.hex);
|
|
1378
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1379
|
+
console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
|
|
1380
|
+
console.log("=============================");
|
|
1346
1381
|
const builder = new SolanaTransactionBuilder({
|
|
1347
1382
|
programId: networkConfig.programId,
|
|
1348
1383
|
computeUnits: 4e5
|
|
@@ -392,8 +392,17 @@ 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("");
|
|
396
|
+
console.log("=== ARKWORKS PROVE DEBUG ===");
|
|
397
|
+
console.log("Witness JSON:", witnessJson);
|
|
398
|
+
console.log("R1CS JSON:", circuit.r1csJson);
|
|
395
399
|
const proofResult = wasm.prove_from_r1cs(provingKey, circuit.r1csJson, witnessJson);
|
|
400
|
+
console.log("Proof result public_inputs:", proofResult.public_inputs);
|
|
401
|
+
console.log("Proof gnark base64 length:", proofResult.proof_gnark.length);
|
|
396
402
|
const proofBytes = base64ToUint8Array(proofResult.proof_gnark);
|
|
403
|
+
console.log("Proof bytes length:", proofBytes.length);
|
|
404
|
+
console.log("Proof bytes hex:", toHex(proofBytes));
|
|
405
|
+
console.log("============================");
|
|
397
406
|
return {
|
|
398
407
|
proof: proofBytes,
|
|
399
408
|
publicInputs: proofResult.public_inputs
|
|
@@ -1285,6 +1294,16 @@ var IziNoir = class _IziNoir {
|
|
|
1285
1294
|
const connection = new Connection(networkConfig.rpcUrl, "confirmed");
|
|
1286
1295
|
const vkKeypair = Keypair.generate();
|
|
1287
1296
|
const authority = wallet.publicKey;
|
|
1297
|
+
const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1298
|
+
console.log("=== DEPLOY VK DEBUG ===");
|
|
1299
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1300
|
+
console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
|
|
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)));
|
|
1306
|
+
console.log("=======================");
|
|
1288
1307
|
const builder = new SolanaTransactionBuilder({
|
|
1289
1308
|
programId: networkConfig.programId,
|
|
1290
1309
|
computeUnits: 4e5
|
|
@@ -1375,6 +1394,22 @@ var IziNoir = class _IziNoir {
|
|
|
1375
1394
|
`VK account ${vk} has invalid data (${accountInfo.data.length} bytes). Expected at least 8 bytes for a valid account.`
|
|
1376
1395
|
);
|
|
1377
1396
|
}
|
|
1397
|
+
const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1398
|
+
console.log("=== VERIFY ON-CHAIN DEBUG ===");
|
|
1399
|
+
console.log("VK Account:", vk);
|
|
1400
|
+
console.log("VK Account data length:", accountInfo.data.length, "bytes");
|
|
1401
|
+
console.log("Proof size:", proofData.proof.bytes.length, "bytes");
|
|
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)));
|
|
1405
|
+
console.log("Public inputs count:", proofData.publicInputs.bytes.length);
|
|
1406
|
+
proofData.publicInputs.bytes.forEach((input, i) => {
|
|
1407
|
+
console.log(` Public input[${i}]:`, toHex(input));
|
|
1408
|
+
});
|
|
1409
|
+
console.log("Public inputs hex:", proofData.publicInputs.hex);
|
|
1410
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1411
|
+
console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
|
|
1412
|
+
console.log("=============================");
|
|
1378
1413
|
const builder = new SolanaTransactionBuilder({
|
|
1379
1414
|
programId: networkConfig.programId,
|
|
1380
1415
|
computeUnits: 4e5
|
|
@@ -369,8 +369,17 @@ 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("");
|
|
373
|
+
console.log("=== ARKWORKS PROVE DEBUG ===");
|
|
374
|
+
console.log("Witness JSON:", witnessJson);
|
|
375
|
+
console.log("R1CS JSON:", circuit.r1csJson);
|
|
372
376
|
const proofResult = wasm.prove_from_r1cs(provingKey, circuit.r1csJson, witnessJson);
|
|
377
|
+
console.log("Proof result public_inputs:", proofResult.public_inputs);
|
|
378
|
+
console.log("Proof gnark base64 length:", proofResult.proof_gnark.length);
|
|
373
379
|
const proofBytes = base64ToUint8Array(proofResult.proof_gnark);
|
|
380
|
+
console.log("Proof bytes length:", proofBytes.length);
|
|
381
|
+
console.log("Proof bytes hex:", toHex(proofBytes));
|
|
382
|
+
console.log("============================");
|
|
374
383
|
return {
|
|
375
384
|
proof: proofBytes,
|
|
376
385
|
publicInputs: proofResult.public_inputs
|
|
@@ -1253,6 +1262,16 @@ var IziNoir = class _IziNoir {
|
|
|
1253
1262
|
const connection = new Connection(networkConfig.rpcUrl, "confirmed");
|
|
1254
1263
|
const vkKeypair = Keypair.generate();
|
|
1255
1264
|
const authority = wallet.publicKey;
|
|
1265
|
+
const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1266
|
+
console.log("=== DEPLOY VK DEBUG ===");
|
|
1267
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1268
|
+
console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
|
|
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)));
|
|
1274
|
+
console.log("=======================");
|
|
1256
1275
|
const builder = new SolanaTransactionBuilder({
|
|
1257
1276
|
programId: networkConfig.programId,
|
|
1258
1277
|
computeUnits: 4e5
|
|
@@ -1343,6 +1362,22 @@ var IziNoir = class _IziNoir {
|
|
|
1343
1362
|
`VK account ${vk} has invalid data (${accountInfo.data.length} bytes). Expected at least 8 bytes for a valid account.`
|
|
1344
1363
|
);
|
|
1345
1364
|
}
|
|
1365
|
+
const toHex = (arr) => Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1366
|
+
console.log("=== VERIFY ON-CHAIN DEBUG ===");
|
|
1367
|
+
console.log("VK Account:", vk);
|
|
1368
|
+
console.log("VK Account data length:", accountInfo.data.length, "bytes");
|
|
1369
|
+
console.log("Proof size:", proofData.proof.bytes.length, "bytes");
|
|
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)));
|
|
1373
|
+
console.log("Public inputs count:", proofData.publicInputs.bytes.length);
|
|
1374
|
+
proofData.publicInputs.bytes.forEach((input, i) => {
|
|
1375
|
+
console.log(` Public input[${i}]:`, toHex(input));
|
|
1376
|
+
});
|
|
1377
|
+
console.log("Public inputs hex:", proofData.publicInputs.hex);
|
|
1378
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1379
|
+
console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
|
|
1380
|
+
console.log("=============================");
|
|
1346
1381
|
const builder = new SolanaTransactionBuilder({
|
|
1347
1382
|
programId: networkConfig.programId,
|
|
1348
1383
|
computeUnits: 4e5
|