Transactions
A transaction is the minimal action that changes the state of the network. Transactions in Aztec have a private and a public component, where the former is executed in the user's private execution environment (PXE) and the latter by the sequencer.
A transaction is also split into three phases to support authorization abstraction and fee payments: a validation and fee preparation phase, a main execution phase, and fee distribution phase.
Users initiate a transaction by sending a transaction_request
to their local PXE, which locally simulates and proves the transaction and returns a transaction_object
identified by a transaction_hash
. This transaction object is then broadcast to the network via an Aztec Node, which checks its validity, and is eventually picked up by a sequencer who executes the public component of the transaction and includes it in a block.
📄️ Local Execution
Transactions are initiated via a transaction execution request sent from the user to their local private execution environment (PXE). The PXE first executes the transaction locally in a simulation step, and then generates a zero-knowledge proof of correct execution. The PXE is then responsible for converting a transaction execution request into a transaction ready to be broadcasted to the network.
📄️ Public execution
Transactions have a public execution component. Once a transaction is picked up by a sequencer to be included in a block, the sequencer is responsible for executing all enqueued public function calls in the transaction. These are defined by the data.accumulatedData.publicCallStack field of the transaction object, which are commitments to the preimages of the enqueuedPublicFunctionCalls in the transaction. The sequencer pops function calls from the stack, and pushes new ones as needed, until the public call stack is empty.
📄️ Transaction object
The transaction object is the struct broadcasted to the p2p network, generated by local execution by the user's PXE. Sequencers pick up transactions from the p2p network to include in a block.
📄️ Validity conditions
The validity conditions of a transaction define when a transaction object is valid. Nodes should check the validity of a transaction when they receive it either directly or through the p2p pool, and if they find it to be invalid, should drop it immediately and not broadcast it.