|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
CLI API for Chonk (Aztec's client-side proving). More...
#include <api_chonk.hpp>
Public Member Functions | |
| void | prove (const Flags &flags, const std::filesystem::path &input_path, const std::filesystem::path &output_dir) |
| Main production entry point: generate a Chonk proof from private execution steps. | |
| bool | verify (const Flags &flags, const std::filesystem::path &public_inputs_path, const std::filesystem::path &proof_path, const std::filesystem::path &vk_path) override |
| Verify a Chonk proof against a verification key. | |
| bool | prove_and_verify (const std::filesystem::path &input_path) |
| Test/debug function: prove and verify in one call (bypasses serialization). | |
| void | gates (const Flags &flags, const std::filesystem::path &bytecode_path) override |
| Output gate count statistics for a circuit. | |
| void | write_solidity_verifier (const Flags &flags, const std::filesystem::path &output_path, const std::filesystem::path &vk_path) override |
| void | write_vk (const Flags &flags, const std::filesystem::path &bytecode_path, const std::filesystem::path &output_path) override |
| Compute and write a MegaHonk verification key for a circuit to be accumulated in Chonk. | |
| bool | batch_verify (const Flags &flags, const std::filesystem::path &proofs_dir) |
| Batch-verify multiple Chonk proofs from a directory of proof_N/vk_N pairs. | |
| bool | check_precomputed_vks (const Flags &flags, const std::filesystem::path &input_path) |
| Validate that precomputed VKs in ivc-inputs.msgpack match computed VKs. | |
| bool | check (const Flags &flags, const std::filesystem::path &bytecode_path, const std::filesystem::path &witness_path) override |
CLI API for Chonk (Aztec's client-side proving).
Processes private function execution steps from TypeScript, accumulates them via Chonk, and produces proofs that can be verified on-chain.
Production flow (Aztec private execution):
Key entry points:
prove(): Main production entry - loads execution steps, runs IVC, outputs proofverify(): Verifies a Chonk proof against a verification keywrite_vk(): Computes verification key for standalone or IVC circuitscheck_precomputed_vks(): Validates that precomputed VKs match computed onesDefinition at line 33 of file api_chonk.hpp.
| bool bb::ChonkAPI::batch_verify | ( | const Flags & | flags, |
| const std::filesystem::path & | proofs_dir | ||
| ) |
Batch-verify multiple Chonk proofs from a directory of proof_N/vk_N pairs.
| proofs_dir | Directory containing proof_0/vk_0, proof_1/vk_1, ... |
Definition at line 118 of file api_chonk.cpp.
|
overridevirtual |
Implements bb::API.
Definition at line 221 of file api_chonk.cpp.
| bool bb::ChonkAPI::check_precomputed_vks | ( | const Flags & | flags, |
| const std::filesystem::path & | input_path | ||
| ) |
Validate that precomputed VKs in ivc-inputs.msgpack match computed VKs.
Iterates through all execution steps and verifies each precomputed VK. If flags.vk_policy is REWRITE, mismatched VKs are updated in place.
| input_path | Path to ivc-inputs.msgpack |
Definition at line 178 of file api_chonk.cpp.
|
overridevirtual |
Output gate count statistics for a circuit.
Implements bb::API.
Definition at line 164 of file api_chonk.cpp.
| void bb::ChonkAPI::prove | ( | const Flags & | flags, |
| const std::filesystem::path & | input_path, | ||
| const std::filesystem::path & | output_dir | ||
| ) |
Main production entry point: generate a Chonk proof from private execution steps.
Loads execution steps from ivc-inputs.msgpack, accumulates each circuit via Chonk, and writes the final proof (and optionally VK) to the output directory.
| flags | Runtime flags (vk_policy, write_vk, etc.) |
| input_path | Path to ivc-inputs.msgpack containing PrivateExecutionStepRaw entries |
| output_dir | Directory to write proof (and vk if flags.write_vk is set) |
Definition at line 52 of file api_chonk.cpp.
| bool bb::ChonkAPI::prove_and_verify | ( | const std::filesystem::path & | input_path | ) |
Test/debug function: prove and verify in one call (bypasses serialization).
Definition at line 149 of file api_chonk.cpp.
|
overridevirtual |
Verify a Chonk proof against a verification key.
| proof_path | Path to the serialized Chonk proof |
| vk_path | Path to the verification key |
Implements bb::API.
Definition at line 103 of file api_chonk.cpp.
|
overridevirtual |
Implements bb::API.
Definition at line 170 of file api_chonk.cpp.
|
overridevirtual |
Compute and write a MegaHonk verification key for a circuit to be accumulated in Chonk.
| bytecode_path | Path to circuit bytecode (ACIR) |
| output_path | Directory to write the VK |
Implements bb::API.
Definition at line 213 of file api_chonk.cpp.