Example

This example demonstrates how users can privately deposit and withdraw assets (e.g., ETH) held on Aztec into a secure Vault on Optimism Sepolia. It leverages the confidential ERC-7683-compliant bridge to enable trustless, privacy-preserving transfers between Aztec and Optimism Sepolia. Additionally, it uses zkPassport proofs to enforce eligibility criteria—such as verifying that the user is over 18—without disclosing any personal information.

The code is available on githubarrow-up-right.

Prerequisites

Before running the example, make sure to set up the Aztec environment by following these steps:

Install the Aztec sandbox, CLI, and required tooling:

bash -i <(curl -s https://install.aztec.network)

Install the correct toolkit version:

aztec-up 0.87.2

Start the sandboxed environment:

aztec start --sandbox

IMPORTANT

Before running the example, make sure the filler is up and running.

Deploy the Vault

The Vault is a smart contract deployed on Optimism Sepolia that securely receives confidential asset deposits from Aztec via the ERC-7683 bridge. Before accepting a deposit, the Vault verifies a zkPassport proof to ensure the user meets specific eligibility criteria—such as being over 18 years old without revealing any personal data. Only users who successfully provide a valid zero-knowledge proof are allowed to interact with the Vault. In addition to private deposits, the Vault also supports withdrawals, allowing eligible users to retrieve their funds securely and trustlessly.

Build

Deploy

Start the UI

Navigate to src/settings, run the Aztec deployment scripts, and replace the token address in the code with the one just deployed.

Create a .env file in the project root and populate it using the provided .env.example as a reference:

Install Dependencies

Start the Development Server

Last updated