Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
api_chonk.hpp
Go to the documentation of this file.
1#pragma once
3#include <filesystem>
4#include <stdexcept>
5#include <string>
6#include <vector>
7
8namespace bb {
9
33class ChonkAPI : public API {
34
35 public:
46 void prove(const Flags& flags, const std::filesystem::path& input_path, const std::filesystem::path& output_dir);
47
55 bool verify(const Flags& flags,
56 const std::filesystem::path& public_inputs_path,
57 const std::filesystem::path& proof_path,
58 const std::filesystem::path& vk_path) override;
59
63 bool prove_and_verify(const std::filesystem::path& input_path);
64
68 void gates(const Flags& flags, const std::filesystem::path& bytecode_path) override;
69
70 void write_solidity_verifier(const Flags& flags,
71 const std::filesystem::path& output_path,
72 const std::filesystem::path& vk_path) override;
73
85 void write_vk(const Flags& flags,
86 const std::filesystem::path& bytecode_path,
87 const std::filesystem::path& output_path) override;
88
98 bool check_precomputed_vks(const Flags& flags, const std::filesystem::path& input_path);
99
100 bool check(const Flags& flags,
101 const std::filesystem::path& bytecode_path,
102 const std::filesystem::path& witness_path) override;
103};
104
105void chonk_gate_count(const std::string& bytecode_path, bool include_gates_per_opcode);
106
107std::vector<uint8_t> decompress(const void* bytes, size_t size);
108
109} // namespace bb
Definition api.hpp:7
CLI API for Chonk (Aztec's client-side proving).
Definition api_chonk.hpp:33
bool prove_and_verify(const std::filesystem::path &input_path)
Test/debug function: prove and verify in one call (bypasses serialization).
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.
void write_vk(const Flags &flags, const std::filesystem::path &bytecode_path, const std::filesystem::path &output_path) override
Compute and write a verification key.
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.
Definition api_chonk.cpp:70
bool check(const Flags &flags, const std::filesystem::path &bytecode_path, const std::filesystem::path &witness_path) override
void gates(const Flags &flags, const std::filesystem::path &bytecode_path) override
Output gate count statistics for a circuit.
bool check_precomputed_vks(const Flags &flags, const std::filesystem::path &input_path)
Validate that precomputed VKs in ivc-inputs.msgpack match computed VKs.
void write_solidity_verifier(const Flags &flags, const std::filesystem::path &output_path, const std::filesystem::path &vk_path) override
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
void chonk_gate_count(const std::string &bytecode_path, bool include_gates_per_opcode)
std::vector< uint8_t > decompress(const void *bytes, size_t size)
Decompress bytecode and witness fields from ivc-inputs.msgpack.