Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bbapi_client_ivc.hpp
Go to the documentation of this file.
1#pragma once
14#include <vector>
15
16namespace bb::bbapi {
17
25 static constexpr const char* MSGPACK_SCHEMA_NAME = "ClientIvcStart";
26
31 struct Response {
32 static constexpr const char* MSGPACK_SCHEMA_NAME = "ClientIvcStartResponse";
33 // Empty response - success indicated by no exception
34 void msgpack(auto&& pack_fn) { pack_fn(); }
35 bool operator==(const Response&) const = default;
36 };
37 // Number of circuits to be accumulated.
39 Response execute(BBApiRequest& request) &&;
41 bool operator==(const ClientIvcStart&) const = default;
42};
43
49 static constexpr const char* MSGPACK_SCHEMA_NAME = "ClientIvcLoad";
50
55 struct Response {
56 static constexpr const char* MSGPACK_SCHEMA_NAME = "ClientIvcLoadResponse";
57 // Empty response - success indicated by no exception
58 void msgpack(auto&& pack_fn) { pack_fn(); }
59 bool operator==(const Response&) const = default;
60 };
61
64 Response execute(BBApiRequest& request) &&;
66 bool operator==(const ClientIvcLoad&) const = default;
67};
68
74 static constexpr const char* MSGPACK_SCHEMA_NAME = "ClientIvcAccumulate";
75
80 struct Response {
81 static constexpr const char* MSGPACK_SCHEMA_NAME = "ClientIvcAccumulateResponse";
82 // Empty response - success indicated by no exception
83 void msgpack(auto&& pack_fn) { pack_fn(); }
84 bool operator==(const Response&) const = default;
85 };
86
88 std::vector<uint8_t> witness;
89 Response execute(BBApiRequest& request) &&;
91 bool operator==(const ClientIvcAccumulate&) const = default;
92};
93
99 static constexpr const char* MSGPACK_SCHEMA_NAME = "ClientIvcProve";
100
105 struct Response {
106 static constexpr const char* MSGPACK_SCHEMA_NAME = "ClientIvcProveResponse";
107
111 bool operator==(const Response&) const = default;
112 };
113 Response execute(BBApiRequest& request) &&;
114 void msgpack(auto&& pack_fn) { pack_fn(); }
115 bool operator==(const ClientIvcProve&) const = default;
116};
117
123 static constexpr const char* MSGPACK_SCHEMA_NAME = "ClientIvcVerify";
124
129 struct Response {
130 static constexpr const char* MSGPACK_SCHEMA_NAME = "ClientIvcVerifyResponse";
131
133 bool valid;
135 bool operator==(const Response&) const = default;
136 };
137
141 std::vector<uint8_t> vk;
142 Response execute(const BBApiRequest& request = {}) &&;
144 bool operator==(const ClientIvcVerify&) const = default;
145};
146
152 static constexpr const char* MSGPACK_SCHEMA_NAME = "ClientIvcComputeStandaloneVk";
153
158 struct Response {
159 static constexpr const char* MSGPACK_SCHEMA_NAME = "ClientIvcComputeStandaloneVkResponse";
160
162 std::vector<uint8_t> bytes;
166 bool operator==(const Response&) const = default;
167 };
168
170 Response execute(const BBApiRequest& request = {}) &&;
172 bool operator==(const ClientIvcComputeStandaloneVk&) const = default;
173};
174
180 static constexpr const char* MSGPACK_SCHEMA_NAME = "ClientIvcComputeIvcVk";
181
186 struct Response {
187 static constexpr const char* MSGPACK_SCHEMA_NAME = "ClientIvcComputeIvcVkResponse";
188
190 std::vector<uint8_t> bytes;
192 bool operator==(const Response&) const = default;
193 };
194
196 Response execute(const BBApiRequest& request = {}) &&;
198 bool operator==(const ClientIvcComputeIvcVk&) const = default;
199};
200
206 static constexpr const char* MSGPACK_SCHEMA_NAME = "ClientIvcCheckPrecomputedVk";
207
212 struct Response {
213 static constexpr const char* MSGPACK_SCHEMA_NAME = "ClientIvcCheckPrecomputedVkResponse";
214
216 bool valid;
218 std::vector<uint8_t> actual_vk;
220 bool operator==(const Response&) const = default;
221 };
222
225
226 Response execute(const BBApiRequest& request = {}) &&;
228 bool operator==(const ClientIvcCheckPrecomputedVk&) const = default;
229};
230
236 static constexpr const char* MSGPACK_SCHEMA_NAME = "ClientIvcStats";
237
242 struct Response {
243 static constexpr const char* MSGPACK_SCHEMA_NAME = "ClientIvcStatsResponse";
244
246 uint32_t acir_opcodes;
248 uint32_t circuit_size;
250 std::vector<uint32_t> gates_per_opcode;
252 bool operator==(const Response&) const = default;
253 };
254
259 Response execute(BBApiRequest& request) &&;
261 bool operator==(const ClientIvcStats&) const = default;
262};
263
264} // namespace bb::bbapi
Shared type definitions for the Barretenberg RPC API.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
A full proof for the IVC scheme containing a Mega proof showing correctness of the hiding circuit (wh...
A circuit to be used in either ultrahonk or ClientIVC-honk proving.
A circuit to be used in either ultrahonk or chonk (ClientIVC+honk) verification key derivation.
Empty response indicating successful circuit accumulation.
static constexpr const char * MSGPACK_SCHEMA_NAME
bool operator==(const Response &) const =default
Accumulate the previously loaded circuit into the IVC proof.
bool operator==(const ClientIvcAccumulate &) const =default
Response execute(BBApiRequest &request) &&
std::vector< uint8_t > witness
Serialized witness data for the last loaded circuit.
static constexpr const char * MSGPACK_SCHEMA_NAME
std::vector< uint8_t > actual_vk
The actual VK it should be.
bool operator==(const Response &) const =default
bool valid
True if the precomputed VK matches the circuit.
Verify that a precomputed verification key matches the circuit.
static constexpr const char * MSGPACK_SCHEMA_NAME
Response execute(const BBApiRequest &request={}) &&
CircuitInput circuit
Circuit with its precomputed verification key.
bool operator==(const ClientIvcCheckPrecomputedVk &) const =default
Contains the computed IVC verification key.
bool operator==(const Response &) const =default
static constexpr const char * MSGPACK_SCHEMA_NAME
std::vector< uint8_t > bytes
Serialized IVC verification key in binary format.
Compute IVC verification key for the complete proof.
static constexpr const char * MSGPACK_SCHEMA_NAME
Response execute(const BBApiRequest &request={}) &&
bool operator==(const ClientIvcComputeIvcVk &) const =default
Contains the computed verification key in multiple formats.
std::vector< bb::fr > fields
Verification key as array of field elements.
bool operator==(const Response &) const =default
std::vector< uint8_t > bytes
Serialized verification key in binary format.
Compute standalone verification key for a circuit.
static constexpr const char * MSGPACK_SCHEMA_NAME
Response execute(const BBApiRequest &request={}) &&
bool operator==(const ClientIvcComputeStandaloneVk &) const =default
Empty response indicating successful circuit loading.
static constexpr const char * MSGPACK_SCHEMA_NAME
bool operator==(const Response &) const =default
Load a circuit into the ClientIVC instance for accumulation.
bool operator==(const ClientIvcLoad &) const =default
CircuitInput circuit
Circuit to be loaded with its bytecode and verification key.
static constexpr const char * MSGPACK_SCHEMA_NAME
Response execute(BBApiRequest &request) &&
Contains the generated IVC proof.
bool operator==(const Response &) const =default
ClientIVC::Proof proof
Complete IVC proof for all accumulated circuits.
static constexpr const char * MSGPACK_SCHEMA_NAME
Generate a proof for all accumulated circuits.
void msgpack(auto &&pack_fn)
static constexpr const char * MSGPACK_SCHEMA_NAME
bool operator==(const ClientIvcProve &) const =default
Response execute(BBApiRequest &request) &&
Empty response indicating successful initialization.
bool operator==(const Response &) const =default
static constexpr const char * MSGPACK_SCHEMA_NAME
Initialize a new ClientIVC instance for incremental proof accumulation.
Response execute(BBApiRequest &request) &&
bool operator==(const ClientIvcStart &) const =default
MSGPACK_FIELDS(num_circuits)
static constexpr const char * MSGPACK_SCHEMA_NAME
Contains gate count information.
uint32_t circuit_size
Circuit size (total number of gates)
MSGPACK_FIELDS(acir_opcodes, circuit_size, gates_per_opcode)
static constexpr const char * MSGPACK_SCHEMA_NAME
bool operator==(const Response &) const =default
std::vector< uint32_t > gates_per_opcode
Optional: gate counts per opcode.
uint32_t acir_opcodes
Number of ACIR opcodes.
Get gate counts for a circuit.
MSGPACK_FIELDS(circuit, include_gates_per_opcode)
bool operator==(const ClientIvcStats &) const =default
Response execute(BBApiRequest &request) &&
bool include_gates_per_opcode
Whether to include detailed gate counts per opcode.
CircuitInputNoVK circuit
The circuit to analyze.
static constexpr const char * MSGPACK_SCHEMA_NAME
Contains the verification result.
bool operator==(const Response &) const =default
static constexpr const char * MSGPACK_SCHEMA_NAME
bool valid
True if the proof is valid.
Verify a ClientIVC proof with its verification key.
ClientIVC::Proof proof
The ClientIVC proof to verify.
bool operator==(const ClientIvcVerify &) const =default
Response execute(const BBApiRequest &request={}) &&
std::vector< uint8_t > vk
The verification key.
static constexpr const char * MSGPACK_SCHEMA_NAME