ZK / Privacy·EVM · Aztec
Aztec
Aztec is a privacy-first zk-rollup with a hybrid private/public execution model. Smart contracts are written in Aztec.nr (Noir + Aztec macros) and run client-side for private state or in the public VM for shared state, all settling to Ethereum L1.
- 01private DeFi and payments
- 02shielded balances and transfers
- 03confidential identity / compliance
- 04hybrid public/private contracts
- 05client-side ZK execution
- bash -i <(curl -s https://install.aztec.network)
- aztec-up
- aztec start --sandbox
- aztec-nargo new --contract my_contract
- pnpm add @aztec/aztec.js @aztec/accounts
| Variable | Scope | Description |
|---|---|---|
| PXE_URL | Client | URL of the Aztec PXE (Private eXecution Environment), e.g. http://localhost:8080 for the local sandbox. |
Use Aztec for privacy-preserving smart contracts. Spin up the local stack with `aztec start --sandbox` (Anvil L1 + Aztec node + PXE). Write contracts in Aztec.nr — annotate functions with `#[private]` for client-proven functions over notes, `#[public]` for AVM-executed shared state, and use `aztec-nargo compile` then `aztec codegen` to produce TypeScript artifacts. From a dapp, connect to the PXE with `createPXEClient(PXE_URL)`, register an account via `getSchnorrAccount`, and call contracts using the generated `MyContract.at(address, wallet)` interface. Private function calls are proved in the user's PXE before being submitted as encrypted notes; public calls execute on the sequencer.
- ⚑Private state lives as encrypted notes in the user's PXE — losing the PXE database is equivalent to losing funds; back up the secret key and account state.
- ⚑`aztec-nargo` is a fork of stock `nargo`; do not mix versions, and pin `@aztec/aztec.js` to the exact node/sandbox version you target.
- ⚑Client-side proving for private functions can take seconds to minutes on mobile/low-end devices — design UX with progress indication and avoid chained private calls.
- ⚑Public VM (AVM) is gas-metered separately from L1; gas estimation is still maturing and can mis-price under load.
- ⚑Aztec is on testnet/mainnet-soon depending on release — features and addresses change between sandbox versions, so always read the migration notes when bumping.