@izi-noir/sdk 0.1.7 → 0.1.9
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 +32 -0
- package/dist/index.js +32 -0
- package/dist/providers/arkworks.cjs +32 -0
- package/dist/providers/arkworks.js +32 -0
- package/dist/providers/barretenberg.cjs +32 -0
- package/dist/providers/barretenberg.js +32 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -392,8 +392,16 @@ authors = [""]
|
|
|
392
392
|
circuit.verifyingKey = setupResult.verifying_key;
|
|
393
393
|
circuit.verifyingKeyGnark = setupResult.verifying_key_gnark;
|
|
394
394
|
}
|
|
395
|
+
console.log("=== ARKWORKS PROVE DEBUG ===");
|
|
396
|
+
console.log("Witness JSON:", witnessJson);
|
|
397
|
+
console.log("R1CS JSON:", circuit.r1csJson);
|
|
395
398
|
const proofResult = wasm.prove_from_r1cs(provingKey, circuit.r1csJson, witnessJson);
|
|
399
|
+
console.log("Proof result public_inputs:", proofResult.public_inputs);
|
|
400
|
+
console.log("Proof gnark base64 length:", proofResult.proof_gnark.length);
|
|
396
401
|
const proofBytes = base64ToUint8Array(proofResult.proof_gnark);
|
|
402
|
+
console.log("Proof bytes length:", proofBytes.length);
|
|
403
|
+
console.log("Proof bytes hex:", Buffer.from(proofBytes).toString("hex"));
|
|
404
|
+
console.log("============================");
|
|
397
405
|
return {
|
|
398
406
|
proof: proofBytes,
|
|
399
407
|
publicInputs: proofResult.public_inputs
|
|
@@ -1408,6 +1416,15 @@ var IziNoir = class _IziNoir {
|
|
|
1408
1416
|
const connection = new Connection(networkConfig.rpcUrl, "confirmed");
|
|
1409
1417
|
const vkKeypair = Keypair.generate();
|
|
1410
1418
|
const authority = wallet.publicKey;
|
|
1419
|
+
console.log("=== DEPLOY VK DEBUG ===");
|
|
1420
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1421
|
+
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"));
|
|
1427
|
+
console.log("=======================");
|
|
1411
1428
|
const builder = new SolanaTransactionBuilder({
|
|
1412
1429
|
programId: networkConfig.programId,
|
|
1413
1430
|
computeUnits: 4e5
|
|
@@ -1498,6 +1515,21 @@ var IziNoir = class _IziNoir {
|
|
|
1498
1515
|
`VK account ${vk} has invalid data (${accountInfo.data.length} bytes). Expected at least 8 bytes for a valid account.`
|
|
1499
1516
|
);
|
|
1500
1517
|
}
|
|
1518
|
+
console.log("=== VERIFY ON-CHAIN DEBUG ===");
|
|
1519
|
+
console.log("VK Account:", vk);
|
|
1520
|
+
console.log("VK Account data length:", accountInfo.data.length, "bytes");
|
|
1521
|
+
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("Public inputs count:", proofData.publicInputs.bytes.length);
|
|
1526
|
+
proofData.publicInputs.bytes.forEach((input, i) => {
|
|
1527
|
+
console.log(` Public input[${i}]:`, import_buffer.Buffer.from(input).toString("hex"));
|
|
1528
|
+
});
|
|
1529
|
+
console.log("Public inputs hex:", proofData.publicInputs.hex);
|
|
1530
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1531
|
+
console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
|
|
1532
|
+
console.log("=============================");
|
|
1501
1533
|
const builder = new SolanaTransactionBuilder({
|
|
1502
1534
|
programId: networkConfig.programId,
|
|
1503
1535
|
computeUnits: 4e5
|
package/dist/index.js
CHANGED
|
@@ -369,8 +369,16 @@ authors = [""]
|
|
|
369
369
|
circuit.verifyingKey = setupResult.verifying_key;
|
|
370
370
|
circuit.verifyingKeyGnark = setupResult.verifying_key_gnark;
|
|
371
371
|
}
|
|
372
|
+
console.log("=== ARKWORKS PROVE DEBUG ===");
|
|
373
|
+
console.log("Witness JSON:", witnessJson);
|
|
374
|
+
console.log("R1CS JSON:", circuit.r1csJson);
|
|
372
375
|
const proofResult = wasm.prove_from_r1cs(provingKey, circuit.r1csJson, witnessJson);
|
|
376
|
+
console.log("Proof result public_inputs:", proofResult.public_inputs);
|
|
377
|
+
console.log("Proof gnark base64 length:", proofResult.proof_gnark.length);
|
|
373
378
|
const proofBytes = base64ToUint8Array(proofResult.proof_gnark);
|
|
379
|
+
console.log("Proof bytes length:", proofBytes.length);
|
|
380
|
+
console.log("Proof bytes hex:", Buffer.from(proofBytes).toString("hex"));
|
|
381
|
+
console.log("============================");
|
|
374
382
|
return {
|
|
375
383
|
proof: proofBytes,
|
|
376
384
|
publicInputs: proofResult.public_inputs
|
|
@@ -1340,6 +1348,15 @@ var IziNoir = class _IziNoir {
|
|
|
1340
1348
|
const connection = new Connection(networkConfig.rpcUrl, "confirmed");
|
|
1341
1349
|
const vkKeypair = Keypair.generate();
|
|
1342
1350
|
const authority = wallet.publicKey;
|
|
1351
|
+
console.log("=== DEPLOY VK DEBUG ===");
|
|
1352
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1353
|
+
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"));
|
|
1359
|
+
console.log("=======================");
|
|
1343
1360
|
const builder = new SolanaTransactionBuilder({
|
|
1344
1361
|
programId: networkConfig.programId,
|
|
1345
1362
|
computeUnits: 4e5
|
|
@@ -1430,6 +1447,21 @@ var IziNoir = class _IziNoir {
|
|
|
1430
1447
|
`VK account ${vk} has invalid data (${accountInfo.data.length} bytes). Expected at least 8 bytes for a valid account.`
|
|
1431
1448
|
);
|
|
1432
1449
|
}
|
|
1450
|
+
console.log("=== VERIFY ON-CHAIN DEBUG ===");
|
|
1451
|
+
console.log("VK Account:", vk);
|
|
1452
|
+
console.log("VK Account data length:", accountInfo.data.length, "bytes");
|
|
1453
|
+
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("Public inputs count:", proofData.publicInputs.bytes.length);
|
|
1458
|
+
proofData.publicInputs.bytes.forEach((input, i) => {
|
|
1459
|
+
console.log(` Public input[${i}]:`, Buffer2.from(input).toString("hex"));
|
|
1460
|
+
});
|
|
1461
|
+
console.log("Public inputs hex:", proofData.publicInputs.hex);
|
|
1462
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1463
|
+
console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
|
|
1464
|
+
console.log("=============================");
|
|
1433
1465
|
const builder = new SolanaTransactionBuilder({
|
|
1434
1466
|
programId: networkConfig.programId,
|
|
1435
1467
|
computeUnits: 4e5
|
|
@@ -297,8 +297,16 @@ authors = [""]
|
|
|
297
297
|
circuit.verifyingKey = setupResult.verifying_key;
|
|
298
298
|
circuit.verifyingKeyGnark = setupResult.verifying_key_gnark;
|
|
299
299
|
}
|
|
300
|
+
console.log("=== ARKWORKS PROVE DEBUG ===");
|
|
301
|
+
console.log("Witness JSON:", witnessJson);
|
|
302
|
+
console.log("R1CS JSON:", circuit.r1csJson);
|
|
300
303
|
const proofResult = wasm.prove_from_r1cs(provingKey, circuit.r1csJson, witnessJson);
|
|
304
|
+
console.log("Proof result public_inputs:", proofResult.public_inputs);
|
|
305
|
+
console.log("Proof gnark base64 length:", proofResult.proof_gnark.length);
|
|
301
306
|
const proofBytes = base64ToUint8Array(proofResult.proof_gnark);
|
|
307
|
+
console.log("Proof bytes length:", proofBytes.length);
|
|
308
|
+
console.log("Proof bytes hex:", Buffer.from(proofBytes).toString("hex"));
|
|
309
|
+
console.log("============================");
|
|
302
310
|
return {
|
|
303
311
|
proof: proofBytes,
|
|
304
312
|
publicInputs: proofResult.public_inputs
|
|
@@ -1286,6 +1294,15 @@ var IziNoir = class _IziNoir {
|
|
|
1286
1294
|
const connection = new Connection(networkConfig.rpcUrl, "confirmed");
|
|
1287
1295
|
const vkKeypair = Keypair.generate();
|
|
1288
1296
|
const authority = wallet.publicKey;
|
|
1297
|
+
console.log("=== DEPLOY VK DEBUG ===");
|
|
1298
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1299
|
+
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"));
|
|
1305
|
+
console.log("=======================");
|
|
1289
1306
|
const builder = new SolanaTransactionBuilder({
|
|
1290
1307
|
programId: networkConfig.programId,
|
|
1291
1308
|
computeUnits: 4e5
|
|
@@ -1376,6 +1393,21 @@ var IziNoir = class _IziNoir {
|
|
|
1376
1393
|
`VK account ${vk} has invalid data (${accountInfo.data.length} bytes). Expected at least 8 bytes for a valid account.`
|
|
1377
1394
|
);
|
|
1378
1395
|
}
|
|
1396
|
+
console.log("=== VERIFY ON-CHAIN DEBUG ===");
|
|
1397
|
+
console.log("VK Account:", vk);
|
|
1398
|
+
console.log("VK Account data length:", accountInfo.data.length, "bytes");
|
|
1399
|
+
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("Public inputs count:", proofData.publicInputs.bytes.length);
|
|
1404
|
+
proofData.publicInputs.bytes.forEach((input, i) => {
|
|
1405
|
+
console.log(` Public input[${i}]:`, import_buffer.Buffer.from(input).toString("hex"));
|
|
1406
|
+
});
|
|
1407
|
+
console.log("Public inputs hex:", proofData.publicInputs.hex);
|
|
1408
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1409
|
+
console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
|
|
1410
|
+
console.log("=============================");
|
|
1379
1411
|
const builder = new SolanaTransactionBuilder({
|
|
1380
1412
|
programId: networkConfig.programId,
|
|
1381
1413
|
computeUnits: 4e5
|
|
@@ -274,8 +274,16 @@ authors = [""]
|
|
|
274
274
|
circuit.verifyingKey = setupResult.verifying_key;
|
|
275
275
|
circuit.verifyingKeyGnark = setupResult.verifying_key_gnark;
|
|
276
276
|
}
|
|
277
|
+
console.log("=== ARKWORKS PROVE DEBUG ===");
|
|
278
|
+
console.log("Witness JSON:", witnessJson);
|
|
279
|
+
console.log("R1CS JSON:", circuit.r1csJson);
|
|
277
280
|
const proofResult = wasm.prove_from_r1cs(provingKey, circuit.r1csJson, witnessJson);
|
|
281
|
+
console.log("Proof result public_inputs:", proofResult.public_inputs);
|
|
282
|
+
console.log("Proof gnark base64 length:", proofResult.proof_gnark.length);
|
|
278
283
|
const proofBytes = base64ToUint8Array(proofResult.proof_gnark);
|
|
284
|
+
console.log("Proof bytes length:", proofBytes.length);
|
|
285
|
+
console.log("Proof bytes hex:", Buffer.from(proofBytes).toString("hex"));
|
|
286
|
+
console.log("============================");
|
|
279
287
|
return {
|
|
280
288
|
proof: proofBytes,
|
|
281
289
|
publicInputs: proofResult.public_inputs
|
|
@@ -1253,6 +1261,15 @@ var IziNoir = class _IziNoir {
|
|
|
1253
1261
|
const connection = new Connection(networkConfig.rpcUrl, "confirmed");
|
|
1254
1262
|
const vkKeypair = Keypair.generate();
|
|
1255
1263
|
const authority = wallet.publicKey;
|
|
1264
|
+
console.log("=== DEPLOY VK DEBUG ===");
|
|
1265
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1266
|
+
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"));
|
|
1272
|
+
console.log("=======================");
|
|
1256
1273
|
const builder = new SolanaTransactionBuilder({
|
|
1257
1274
|
programId: networkConfig.programId,
|
|
1258
1275
|
computeUnits: 4e5
|
|
@@ -1343,6 +1360,21 @@ var IziNoir = class _IziNoir {
|
|
|
1343
1360
|
`VK account ${vk} has invalid data (${accountInfo.data.length} bytes). Expected at least 8 bytes for a valid account.`
|
|
1344
1361
|
);
|
|
1345
1362
|
}
|
|
1363
|
+
console.log("=== VERIFY ON-CHAIN DEBUG ===");
|
|
1364
|
+
console.log("VK Account:", vk);
|
|
1365
|
+
console.log("VK Account data length:", accountInfo.data.length, "bytes");
|
|
1366
|
+
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("Public inputs count:", proofData.publicInputs.bytes.length);
|
|
1371
|
+
proofData.publicInputs.bytes.forEach((input, i) => {
|
|
1372
|
+
console.log(` Public input[${i}]:`, Buffer2.from(input).toString("hex"));
|
|
1373
|
+
});
|
|
1374
|
+
console.log("Public inputs hex:", proofData.publicInputs.hex);
|
|
1375
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1376
|
+
console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
|
|
1377
|
+
console.log("=============================");
|
|
1346
1378
|
const builder = new SolanaTransactionBuilder({
|
|
1347
1379
|
programId: networkConfig.programId,
|
|
1348
1380
|
computeUnits: 4e5
|
|
@@ -392,8 +392,16 @@ authors = [""]
|
|
|
392
392
|
circuit.verifyingKey = setupResult.verifying_key;
|
|
393
393
|
circuit.verifyingKeyGnark = setupResult.verifying_key_gnark;
|
|
394
394
|
}
|
|
395
|
+
console.log("=== ARKWORKS PROVE DEBUG ===");
|
|
396
|
+
console.log("Witness JSON:", witnessJson);
|
|
397
|
+
console.log("R1CS JSON:", circuit.r1csJson);
|
|
395
398
|
const proofResult = wasm.prove_from_r1cs(provingKey, circuit.r1csJson, witnessJson);
|
|
399
|
+
console.log("Proof result public_inputs:", proofResult.public_inputs);
|
|
400
|
+
console.log("Proof gnark base64 length:", proofResult.proof_gnark.length);
|
|
396
401
|
const proofBytes = base64ToUint8Array(proofResult.proof_gnark);
|
|
402
|
+
console.log("Proof bytes length:", proofBytes.length);
|
|
403
|
+
console.log("Proof bytes hex:", Buffer.from(proofBytes).toString("hex"));
|
|
404
|
+
console.log("============================");
|
|
397
405
|
return {
|
|
398
406
|
proof: proofBytes,
|
|
399
407
|
publicInputs: proofResult.public_inputs
|
|
@@ -1285,6 +1293,15 @@ var IziNoir = class _IziNoir {
|
|
|
1285
1293
|
const connection = new Connection(networkConfig.rpcUrl, "confirmed");
|
|
1286
1294
|
const vkKeypair = Keypair.generate();
|
|
1287
1295
|
const authority = wallet.publicKey;
|
|
1296
|
+
console.log("=== DEPLOY VK DEBUG ===");
|
|
1297
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1298
|
+
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"));
|
|
1304
|
+
console.log("=======================");
|
|
1288
1305
|
const builder = new SolanaTransactionBuilder({
|
|
1289
1306
|
programId: networkConfig.programId,
|
|
1290
1307
|
computeUnits: 4e5
|
|
@@ -1375,6 +1392,21 @@ var IziNoir = class _IziNoir {
|
|
|
1375
1392
|
`VK account ${vk} has invalid data (${accountInfo.data.length} bytes). Expected at least 8 bytes for a valid account.`
|
|
1376
1393
|
);
|
|
1377
1394
|
}
|
|
1395
|
+
console.log("=== VERIFY ON-CHAIN DEBUG ===");
|
|
1396
|
+
console.log("VK Account:", vk);
|
|
1397
|
+
console.log("VK Account data length:", accountInfo.data.length, "bytes");
|
|
1398
|
+
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("Public inputs count:", proofData.publicInputs.bytes.length);
|
|
1403
|
+
proofData.publicInputs.bytes.forEach((input, i) => {
|
|
1404
|
+
console.log(` Public input[${i}]:`, import_buffer.Buffer.from(input).toString("hex"));
|
|
1405
|
+
});
|
|
1406
|
+
console.log("Public inputs hex:", proofData.publicInputs.hex);
|
|
1407
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1408
|
+
console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
|
|
1409
|
+
console.log("=============================");
|
|
1378
1410
|
const builder = new SolanaTransactionBuilder({
|
|
1379
1411
|
programId: networkConfig.programId,
|
|
1380
1412
|
computeUnits: 4e5
|
|
@@ -369,8 +369,16 @@ authors = [""]
|
|
|
369
369
|
circuit.verifyingKey = setupResult.verifying_key;
|
|
370
370
|
circuit.verifyingKeyGnark = setupResult.verifying_key_gnark;
|
|
371
371
|
}
|
|
372
|
+
console.log("=== ARKWORKS PROVE DEBUG ===");
|
|
373
|
+
console.log("Witness JSON:", witnessJson);
|
|
374
|
+
console.log("R1CS JSON:", circuit.r1csJson);
|
|
372
375
|
const proofResult = wasm.prove_from_r1cs(provingKey, circuit.r1csJson, witnessJson);
|
|
376
|
+
console.log("Proof result public_inputs:", proofResult.public_inputs);
|
|
377
|
+
console.log("Proof gnark base64 length:", proofResult.proof_gnark.length);
|
|
373
378
|
const proofBytes = base64ToUint8Array(proofResult.proof_gnark);
|
|
379
|
+
console.log("Proof bytes length:", proofBytes.length);
|
|
380
|
+
console.log("Proof bytes hex:", Buffer.from(proofBytes).toString("hex"));
|
|
381
|
+
console.log("============================");
|
|
374
382
|
return {
|
|
375
383
|
proof: proofBytes,
|
|
376
384
|
publicInputs: proofResult.public_inputs
|
|
@@ -1253,6 +1261,15 @@ var IziNoir = class _IziNoir {
|
|
|
1253
1261
|
const connection = new Connection(networkConfig.rpcUrl, "confirmed");
|
|
1254
1262
|
const vkKeypair = Keypair.generate();
|
|
1255
1263
|
const authority = wallet.publicKey;
|
|
1264
|
+
console.log("=== DEPLOY VK DEBUG ===");
|
|
1265
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1266
|
+
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"));
|
|
1272
|
+
console.log("=======================");
|
|
1256
1273
|
const builder = new SolanaTransactionBuilder({
|
|
1257
1274
|
programId: networkConfig.programId,
|
|
1258
1275
|
computeUnits: 4e5
|
|
@@ -1343,6 +1360,21 @@ var IziNoir = class _IziNoir {
|
|
|
1343
1360
|
`VK account ${vk} has invalid data (${accountInfo.data.length} bytes). Expected at least 8 bytes for a valid account.`
|
|
1344
1361
|
);
|
|
1345
1362
|
}
|
|
1363
|
+
console.log("=== VERIFY ON-CHAIN DEBUG ===");
|
|
1364
|
+
console.log("VK Account:", vk);
|
|
1365
|
+
console.log("VK Account data length:", accountInfo.data.length, "bytes");
|
|
1366
|
+
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("Public inputs count:", proofData.publicInputs.bytes.length);
|
|
1371
|
+
proofData.publicInputs.bytes.forEach((input, i) => {
|
|
1372
|
+
console.log(` Public input[${i}]:`, Buffer2.from(input).toString("hex"));
|
|
1373
|
+
});
|
|
1374
|
+
console.log("Public inputs hex:", proofData.publicInputs.hex);
|
|
1375
|
+
console.log("VK nrPublicInputs:", proofData.verifyingKey.nrPublicInputs);
|
|
1376
|
+
console.log("VK bytes length:", proofData.verifyingKey.bytes.length);
|
|
1377
|
+
console.log("=============================");
|
|
1346
1378
|
const builder = new SolanaTransactionBuilder({
|
|
1347
1379
|
programId: networkConfig.programId,
|
|
1348
1380
|
computeUnits: 4e5
|