> For the complete documentation index, see [llms.txt](/llms.txt)

# Creating Accounts

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

## Prerequisites

* [Connected to a network](/developers/docs/aztec-js/how_to_connect_to_local_network.md) with a `EmbeddedWallet` instance
* Understanding of [account concepts](/developers/docs/foundational-topics/accounts.md)

## Install dependencies

```bash
yarn add @aztec-labs/aztec.js@6.0.0 @aztec-labs/wallets@6.0.0 @aztec-labs/noir-contracts.js@6.0.0
```

## Create a new account

Using the [`wallet` from the connection guide](/developers/docs/aztec-js/how_to_connect_to_local_network.md), call `createSchnorrAccount` to create a new account with a random secret, salt, and signing key:

```typescript
import { Fr, GrumpkinScalar } from "@aztec-labs/aztec.js/fields";

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

> [Source code: docs/examples/ts/aztecjs\_connection/index.ts#L47-L55](https://github.com/aztec-labs-eng/aztec-node/blob/v6.0.0/docs/examples/ts/aztecjs_connection/index.ts#L47-L55)

The secret derives the account's encryption keys, the signing key authenticates its transactions, and the salt ensures address uniqueness. The signing key is provided independently and is not derived from the secret: it is an ownership key, so keep it separate from the encryption secret that your PXE holds.

Store your secret, salt, and signing key

Save the `secret`, `salt`, and `signingKey` values securely. You need all three 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 FPC](/developers/docs/aztec-js/how_to_pay_fees.md#sponsored-fpc):

```typescript
// Additional imports needed for account deployment examples
import { NO_FROM } from "@aztec-labs/aztec.js/account";
import { SponsoredFeePaymentMethod } from "@aztec-labs/aztec.js/fee/testing";
import { SponsoredFPCContract } from "@aztec-labs/noir-contracts.js/SponsoredFPC";
import { getContractInstanceFromInstantiationParams } from "@aztec-labs/stdlib/contract";

// Set up the Sponsored FPC payment method (see fees guide for details)
const sponsoredFPCInstance = await getContractInstanceFromInstantiationParams(
  SponsoredFPCContract.artifact,
  { salt: new Fr(0) },
);
await wallet.registerContract(
  sponsoredFPCInstance,
  SponsoredFPCContract.artifact,
);
const sponsoredPaymentMethod = new SponsoredFeePaymentMethod(
  sponsoredFPCInstance.address,
);

// newAccount is the account created in the previous section
const deployMethod = await newAccount.getDeployMethod();
await deployMethod.send({
  from: NO_FROM,
  fee: { paymentMethod: sponsoredPaymentMethod },
});
```

> [Source code: docs/examples/ts/aztecjs\_connection/index.ts#L57-L83](https://github.com/aztec-labs-eng/aztec-node/blob/v6.0.0/docs/examples/ts/aztecjs_connection/index.ts#L57-L83)

info

See the [guide on fees](/developers/docs/aztec-js/how_to_pay_fees.md#sponsored-fpc) for more details on the Sponsored FPC and what this snippet means.

### Using Fee Juice

If your account has Fee Juice from a [bridge from L1](/developers/docs/aztec-js/how_to_pay_fees.md#bridge-fee-juice-from-l1), you can claim it and deploy in one step using `FeeJuicePaymentMethodWithClaim`.

Create a new Schnorr account for this path:

```typescript
// `feeJuiceAccount` is just another Schnorr account, the same kind as
// `newAccount` above. It gets its own name here so both deploy paths
// can coexist in one example; in your own code, pick whichever name fits.
const feeJuiceSecret = Fr.random();
const feeJuiceSalt = Fr.random();
const feeJuiceSigningKey = GrumpkinScalar.random();
const feeJuiceAccount = await wallet.createSchnorrAccount(
  feeJuiceSecret,
  feeJuiceSalt,
  feeJuiceSigningKey,
);
```

> [Source code: docs/examples/ts/aztecjs\_connection/index.ts#L85-L97](https://github.com/aztec-labs-eng/aztec-node/blob/v6.0.0/docs/examples/ts/aztecjs_connection/index.ts#L85-L97)

Claim the bridged Fee Juice and deploy in one step:

```typescript
import { FeeJuicePaymentMethodWithClaim } from "@aztec-labs/aztec.js/fee";

// claim is from the bridgeTokensPublic step above
// Create a payment method that claims the bridged Fee Juice and uses it to pay
const bridgePaymentMethod = new FeeJuicePaymentMethodWithClaim(
  feeJuiceAccount.address,
  claim,
);

// Use it to pay for any transaction; here we deploy the account in one step
const deployMethodBridged = await feeJuiceAccount.getDeployMethod();
await deployMethodBridged.send({
  from: NO_FROM,
  fee: { paymentMethod: bridgePaymentMethod },
});
```

> [Source code: docs/examples/ts/aztecjs\_connection/index.ts#L166-L182](https://github.com/aztec-labs-eng/aztec-node/blob/v6.0.0/docs/examples/ts/aztecjs_connection/index.ts#L166-L182)

If the account already has Fee Juice on L2 (for example, from a faucet or a previously claimed bridge), no special payment method is needed — just call `send({ from: NO_FROM })` and Fee Juice is used automatically.

The `from: NO_FROM` signals that this transaction should be executed without account contract mediation. The wallet will directly execute it via a default entrypoint with no authorization.

## Verify deployment

Confirm the account was deployed successfully. Substitute the account variable for whichever path you used above (`newAccount` for the Sponsored FPC path, `feeJuiceAccount` for the Fee Juice path):

```typescript
// `newAccount` refers to whichever account you just deployed,
// either the Sponsored FPC account or `feeJuiceAccount` from the Fee Juice path.
const metadata = await wallet.getContractMetadata(newAccount.address);
console.log("Account deployed:", metadata.initializationStatus);
```

> [Source code: docs/examples/ts/aztecjs\_connection/index.ts#L184-L189](https://github.com/aztec-labs-eng/aztec-node/blob/v6.0.0/docs/examples/ts/aztecjs_connection/index.ts#L184-L189)

## Next steps

* [Deploy contracts](/developers/docs/aztec-js/how_to_deploy_contract.md) with your new account
* [Send transactions](/developers/docs/aztec-js/how_to_send_transaction.md) from an account
* Learn about [account abstraction](/developers/docs/foundational-topics/accounts.md)
* Implement [authentication witnesses](/developers/docs/aztec-js/how_to_use_authwit.md)
