Barretenberg
The ZK-SNARK library at the core of Aztec
|
Class for managing propagation of databus return data commitments used in consistency checks. More...
#include <databus.hpp>
Public Types | |
using | Curve = stdlib::bn254< Builder > |
using | Commitment = typename Curve::Group |
using | CommitmentNative = typename Curve::AffineElementNative |
using | FrNative = typename Curve::ScalarFieldNative |
Public Member Functions | |
void | set_kernel_return_data_commitment (const Commitment &commitment) |
void | set_app_return_data_commitment (const Commitment &commitment) |
Commitment | get_kernel_return_data_commitment (Builder &builder) |
Get the previously set kernel return data commitment if it exists, else a default one. | |
Commitment | get_app_return_data_commitment (Builder &builder) |
Get the previously set app return data commitment if it exists, else a default one. | |
Static Public Member Functions | |
static Commitment | construct_default_commitment (Builder &builder) |
Construct a default commitment for the databus return data. | |
Public Attributes | |
Commitment | app_return_data_commitment |
Commitment | kernel_return_data_commitment |
bool | app_return_data_commitment_exists = false |
bool | kernel_return_data_commitment_exists = false |
Class for managing propagation of databus return data commitments used in consistency checks.
The databus consistency checks establish the transfer of data between two circuits (i-1 and i) in a third circuit (i+1) via commitment equality checks of the form [R_{i-1}] = [C_i], where R and C represent return data and calldata, respectively. In practice, circuit (i+1) is given access to [R_{i-1}] via the public inputs of \pi_i, and it has access to [C_i] directly from \pi_i. The consistency checks in circuit (i+1) are thus of the form \pi_i.public_inputs.[R_{i-1}] = \pi_i.[C_i].
For consistent behavior across kernels, every kernel propagates two return data commitments via its public inputs. If one of either the app or kernel return data does not exist, it is populated with a default value that will satisfy the consistency check on the next cycle. For example, the first kernel has no previous kernel to verify and thus neither receives a previous kernel return data commitment nor a calldata input corresponding to a previous kernel. The "empty" calldata will be populated with a default value, resulting in a default commitment value. We set the same value for the missing return data herein so that the commitments agree and the corresponding consistency check will be satisfied in the kernel in which it's performed.
Builder |
Definition at line 85 of file databus.hpp.
using bb::stdlib::DataBusDepot< Builder >::Commitment = typename Curve::Group |
Definition at line 88 of file databus.hpp.
using bb::stdlib::DataBusDepot< Builder >::CommitmentNative = typename Curve::AffineElementNative |
Definition at line 89 of file databus.hpp.
using bb::stdlib::DataBusDepot< Builder >::Curve = stdlib::bn254<Builder> |
Definition at line 87 of file databus.hpp.
using bb::stdlib::DataBusDepot< Builder >::FrNative = typename Curve::ScalarFieldNative |
Definition at line 90 of file databus.hpp.
|
inlinestatic |
Construct a default commitment for the databus return data.
This commitment is used when no genuine return data commitment exists for either the kernel or app
Definition at line 117 of file databus.hpp.
|
inline |
Get the previously set app return data commitment if it exists, else a default one.
Definition at line 142 of file databus.hpp.
|
inline |
Get the previously set kernel return data commitment if it exists, else a default one.
Definition at line 129 of file databus.hpp.
|
inline |
Definition at line 106 of file databus.hpp.
|
inline |
Definition at line 100 of file databus.hpp.
Commitment bb::stdlib::DataBusDepot< Builder >::app_return_data_commitment |
Definition at line 93 of file databus.hpp.
bool bb::stdlib::DataBusDepot< Builder >::app_return_data_commitment_exists = false |
Definition at line 97 of file databus.hpp.
Commitment bb::stdlib::DataBusDepot< Builder >::kernel_return_data_commitment |
Definition at line 94 of file databus.hpp.
bool bb::stdlib::DataBusDepot< Builder >::kernel_return_data_commitment_exists = false |
Definition at line 98 of file databus.hpp.