@aztec/bb-prover 0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2 → 0.76.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 (71) hide show
  1. package/dest/avm_proving_tests/avm_proving_tester.d.ts +25 -0
  2. package/dest/avm_proving_tests/avm_proving_tester.d.ts.map +1 -0
  3. package/dest/avm_proving_tests/avm_proving_tester.js +16 -14
  4. package/dest/bb/cli.d.ts +12 -0
  5. package/dest/bb/cli.d.ts.map +1 -0
  6. package/dest/bb/cli.js +9 -4
  7. package/dest/bb/execute.d.ts +170 -0
  8. package/dest/bb/execute.d.ts.map +1 -0
  9. package/dest/bb/execute.js +267 -395
  10. package/dest/bb/index.d.ts +3 -0
  11. package/dest/bb/index.d.ts.map +1 -0
  12. package/dest/bb/index.js +6 -4
  13. package/dest/config.d.ts +13 -0
  14. package/dest/config.d.ts.map +1 -0
  15. package/dest/config.js +2 -1
  16. package/dest/honk.d.ts +13 -0
  17. package/dest/honk.d.ts.map +1 -0
  18. package/dest/honk.js +5 -8
  19. package/dest/index.d.ts +8 -0
  20. package/dest/index.d.ts.map +1 -0
  21. package/dest/index.js +1 -0
  22. package/dest/instrumentation.d.ts +47 -0
  23. package/dest/instrumentation.d.ts.map +1 -0
  24. package/dest/instrumentation.js +41 -44
  25. package/dest/prover/bb_native_private_kernel_prover.d.ts +25 -0
  26. package/dest/prover/bb_native_private_kernel_prover.d.ts.map +1 -0
  27. package/dest/prover/bb_native_private_kernel_prover.js +19 -19
  28. package/dest/prover/bb_private_kernel_prover.d.ts +31 -0
  29. package/dest/prover/bb_private_kernel_prover.d.ts.map +1 -0
  30. package/dest/prover/bb_private_kernel_prover.js +11 -11
  31. package/dest/prover/bb_prover.d.ts +123 -0
  32. package/dest/prover/bb_prover.d.ts.map +1 -0
  33. package/dest/prover/bb_prover.js +445 -431
  34. package/dest/prover/client_ivc_proof_utils.d.ts +25 -0
  35. package/dest/prover/client_ivc_proof_utils.d.ts.map +1 -0
  36. package/dest/prover/client_ivc_proof_utils.js +9 -15
  37. package/dest/prover/index.d.ts +4 -0
  38. package/dest/prover/index.d.ts.map +1 -0
  39. package/dest/prover/index.js +1 -0
  40. package/dest/stats.d.ts +5 -0
  41. package/dest/stats.d.ts.map +1 -0
  42. package/dest/stats.js +14 -15
  43. package/dest/test/index.d.ts +3 -0
  44. package/dest/test/index.d.ts.map +1 -0
  45. package/dest/test/index.js +1 -0
  46. package/dest/test/test_circuit_prover.d.ts +72 -0
  47. package/dest/test/test_circuit_prover.d.ts.map +1 -0
  48. package/dest/test/test_circuit_prover.js +160 -156
  49. package/dest/test/test_verifier.d.ts +5 -0
  50. package/dest/test/test_verifier.d.ts.map +1 -0
  51. package/dest/test/test_verifier.js +1 -0
  52. package/dest/verification_key/verification_key_data.d.ts +9 -0
  53. package/dest/verification_key/verification_key_data.d.ts.map +1 -0
  54. package/dest/verification_key/verification_key_data.js +8 -10
  55. package/dest/verifier/bb_verifier.d.ts +15 -0
  56. package/dest/verifier/bb_verifier.d.ts.map +1 -0
  57. package/dest/verifier/bb_verifier.js +13 -13
  58. package/dest/verifier/index.d.ts +2 -0
  59. package/dest/verifier/index.d.ts.map +1 -0
  60. package/dest/verifier/index.js +1 -0
  61. package/dest/wasm/bb_wasm_private_kernel_prover.d.ts +16 -0
  62. package/dest/wasm/bb_wasm_private_kernel_prover.d.ts.map +1 -0
  63. package/dest/wasm/bb_wasm_private_kernel_prover.js +10 -11
  64. package/dest/wasm/bundle.d.ts +6 -0
  65. package/dest/wasm/bundle.d.ts.map +1 -0
  66. package/dest/wasm/bundle.js +2 -1
  67. package/dest/wasm/lazy.d.ts +6 -0
  68. package/dest/wasm/lazy.d.ts.map +1 -0
  69. package/dest/wasm/lazy.js +2 -1
  70. package/package.json +10 -10
  71. package/src/avm_proving_tests/avm_proving_tester.ts +15 -3
