Skip to main content
Version: Devnet (v3.0.0-devnet.20251212)

Creating Accounts

This guide shows you how to create and deploy a new account on Aztec.

Prerequisites

Install dependencies

yarn add @aztec/aztec.js@3.0.0-devnet.20251212 @aztec/test-wallet@3.0.0-devnet.20251212

Create a new account

Use the wallet's createSchnorrAccount method to create a new account with a random secret and salt:

import { Fr } from "@aztec/aztec.js/fields";

const secret = Fr.random();
const salt = Fr.random();
const newAccount = await wallet.createSchnorrAccount(secret, salt);
console.log("New account address:", newAccount.address.toString());

The secret is used to derive the account's encryption keys, and the salt ensures address uniqueness. The signing key is automatically derived from the secret.

Store your secret and salt

Save the secret and salt values securely. You need both to recover access to your account. If you lose them, you will permanently lose access to the account and any assets it holds.

Deploy the account

New accounts must be deployed before they can send transactions. Deployment requires paying fees.

Using the Sponsored FPC

If your account doesn't have Fee Juice, use the Sponsored Fee Payment Contract:

import { AztecAddress } from "@aztec/aztec.js/addresses";

const deployMethod = await newAccount.getDeployMethod();
await deployMethod
.send({
from: AztecAddress.ZERO,
fee: { paymentMethod: sponsoredPaymentMethod },
})
.wait();
info

See the guide on fees for setting up sponsoredPaymentMethod.

Using Fee Juice

If your account already has Fee Juice (for example, bridged from L1):

import { AztecAddress } from "@aztec/aztec.js/addresses";

const deployMethod = await newAccount.getDeployMethod();
await deployMethod
.send({
from: AztecAddress.ZERO,
})
.wait();

The from: AztecAddress.ZERO is required because there's no existing account to send from—the transaction itself creates the account.

Verify deployment

Confirm the account was deployed successfully:

const metadata = await wallet.getContractMetadata(newAccount.address);
console.log("Account deployed:", metadata.isContractInitialized);

Next steps