Skip to content
This new developer portal is under construction. For complete documentation, please refer to the old developer portal.

Creating an account

Algorand offers multiple approaches to account creation, in this guide we’ll explore the various methods available for creating accounts on the Algorand blockchain. Depending on your requirement, consider standalone accounts, wallet-derived accounts using kmd (Key Management Daemon), or multi-signature accounts (which entails one of the prior methods). This section will explore standalone accounts and wallet-derived accounts in-depth, guiding how to utilize them in algokit-utils , goal, algokey, SDKs, and Pera Wallet, the reasons you might want to choose one method over another for your application.

Quick start videos

If you prefer videos, take a look at this 10-minute guide to get started with creating accounts, which also includes using the Pera Algo Wallet.

Standalone

A standalone account is an Algorand address and private key pair that is not stored on disk. The private key is most often in the 25-word mnemonic form.

Reasons to use standalone accounts

  • Low setup cost: No need to connect to a separate client or hardware; all you need is the 25-word human-readable mnemonic of the relevant account.
  • Supports offline signing: Since private keys are not stored on disk, standalone accounts can be used in secure offline-signing procedures where hardware constraints may make using kmd more difficult.
  • Widely supported: Standalone account mnemonics are commonly used across various Algorand developer tools and services.

Reasons not to use standalone accounts

  • Lack of encrypted storage: If you prefer storing keys securely on disk rather than as a 25-word mnemonic, kmd may be a better choice.
  • Limited direct import/export options: Developers relying on import and export functions may find kmd more suitable, as Algokit Utils provides import and export capabilities.

How to generate a standalone account

There are different ways to create a standalone account:

Algokey

Algokey is a command-line utility for managing Algorand keys and it is used for generating, exporting, and importing keys.

$ algokey generate
Private key mnemonic: [PASSPHRASE]
Public key: [ADDRESS]

Algokit Utils

AlgoKit Utils simplifies the creation and management of standalone Algorand accounts in both Python and TypeScript by abstracting the complexities of Algorand SDKs, allowing developers to generate new accounts, retrieve existing ones, and manage private keys securely.

By leveraging AlgoKit Utils, developers can programmatically create accounts without depending on external key management systems, making it ideal for lightweight applications, offline signing, and minimal setup scenarios. AlgoKit Utils offers multiple ways to create and manage standalone accounts.

Random Account Generation

Developers can generate random accounts dynamically, each with a unique public/private key pair.

1
/**
2
* Create random accounts that can be used for testing or development.
3
* Each account will have a newly generated private/public key pair.
4
*/
5
const randomAccount = algorand.account.random()
6
const randomAccount2 = algorand.account.random()
7
const randomAccount3 = algorand.account.random()
Mnemonic-Based Account Recovery

Developers can create accounts from an existing 25-word mnemonic phrase, allowing seamless account recovery and reuse of predefined test accounts.

1
/**
2
* Create an account from an existing mnemonic phrase.
3
* Useful for recovering accounts or using predefined test accounts.
4
*/
5
const mnemonicAccount = algorand.account.fromMnemonic('mnemonic words...')

Pera Wallet

Pera Wallet is a popular non-custodial wallet for the Algorand blockchain. For more details, refer to the guided tutorial on How to create a new account on Pera Wallet.

Vault Wallet

Hashicorp Vault implementation can also be used for managing Algorand standalone accounts securely. By leveraging Vault, you can store private keys and 25-word mnemonics securely, ensuring sensitive data is protected from unauthorized access. This implementation provides a streamlined way to create and manage standalone accounts while maintaining best practices for key management.

The integration is particularly useful for developers and enterprises seeking a secure, API-driven approach to manage Algorand accounts at scale, without relying on local storage or manual handling of sensitive credentials.

Wallet-derived

The Key Management Daemon is a process that runs on Algorand nodes, so if you are using a third-party API service this process likely will not be available to you. kmd is the underlying key storage mechanism used with goal.

Reasons to use kmd

  • Single Master Derivation Key: Public/private key pairs are generated from a single master derivation key. You only need to remember the single mnemonic that represents this master derivation key (i.e. the wallet passphrase/mnemonic) to regenerate all of the accounts in that wallet.

  • Enhanced Privacy: There is no way for someone else to determine that two addresses are generated from the same master derivation key. This provides a potential avenue for applications to implement anonymous spending for end users without requiring users to store multiple passphrases.

