High Level Topology
Overview
A transaction begins with a call to a private function, which may invoke nested calls to other private and public functions. The entire set of private function calls is executed in a secure environment, and their proofs are validated and aggregated by private kernel circuits. Meanwhile, any public function calls triggered from private functions will be enqueued. The proofs for these calls, along with those from the nested public function calls, are generated and processed through public kernel circuits in any entity possessing the correct contexts.
Once all functions in a transaction are executed, the accumulated data is outputted from a tail circuit. These values are then inserted or updated to the state trees within the base rollup circuit. The merge rollup circuit facilitates the merging of two rollup proofs. Repeating this merging process enables the inclusion of more transactions in a block. Finally, the root rollup circuit produces the final proof, which is subsequently submitted and validated onchain.
To illustrate, consider a transaction involving the following functions, where circles depict private functions, and squares denote public functions:
A note for Aztec protocol developers: In this yellow paper, the order in which the kernel circuit processes calls is different from previous literature, and is different from the current implementation (as at January 2024).
This transaction contains 6 private functions (f0 to f5) and 5 public functions (F0 to F4), with f0
being the entrypoint. The entire transaction is processed as follows:
A few things to note:
- A transaction always starts with an initial private kernel circuit.
- An inner private kernel circuit won't be required if there is only one private function in a transaction.
- A reset private kernel circuit can be executed between two private kernel circuits to "reset" transient data. The reset process can be repeated as needed.
- Public functions are "enqueued" when invoked from a private function. Public kernel circuits will be executed after the completion of all private kernel iterations.
- A base rollup circuit can accept either a tail public kernel circuit, or a tail private kernel circuit in cases where no public functions are present in the transaction.
- A merge rollup circuit can merge two base rollup circuits or two merge rollup circuits.
- The final step is the execution of the root rollup circuit, which combines two base rollup circuits or two merge rollup circuits.