Skip to main content
Version: 0.16

Account Components

Standard account components are prebuilt modules you can compose into accounts. They give an account a recognizable interface, such as "can receive assets", "can authenticate with this signature scheme", "can mint fungible tokens", or "uses this access-control model".

Use these components from Rust when you build accounts with the SDK, or import the underlying MASM modules when you are writing lower-level account code. The same standards surface is what note scripts and transaction scripts rely on when they call account procedures.

Common standards surfaces​

SurfaceUse it forRust module
BasicWalletHolding assets, receiving assets from standard notes, and moving assets into output notes.miden_standards::account::wallets
FungibleFaucetMinting, sending, receiving, and burning fungible assets from faucet accounts.miden_standards::account::faucets
AuthSingleSigSingle-signature authentication of transactions.miden_standards::account::auth
AuthMultisig / AuthMultisigSmartThreshold or policy-aware multisig authentication.miden_standards::account::auth
AuthGuardedMultisigMultisig guarded by a guardian configuration.miden_standards::account::auth
AuthNetworkAccountAuthentication through note- and transaction-script allowlists for network accounts.miden_standards::account::auth
Ownable2StepAccess control for account owners.miden_standards::account::access
RoleBasedAccessControlRole-based authorization for protected account procedures.miden_standards::account::access
AuthorityShared authority component for protecting administrative changes.miden_standards::account::access
TokenPolicyManagerRegistering and updating mint, burn, send, and receive token policies.miden_standards::account::policies
BasicBlocklistBlocking specific native accounts in send and receive transfer-policy checks.miden_standards::account::policies
BasicAllowlistAllowing only specific native accounts in send and receive transfer-policy checks.miden_standards::account::policies

These are building blocks. They do not prevent you from adding custom components to the same account.

Start with wallet and auth​

Most regular accounts need:

  • an authentication component, such as AuthSingleSig or AuthMultisig
  • the BasicWallet component

AuthSingleSig controls transaction authorization. BasicWallet exposes the standard wallet procedures used by common notes, including the ability to receive assets and move assets into output notes.

Compose a regular account with standard auth and wallet components
use miden_client::{
account::{AccountBuilder, AccountType, component::BasicWallet},
auth::{Approver, AuthSchemeId, AuthSingleSig},
};
use miden_protocol::{account::auth::PublicKeyCommitment, Word};

fn build_wallet_account() -> Result<(), Box<dyn std::error::Error>> {
let public_key = PublicKeyCommitment::from(Word::from([1, 2, 3, 4u32]));

let account = AccountBuilder::new([1; 32])
.account_type(AccountType::Public)
.with_component(AuthSingleSig::new(Approver::new(
public_key,
AuthSchemeId::Falcon512Poseidon2,
)))
.with_component(BasicWallet)
.build()?;

assert!(account.is_public());
Ok(())
}

For authentication details, see Authentication. For how component methods are authored in Rust, see Components.

Check note compatibility​

Standard notes assume the consuming account exposes the procedures they need. For example, P2ID and P2IDE notes need a wallet-compatible account that can receive assets. SWAP notes additionally need the wallet procedure that moves the requested asset into the payback note.

At the builder level, the practical rule is:

  • Add BasicWallet to accounts that should receive standard asset-transfer notes.
  • Add FungibleFaucet together with TokenPolicyManager to faucet accounts that should mint or burn fungible assets.
  • For local or user accounts, add an auth component to reject unauthorized transactions.
  • For network accounts, use AuthNetworkAccount to restrict the allowed note and transaction scripts.

Prefer building on top of BasicWallet: compose it with a custom extension component for application-specific methods. If you replace the wallet interface entirely, test consumption of the relevant standard notes deliberately.

Rust and MASM entry points​

Rust APIs are the usual entry point for account composition. MASM modules are available when you need exact low-level behavior.

AreaRust moduleMASM module family
Walletsmiden_standards::account::walletsmiden::standards::wallets::*
Authenticationmiden_standards::account::authmiden::standards::auth::*
Access controlmiden_standards::account::accessmiden::standards::access::*
Faucetsmiden_standards::account::faucetsmiden::standards::faucets::*
Policiesmiden_standards::account::policiesmiden::standards::faucets::policies::*
Inspectionmiden_standards::account::inspectionmiden::standards::inspection::*

Reach for MASM directly when you are implementing low-level behavior, integrating a custom component with a standard procedure, or verifying exact stack effects.