Reasons not to use kmd

  • Resource Intensive: Using kmd requires running a process and storing keys on a disk. If you do not have access to a node or you require a more lightweight solution, Standalone Accounts may be a better-suited option.

How to use kmd

Start the kmd process

To initiate the kmd process and generate the required kmd.net and kmd.token files use goal kmd or kmd command line utilities.

Start kmd using goal with a 3600-second timeout.

$ goal kmd start -t 3600
Successfully started kmd

Kmd can directly be used using the following command

$ kmd -d data/kmd-v<version>/ -t 3600

Once the kmd has started, retrieve the kmd IP address and access token:

$ echo "kmd IP address: " `cat $ALGORAND_DATA/kmd-v<version>/kmd.net
kmd IP address: [ip-address]:[port]
$ echo "kmd token: " `cat $ALGORAND_DATA/kmd-v<version>/kmd.token
kmd token: [token]

Create a wallet and generate an account

Wallet and account can be created using different ways.

goal

Following are the commands to create a new wallet and a generate an account using goal,

$ goal wallet new testwallet
Please choose a password for wallet 'testwallet':
Please confirm the password:
Creating wallet...
Created wallet 'testwallet'
Your new wallet has a backup phrase that can be used for recovery.
Keeping this backup phrase safe is extremely important.
Would you like to see it now? (Y/n): y
Your backup phrase is printed below.
Keep this information safe -- never share it with anyone!
[25-word mnemonic]
$ goal account new
Created new account with address [address]
Algokit Utils
  • KMD client based Account Creation: We can also use the utils to create a wallet and account with the KMD client.
    1
    /**
    2
    * Get or create an account from LocalNet's KMD (Key Management Daemon)
    3
    * by name. If the account doesn't exist, it will be created.
    4
    */
    5
    const kmdAccount = algorand.account.fromKmd('ACCOUNT_NAME')

Other operations like creating and renaming wallet can also be performed.

1
/**
2
* Create a wallet with the KMD client.
3
*/
4
await algorand.client.kmd.createWallet('ACCOUNT_NAME', 'password')
5
6
/**
7
* Rename a wallet with the KMD client.
8
*/
9
await algorand.client.kmd.renameWallet('ACCOUNT_NAME', 'password', 'NEW_ACCOUNT_NAME')
  • Environment Variable-Based Account Creation: To create an account using environment variable will load the account from a KMD wallet called name. When running against a local Algorand network, a funded wallet can be automatically created if it doesn’t exist.
1
/**
2
* Get or create an account from environment variables.
3
* When running against LocalNet, this will create a funded wallet
4
* if it doesn't exist.
5
*/
6
const envAccount = algorand.account.fromEnvironment('MY_ACCOUNT', (1).algo())

Recover wallet and regenerate account

To recover a wallet and any previously generated accounts, use the wallet backup phrase (also called the wallet mnemonic or passphrase). The master derivation key for the wallet will always generate the same addresses in the same order. Therefore the process of recovering an account within the wallet looks exactly like generating a new account.

$ goal wallet new -r <recovered-wallet-name>
Please type your recovery mnemonic below, and hit return when you are done:
[25-word wallet mnemonic]
Please choose a password for wallet [RECOVERED_WALLET_NAME]:
Please confirm the password:
Creating wallet...
Created wallet [RECOVERED_WALLET_NAME]
$ goal account new -w <recovered-wallet-name>
Created new account with address [RECOVERED_ADDRESS]

HD Wallets

Algorand’s Hierarchical Deterministic (HD) wallet implementation, based on the ARC-0052 standard, enables the creation of multiple accounts from a single master seed. The API implementations are in TypeScript, Kotlin, and Swift, providing a consistent and efficient solution for managing multiple accounts with a single mnemonic.

HD wallets are especially beneficial for applications that require streamlined account generation and enhanced privacy. By using this approach, developers can ensure all accounts are deterministically derived from a single seed phrase, making wallet management more convenient for both users and applications.