Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

aztec-account

Account abstraction: traits, concrete account implementations, entrypoints, authorization, and deployment.

Source: crates/account/src/.

Module Map

ModuleHighlights
accountCore traits (Account, AccountContract, AuthorizationProvider), AccountManager<W>, AccountWithSecretKey, deployment types (DeployAccountMethod, DeployAccountOptions, DeployResult, InitializationSpec, EntrypointOptions, TxExecutionRequest), get_account_contract_address
authorizationCallAuthorizationRequest
entrypointDefaultAccountEntrypoint, DefaultAccountEntrypointOptions, DefaultMultiCallEntrypoint, AccountFeePaymentMethodOptions, EncodedAppEntrypointCalls, encoding helpers
schnorrSchnorrAccountContract, SchnorrAccount, SchnorrAuthorizationProvider
signerlessSignerlessAccount (no-signature account for deployment bootstrap / tests)
meta_paymentAccountEntrypointMetaPaymentMethod — payment method that reuses the account’s own entrypoint
single_account_providerSingleAccountProvider — wrap one account to satisfy AccountProvider for BaseWallet

Core Traits

pub trait AuthorizationProvider: Send + Sync {
    // Sign / assemble authorization witnesses for a given call set.
}

pub trait Account: Send + Sync + AuthorizationProvider {
    // The user-facing account: knows its address, entrypoint, and auth.
}

pub trait AccountContract: Send + Sync {
    // The deployable contract that implements the account logic on-chain.
}

Account composes AuthorizationProvider — authorization is the part that varies per signing scheme (for example Schnorr, signerless, or a custom downstream implementation).

Account Flavors

FlavorType(s)Signing
SchnorrSchnorrAccount, SchnorrAccountContract, SchnorrAuthorizationProviderGrumpkin Schnorr (default Aztec account)
SignerlessSignerlessAccountNone — used during deployment bootstrap and for test accounts

ECDSA account flavors live in the Aztec ecosystem but are not currently shipped from this crate; contributions welcome.

AccountManager

AccountManager<W> is the high-level helper for the account lifecycle:

use aztec_account::{AccountManager, DeployAccountOptions, SchnorrAccountContract};
use aztec_wallet::SendOptions;
use aztec_core::types::Fr;

let secret_key = Fr::from(12345u64);
let contract = SchnorrAccountContract::new(secret_key);
let manager = AccountManager::create(
    wallet,
    secret_key,
    Box::new(contract),
    None::<Fr>,
)
    .await?;
let deploy = manager.deploy_method().await?;
let result = deploy
    .send(&DeployAccountOptions::default(), SendOptions::default())
    .await?;
println!("account address = {}", result.instance.address);

DeployAccountMethod is the builder behind deploy_method; you can drive it explicitly to customize fee payment, simulation, or send options.

Entrypoints

  • DefaultAccountEntrypoint — single-call entrypoint used by most account contracts.
  • DefaultMultiCallEntrypoint — batches multiple calls into one tx.
  • EncodedAppEntrypointCalls — the wire-format call array produced by either entrypoint.
  • AccountFeePaymentMethodOptions — fee-payment opts carried through the entrypoint.

Authorization

CallAuthorizationRequest encapsulates everything an AuthorizationProvider needs to produce AuthWitness values for a simulated tx: the call list, origin, nonce, and any required context.

Providers

SingleAccountProvider adapts a single Account into the AccountProvider abstraction that BaseWallet consumes.

Full API

Bundled rustdoc: api/aztec_account/. Local regeneration:

cargo doc -p aztec-account --open

See Also