@aztec/bb.js 0.86.0-nightly.20250430 → 0.86.0-nightly.20250502
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/dest/browser/barretenberg-threads.js +1 -1
- package/dest/browser/barretenberg.js +1 -1
- package/dest/browser/index.js +1 -71
- package/dest/node/barretenberg/backend.d.ts +0 -40
- package/dest/node/barretenberg/backend.d.ts.map +1 -1
- package/dest/node/barretenberg/backend.js +2 -91
- package/dest/node/barretenberg/index.d.ts +1 -1
- package/dest/node/barretenberg/index.d.ts.map +1 -1
- package/dest/node/barretenberg/index.js +2 -2
- package/dest/node/barretenberg_wasm/barretenberg-threads.wasm.gz +0 -0
- package/dest/node/index.d.ts +1 -1
- package/dest/node/index.d.ts.map +1 -1
- package/dest/node/index.js +2 -2
- package/dest/node/main.d.ts.map +1 -1
- package/dest/node/main.js +21 -43
- package/dest/node-cjs/barretenberg/backend.d.ts +0 -40
- package/dest/node-cjs/barretenberg/backend.d.ts.map +1 -1
- package/dest/node-cjs/barretenberg/backend.js +2 -92
- package/dest/node-cjs/barretenberg/index.d.ts +1 -1
- package/dest/node-cjs/barretenberg/index.d.ts.map +1 -1
- package/dest/node-cjs/barretenberg/index.js +2 -3
- package/dest/node-cjs/barretenberg_wasm/barretenberg-threads.wasm.gz +0 -0
- package/dest/node-cjs/index.d.ts +1 -1
- package/dest/node-cjs/index.d.ts.map +1 -1
- package/dest/node-cjs/index.js +2 -3
- package/dest/node-cjs/main.d.ts.map +1 -1
- package/dest/node-cjs/main.js +21 -43
- package/package.json +1 -1
- package/src/barretenberg/backend.ts +0 -138
- package/src/barretenberg/index.ts +1 -1
- package/src/index.ts +0 -1
- package/src/main.ts +33 -58
package/src/main.ts
CHANGED
|
@@ -172,11 +172,7 @@ export async function proveAndVerify(bytecodePath: string, recursive: boolean, w
|
|
|
172
172
|
/* eslint-enable camelcase */
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
export async function proveAndVerifyUltraHonk(
|
|
176
|
-
bytecodePath: string,
|
|
177
|
-
witnessPath: string,
|
|
178
|
-
crsPath: string,
|
|
179
|
-
) {
|
|
175
|
+
export async function proveAndVerifyUltraHonk(bytecodePath: string, witnessPath: string, crsPath: string) {
|
|
180
176
|
/* eslint-disable camelcase */
|
|
181
177
|
const { api } = await initUltraHonk(bytecodePath, crsPath);
|
|
182
178
|
try {
|
|
@@ -191,11 +187,7 @@ export async function proveAndVerifyUltraHonk(
|
|
|
191
187
|
/* eslint-enable camelcase */
|
|
192
188
|
}
|
|
193
189
|
|
|
194
|
-
export async function proveAndVerifyMegaHonk(
|
|
195
|
-
bytecodePath: string,
|
|
196
|
-
witnessPath: string,
|
|
197
|
-
crsPath: string,
|
|
198
|
-
) {
|
|
190
|
+
export async function proveAndVerifyMegaHonk(bytecodePath: string, witnessPath: string, crsPath: string) {
|
|
199
191
|
/* eslint-disable camelcase */
|
|
200
192
|
const { api } = await initUltraPlonk(bytecodePath, false, crsPath);
|
|
201
193
|
try {
|
|
@@ -408,8 +400,8 @@ export async function proveUltraHonk(
|
|
|
408
400
|
const acirProveUltraHonk = options?.keccak
|
|
409
401
|
? api.acirProveUltraKeccakHonk.bind(api)
|
|
410
402
|
: options?.starknet
|
|
411
|
-
|
|
412
|
-
|
|
403
|
+
? api.acirProveUltraStarknetHonk.bind(api)
|
|
404
|
+
: api.acirProveUltraHonk.bind(api);
|
|
413
405
|
const proof = await acirProveUltraHonk(bytecode, witness);
|
|
414
406
|
|
|
415
407
|
if (outputPath === '-') {
|
|
@@ -438,8 +430,8 @@ export async function writeVkUltraHonk(
|
|
|
438
430
|
const acirWriteVkUltraHonk = options?.keccak
|
|
439
431
|
? api.acirWriteVkUltraKeccakHonk.bind(api)
|
|
440
432
|
: options?.starknet
|
|
441
|
-
|
|
442
|
-
|
|
433
|
+
? api.acirWriteVkUltraStarknetHonk.bind(api)
|
|
434
|
+
: api.acirWriteVkUltraHonk.bind(api);
|
|
443
435
|
const vk = await acirWriteVkUltraHonk(bytecode);
|
|
444
436
|
|
|
445
437
|
if (outputPath === '-') {
|
|
@@ -465,8 +457,8 @@ export async function verifyUltraHonk(
|
|
|
465
457
|
const acirVerifyUltraHonk = options?.keccak
|
|
466
458
|
? api.acirVerifyUltraKeccakHonk.bind(api)
|
|
467
459
|
: options?.starknet
|
|
468
|
-
|
|
469
|
-
|
|
460
|
+
? api.acirVerifyUltraStarknetHonk.bind(api)
|
|
461
|
+
: api.acirVerifyUltraHonk.bind(api);
|
|
470
462
|
const verified = await acirVerifyUltraHonk(
|
|
471
463
|
Uint8Array.from(readFileSync(proofPath)),
|
|
472
464
|
new RawBuffer(readFileSync(vkPath)),
|
|
@@ -530,17 +522,20 @@ function handleGlobalOptions() {
|
|
|
530
522
|
return { crsPath: program.opts().crsPath };
|
|
531
523
|
}
|
|
532
524
|
|
|
525
|
+
const deprecatedCommandError = () => async () => {
|
|
526
|
+
console.error(
|
|
527
|
+
`Error: UltraPlonk is now deprecated (see https://github.com/AztecProtocol/barretenberg/issues/1377). Use UltraHonk!`,
|
|
528
|
+
);
|
|
529
|
+
process.exit(1);
|
|
530
|
+
};
|
|
531
|
+
|
|
533
532
|
program
|
|
534
533
|
.command('prove_and_verify')
|
|
535
|
-
.description('Generate a proof and verify it. Process exits with success or failure code.')
|
|
534
|
+
.description('Generate a proof and verify it. Process exits with success or failure code. [DEPRECATED]')
|
|
536
535
|
.option('-b, --bytecode-path <path>', 'Specify the bytecode path', './target/program.json')
|
|
537
536
|
.option('-r, --recursive', 'Whether to use a SNARK friendly proof', false)
|
|
538
537
|
.option('-w, --witness-path <path>', 'Specify the witness path', './target/witness.gz')
|
|
539
|
-
.action(
|
|
540
|
-
const { crsPath } = handleGlobalOptions();
|
|
541
|
-
const result = await proveAndVerify(bytecodePath, recursive, witnessPath, crsPath);
|
|
542
|
-
process.exit(result ? 0 : 1);
|
|
543
|
-
});
|
|
538
|
+
.action(deprecatedCommandError());
|
|
544
539
|
|
|
545
540
|
program
|
|
546
541
|
.command('prove_and_verify_ultra_honk')
|
|
@@ -566,15 +561,12 @@ program
|
|
|
566
561
|
|
|
567
562
|
program
|
|
568
563
|
.command('prove')
|
|
569
|
-
.description('Generate a proof and write it to a file.')
|
|
564
|
+
.description('Generate a proof and write it to a file. [DEPRECATED]')
|
|
570
565
|
.option('-b, --bytecode-path <path>', 'Specify the bytecode path', './target/program.json')
|
|
571
566
|
.option('-r, --recursive', 'Create a SNARK friendly proof', false)
|
|
572
567
|
.option('-w, --witness-path <path>', 'Specify the witness path', './target/witness.gz')
|
|
573
568
|
.option('-o, --output-path <path>', 'Specify the proof output path', './proofs/proof')
|
|
574
|
-
.action(
|
|
575
|
-
const { crsPath } = handleGlobalOptions();
|
|
576
|
-
await prove(bytecodePath, recursive, witnessPath, crsPath, outputPath);
|
|
577
|
-
});
|
|
569
|
+
.action(deprecatedCommandError());
|
|
578
570
|
|
|
579
571
|
program
|
|
580
572
|
.command('gates')
|
|
@@ -589,25 +581,18 @@ program
|
|
|
589
581
|
|
|
590
582
|
program
|
|
591
583
|
.command('verify')
|
|
592
|
-
.description('Verify a proof. Process exists with success or failure code.')
|
|
584
|
+
.description('Verify a proof. Process exists with success or failure code. [DEPRECATED]')
|
|
593
585
|
.requiredOption('-p, --proof-path <path>', 'Specify the path to the proof')
|
|
594
586
|
.requiredOption('-k, --vk <path>', 'path to a verification key. avoids recomputation.')
|
|
595
|
-
.action(
|
|
596
|
-
const { crsPath } = handleGlobalOptions();
|
|
597
|
-
const result = await verify(proofPath, vk, crsPath);
|
|
598
|
-
process.exit(result ? 0 : 1);
|
|
599
|
-
});
|
|
587
|
+
.action(deprecatedCommandError());
|
|
600
588
|
|
|
601
589
|
program
|
|
602
590
|
.command('contract')
|
|
603
|
-
.description('Output solidity verification key contract.')
|
|
591
|
+
.description('Output solidity verification key contract. [DEPRECATED]')
|
|
604
592
|
.option('-b, --bytecode-path <path>', 'Specify the bytecode path', './target/program.json')
|
|
605
593
|
.option('-o, --output-path <path>', 'Specify the path to write the contract', './target/contract.sol')
|
|
606
594
|
.requiredOption('-k, --vk-path <path>', 'Path to a verification key. avoids recomputation.')
|
|
607
|
-
.action(
|
|
608
|
-
const { crsPath } = handleGlobalOptions();
|
|
609
|
-
await contract(outputPath, vkPath, crsPath);
|
|
610
|
-
});
|
|
595
|
+
.action(deprecatedCommandError());
|
|
611
596
|
|
|
612
597
|
program
|
|
613
598
|
.command('contract_ultra_honk')
|
|
@@ -622,46 +607,36 @@ program
|
|
|
622
607
|
|
|
623
608
|
program
|
|
624
609
|
.command('write_vk')
|
|
625
|
-
.description('Output verification key.')
|
|
610
|
+
.description('Output verification key. [DEPRECATED]')
|
|
626
611
|
.option('-b, --bytecode-path <path>', 'Specify the bytecode path', './target/program.json')
|
|
627
612
|
.option('-r, --recursive', 'Create a SNARK friendly proof', false)
|
|
628
613
|
.option('-o, --output-path <path>', 'Specify the path to write the key')
|
|
629
|
-
.action(
|
|
630
|
-
const { crsPath } = handleGlobalOptions();
|
|
631
|
-
await writeVk(bytecodePath, recursive, crsPath, outputPath);
|
|
632
|
-
});
|
|
614
|
+
.action(deprecatedCommandError());
|
|
633
615
|
|
|
634
616
|
program
|
|
635
617
|
.command('write_pk')
|
|
636
|
-
.description('Output proving key.')
|
|
618
|
+
.description('Output proving key. [DEPRECATED]')
|
|
637
619
|
.option('-b, --bytecode-path <path>', 'Specify the bytecode path', './target/program.json')
|
|
638
620
|
.option('-r, --recursive', 'Create a SNARK friendly proof', false)
|
|
639
621
|
.requiredOption('-o, --output-path <path>', 'Specify the path to write the key')
|
|
640
|
-
.action(
|
|
641
|
-
const { crsPath } = handleGlobalOptions();
|
|
642
|
-
await writePk(bytecodePath, recursive, crsPath, outputPath);
|
|
643
|
-
});
|
|
622
|
+
.action(deprecatedCommandError());
|
|
644
623
|
|
|
645
624
|
program
|
|
646
625
|
.command('proof_as_fields')
|
|
647
|
-
.description('Return the proof as fields elements')
|
|
626
|
+
.description('Return the proof as fields elements. [DEPRECATED]')
|
|
648
627
|
.requiredOption('-p, --proof-path <path>', 'Specify the proof path')
|
|
649
628
|
.requiredOption('-k, --vk-path <path>', 'Path to verification key.')
|
|
650
629
|
.requiredOption('-o, --output-path <path>', 'Specify the JSON path to write the proof fields')
|
|
651
|
-
.action(
|
|
652
|
-
const { crsPath } = handleGlobalOptions();
|
|
653
|
-
await proofAsFields(proofPath, vkPath, outputPath, crsPath);
|
|
654
|
-
});
|
|
630
|
+
.action(deprecatedCommandError());
|
|
655
631
|
|
|
656
632
|
program
|
|
657
633
|
.command('vk_as_fields')
|
|
658
|
-
.description(
|
|
634
|
+
.description(
|
|
635
|
+
'Return the verification key represented as fields elements. Also return the verification key hash. [DEPRECATED]',
|
|
636
|
+
)
|
|
659
637
|
.requiredOption('-k, --vk-path <path>', 'Path to verification key.')
|
|
660
638
|
.requiredOption('-o, --output-path <path>', 'Specify the JSON path to write the verification key fields and key hash')
|
|
661
|
-
.action(
|
|
662
|
-
const { crsPath } = handleGlobalOptions();
|
|
663
|
-
await vkAsFields(vkPath, outputPath, crsPath);
|
|
664
|
-
});
|
|
639
|
+
.action(deprecatedCommandError());
|
|
665
640
|
|
|
666
641
|
program
|
|
667
642
|
.command('prove_ultra_honk')
|