@@ -0,0 +1,123 @@
1
+ import { type ProofAndVerificationKey, type PublicInputsAndRecursiveProof, type ServerCircuitProver } from '@aztec/circuit-types';
2
+ import { AVM_PROOF_LENGTH_IN_FIELDS, type AvmCircuitInputs, type BaseParityInputs, NESTED_RECURSIVE_PROOF_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, type ParityPublicInputs, Proof, RECURSIVE_PROOF_LENGTH, RecursiveProof, type RootParityInputs, TUBE_PROOF_LENGTH, type VerificationKeyData } from '@aztec/circuits.js';
3
+ import { type BaseOrMergeRollupPublicInputs, type BlockMergeRollupInputs, type BlockRootOrBlockMergePublicInputs, type BlockRootRollupInputs, type EmptyBlockRootRollupInputs, type MergeRollupInputs, type PrivateBaseRollupInputs, type PublicBaseRollupInputs, type RootRollupInputs, type RootRollupPublicInputs, type SingleTxBlockRootRollupInputs, type TubeInputs } from '@aztec/circuits.js/rollup';
4
+ import { type ServerProtocolArtifact } from '@aztec/noir-protocol-circuits-types/server';
5
+ import { type TelemetryClient } from '@aztec/telemetry-client';
6
+ import type { ACVMConfig, BBConfig } from '../config.js';
7
+ import { type UltraHonkFlavor } from '../honk.js';
8
+ export interface BBProverConfig extends BBConfig, ACVMConfig {
9
+ circuitFilter?: ServerProtocolArtifact[];
10
+ }
11
+ /**
12
+ * Prover implementation that uses barretenberg native proving
13
+ */
14
+ export declare class BBNativeRollupProver implements ServerCircuitProver {
15
+ private config;
16
+ private instrumentation;
17
+ constructor(config: BBProverConfig, telemetry: TelemetryClient);
18
+ get tracer(): import("@aztec/telemetry-client").Tracer;
19
+ static new(config: BBProverConfig, telemetry?: TelemetryClient): Promise<BBNativeRollupProver>;
20
+ /**
21
+ * Simulates the base parity circuit from its inputs.
22
+ * @param inputs - Inputs to the circuit.
23
+ * @returns The public inputs of the parity circuit.
24
+ */
25
+ getBaseParityProof(inputs: BaseParityInputs): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof RECURSIVE_PROOF_LENGTH>>;
26
+ /**
27
+ * Simulates the root parity circuit from its inputs.
28
+ * @param inputs - Inputs to the circuit.
29
+ * @returns The public inputs of the parity circuit.
30
+ */
31
+ getRootParityProof(inputs: RootParityInputs): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof NESTED_RECURSIVE_PROOF_LENGTH>>;
32
+ /**
33
+ * Creates an AVM proof and verifies it.
34
+ * @param inputs - The inputs to the AVM circuit.
35
+ * @returns The proof.
36
+ */
37
+ getAvmProof(inputs: AvmCircuitInputs): Promise<ProofAndVerificationKey<typeof AVM_PROOF_LENGTH_IN_FIELDS>>;
38
+ /**
39
+ * Simulates the base rollup circuit from its inputs.
40
+ * @param inputs - Inputs to the circuit.
41
+ * @returns The public inputs as outputs of the simulation.
42
+ */
43
+ getPrivateBaseRollupProof(inputs: PrivateBaseRollupInputs): Promise<PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
44
+ /**
45
+ * Requests that the public kernel tail circuit be executed and the proof generated
46
+ * @param kernelRequest - The object encapsulating the request for a proof
47
+ * @returns The requested circuit's public inputs and proof
48
+ */
49
+ getPublicBaseRollupProof(inputs: PublicBaseRollupInputs): Promise<PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
50
+ /**
51
+ * Simulates the merge rollup circuit from its inputs.
52
+ * @param input - Inputs to the circuit.
53
+ * @returns The public inputs as outputs of the simulation.
54
+ */
55
+ getMergeRollupProof(input: MergeRollupInputs): Promise<PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
56
+ /**
57
+ * Simulates the block root rollup circuit from its inputs.
58
+ * @param input - Inputs to the circuit.
59
+ * @returns The public inputs as outputs of the simulation.
60
+ */
61
+ getBlockRootRollupProof(input: BlockRootRollupInputs): Promise<PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
62
+ getSingleTxBlockRootRollupProof(input: SingleTxBlockRootRollupInputs): Promise<PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
63
+ /**
64
+ * Simulates the empty block root rollup circuit from its inputs.
65
+ * @param input - Inputs to the circuit.
66
+ * @returns The public inputs as outputs of the simulation.
67
+ */
68
+ getEmptyBlockRootRollupProof(input: EmptyBlockRootRollupInputs): Promise<PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
69
+ /**
70
+ * Simulates the block merge rollup circuit from its inputs.
71
+ * @param input - Inputs to the circuit.
72
+ * @returns The public inputs as outputs of the simulation.
73
+ */
74
+ getBlockMergeRollupProof(input: BlockMergeRollupInputs): Promise<PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
75
+ /**
76
+ * Simulates the root rollup circuit from its inputs.
77
+ * @param input - Inputs to the circuit.
78
+ * @returns The public inputs as outputs of the simulation.
79
+ */
80
+ getRootRollupProof(input: RootRollupInputs): Promise<PublicInputsAndRecursiveProof<RootRollupPublicInputs>>;
81
+ private generateProofWithBB;
82
+ private createProof;
83
+ private generateAvmProofWithBB;
84
+ private generateTubeProofWithBB;
85
+ private createAvmProof;
86
+ getTubeProof(input: TubeInputs): Promise<ProofAndVerificationKey<typeof TUBE_PROOF_LENGTH>>;
87
+ /**
88
+ * Executes a circuit and returns its outputs and corresponding proof with embedded aggregation object
89
+ * @param witnessMap - The input witness
90
+ * @param circuitType - The type of circuit to be executed
91
+ * @param proofLength - The length of the proof to be generated. This is a dummy parameter to aid in type checking
92
+ * @param convertInput - Function for mapping the input object to a witness map.
93
+ * @param convertOutput - Function for parsing the output witness to it's corresponding object
94
+ * @returns The circuits output object and it's proof
95
+ */
96
+ private createRecursiveProof;
97
+ /**
98
+ * Verifies a proof, will generate the verification key if one is not cached internally
99
+ * @param circuitType - The type of circuit whose proof is to be verified
100
+ * @param proof - The proof to be verified
101
+ */
102
+ verifyProof(circuitType: ServerProtocolArtifact, proof: Proof): Promise<void>;
103
+ verifyAvmProof(proof: Proof, verificationKey: VerificationKeyData): Promise<void>;
104
+ verifyWithKey(flavor: UltraHonkFlavor, verificationKey: VerificationKeyData, proof: Proof): Promise<void>;
105
+ private verifyWithKeyInternal;
106
+ /**
107
+ * Will check a recursive proof argument for validity of it's 'fields' format of proof and convert if required
108
+ * @param proof - The input proof that may need converting
109
+ * @returns - The valid proof
110
+ */
111
+ ensureValidProof(proof: RecursiveProof<typeof NESTED_RECURSIVE_PROOF_LENGTH>, // WORKTODO
112
+ circuit: ServerProtocolArtifact, vk: VerificationKeyData): Promise<RecursiveProof<459>>;
113
+ /**
114
+ * Returns the verification key data for a circuit.
115
+ * @param circuitType - The type of circuit for which the verification key is required
116
+ * @returns The verification key data
117
+ */
118
+ private getVerificationKeyDataForCircuit;
119
+ private readProofAsFields;
120
+ private readAvmProofAsFields;
121
+ private runInDirectory;
122
+ }
123
+ //# sourceMappingURL=bb_prover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bb_prover.d.ts","sourceRoot":"","sources":["../../src/prover/bb_prover.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,uBAAuB,EAE5B,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EAGzB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,0BAA0B,EAC1B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAGrB,6BAA6B,EAC7B,yCAAyC,EACzC,KAAK,kBAAkB,EACvB,KAAK,EACL,sBAAsB,EACtB,cAAc,EACd,KAAK,gBAAgB,EACrB,iBAAiB,EACjB,KAAK,mBAAmB,EAEzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,6BAA6B,EAClC,KA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