Skip to main content

Core Components

Private Smart Contracts

A smart contract on Aztec is a collection of functions, written as ZK-SNARK circuits. These circuits can have different modes of execution:

  1. Private Functions -- can read and write private state, read historical public state, consume or send messages to / from Ethereum, and read Ethereum state. They can call other private functions in the same contract, or other contracts, and can call public functions.
  2. Public Functions -- can read and write public state, write private state, consume or send messages to / from Ethereum and read Ethereum state. They can call other public functions on the same or other contracts.
  3. Portal Contracts -- these are contracts on Ethereum that can receive messages from Aztec or send messages to Aztec from Ethereum contracts.

Using these different modes of execution, developers can build applications with user privacy, data privacy and code privacy.

  • User privacy - transactions may not reveal information about the sender or the recipient.
  • Data privacy - transactions may not reveal information about the payload of the transaction, e.g., the asset or value being transacted.
  • Code privacy - transactions may not reveal the program logic.

High level network architecture

An overview of the Aztec network architecture will help contextualize the concepts introduced in this section.

network architecture

Aztec.js

A user of the Aztec network will interact with the network through Aztec.js. Aztec.js is a library that provides APIs for managing accounts and interacting with smart contracts (including account contracts) on the Aztec network. It communicates with the Private eXecution Environment (PXE) through a PXE implementation, allowing developers to easily register new accounts, deploy contracts, view functions, and send transactions.

Private Execution Environment

The PXE provides a secure environment for the execution of sensitive operations, ensuring private information and decrypted data are not accessible to unauthorized applications. It hides the details of the state model from end users, but the state model is important for Aztec developers to understand as it has implications for private/public execution and L1/L2 communication. The PXE also includes the ACIR Simulator for private executions and the KeyStore for secure key management.

Procedurally, the PXE sends results of private function execution and requests for public function executions to the sequencer, which will update the state of the rollup.

Sequencer

The sequencer aggregates transactions into a block, generates proofs of the state updates (or delegates proof generate to the prover network) and posts it to the rollup contract on Ethereum, along with any required public data for data availability.

Further Reading