# Creating an account

Algorand offers multiple methods to account creation. In this guide, we explore various methods available for creating accounts on the Algorand blockchain.

Algorand supports multiple account types tailored to different use cases, from simple transactions to programmable smart contracts. [Standalone accounts](https://dev.algorand.co/concepts/accounts/create/#standalone) (single key) are ideal for basic transfers, while [KMD-managed accounts](https://dev.algorand.co/nodes/reference/artifacts#kmd) offer secure key storage for applications. [Multisignature accounts](https://dev.algorand.co/concepts/accounts/multisig) enable shared control with configurable thresholds, and Logic Signature accounts allow for stateless programmatic control by compiling TEAL logic into a dedicated address. This section will explore how to utilize them in `algokit-utils`, `goal`, `algokey`, `SDKs`, and `Pera Wallet`, and the reasons you might want to choose one method over another for your application.

Another approach to account creation is using logic signature accounts, which are contract-based accounts that operate using a logic signature instead of a private key. To create a logic signature account, you write transaction validation logic and compile it to obtain the corresponding address, funding it with the required minimum balance.

Accounts participating in transactions are required to maintain a minimum balance of 100,000 micro Algos. Before using a newly created account in transactions, ensure that it has a sufficient balance by transferring at least 100,000 micro Algos to it. An initial transfer of under that amount will fail due to the minimum balance constraint. Refer [funding an account](https://dev.algorand.co/concepts/accounts/funding) for more details.

## 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. Algorand’s mobile wallet uses standalone accounts. Use the 25-word mnemonic to import accounts into the mobile wallet.

| **When to Use Standalone Accounts** | **When Not 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. | Limited direct import/export options: Developers relying on import and export functions may find kmd more suitable, as [Algokit Utils TypeScript](https://dev.algorand.co/concepts/accounts/create/algokit/utils/typescript/overview) or [Algokit Utils Python](https://dev.algorand.co/concepts/accounts/create/algokit/utils/python/overview) provides import and export capabilities. |
| 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. |  |

### 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 is used for generating, exporting, and importing keys.

```
$ algokey generate

Private key mnemonic: [PASSPHRASE]

Public key: [ADDRESS]
```

#### 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.

- [Utils (TypeScript)](https://dev.algorand.co/concepts/accounts/create/#tab-panel-692)
- [Utils (Python)](https://dev.algorand.co/concepts/accounts/create/#tab-panel-693)

```
/**
 * Create random accounts that can be used for testing or development.
 * Each account will have a newly generated private/public key pair.
 */
const randomAccount = algorand.account.random()
const randomAccount2 = algorand.account.random()
const randomAccount3 = algorand.account.random()
```

```
"""
Create random accounts that can be used for testing or development.
Each account will have a newly generated private/public key pair.
"""
random_account = algorand_client.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.

- [Utils (TypeScript)](https://dev.algorand.co/concepts/accounts/create/#tab-panel-694)
- [Utils (Python)](https://dev.algorand.co/concepts/accounts/create/#tab-panel-695)

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

```
"""
Create an account from an existing mnemonic phrase.
Useful for recovering accounts or using predefined test accounts.
"""
mnemonic_account = algorand_client.account.from_mnemonic(mnemonic="MNEMONIC_PHRASE")
```

#### Pera Wallet

Pera Wallet is a popular non-custodial wallet for the Algorand blockchain.
- [Create a new account on Pera Wallet](https://support.perawallet.app/en/article/create-a-new-algorand-account-on-pera-wallet-1ehbj11/) Getting started on how to create a new Algorand 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.

## KMD-Managed Accounts

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`.

| **When to Use KMD** | **When Not 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 wallet passphrase/mnemonic to regenerate all accounts in the wallet. | Resource Intensive – Running `kmd` requires an active process and storing keys on disk. If you lack access to a node or need a lightweight solution, [Standalone Accounts](https://dev.algorand.co/concepts/accounts/create/#standalone) may be a better option. |
| Enhanced Privacy – There is no way to determine that two addresses originate from the same master derivation key, allowing applications to implement anonymous spending without requiring users to store multiple passphrases. |  |

### 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`](https://dev.algorand.co/nodes/reference/artifacts#goal) or [`kmd`](https://dev.algorand.co/nodes/reference/artifacts#kmd) command line utilities. To run kmd, you need to have the kmd library installed which comes with the node.

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 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.
- [Utils (TypeScript)](https://dev.algorand.co/concepts/accounts/create/#tab-panel-688)
- [Utils (Python)](https://dev.algorand.co/concepts/accounts/create/#tab-panel-689)
```
/**
 * Get or create an account from LocalNet's KMD (Key Management Daemon)
 * by name. If the account doesn't exist, it will be created.
 */
const kmdAccount = algorand.account.fromKmd('ACCOUNT_NAME')
```

```
"""
Get or create an account from LocalNet's KMD (Key Management Daemon)
by name. If the account doesn't exist, it will be created.
"""
kmd_account = algorand_client.account.from_kmd(name="ACCOUNT_NAME")
```

Other operations like creating and renaming wallet can also be performed.
- [Utils (TypeScript)](https://dev.algorand.co/concepts/accounts/create/#tab-panel-690)
- [Utils (Python)](https://dev.algorand.co/concepts/accounts/create/#tab-panel-691)
```
/**
 * Create a wallet with the KMD client.
 */
await algorand.client.kmd.createWallet('ACCOUNT_NAME', 'password')
/**
 * Rename a wallet with the KMD client.
 */
await algorand.client.kmd.renameWallet('ACCOUNT_NAME', 'password', 'NEW_ACCOUNT_NAME')
```

```
"""
Create a wallet with the KMD client.
"""
algorand_client.client.kmd.create_wallet(name="ACCOUNT_NAME", pswd="password")
"""
Rename a wallet with the KMD client.
"""
algorand_client.client.kmd.rename_wallet(
    id="PX2KLH4IVQ25DIU2IVGDWRPJ66RJKOCJ6F7CBCBQA4IXL2GAX645WSG3IQ",
    password="new_password",
    new_name="NEW_ACCOUNT_NAME",
)
```

###### Environment Variable-Based Account Creation

To create an account using an 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.
- [Utils (TypeScript)](https://dev.algorand.co/concepts/accounts/create/#tab-panel-696)
- [Utils (Python)](https://dev.algorand.co/concepts/accounts/create/#tab-panel-697)
```
/**
 * Get or create an account from environment variables.
 * When running against LocalNet, this will create a funded wallet
 * if it doesn't exist.
 */
const envAccount = algorand.account.fromEnvironment('MY_ACCOUNT', (1).algo())
```

```
"""
Get or create an account from environment variables.
When running against LocalNet, this will create a funded wallet
if it doesn't exist.
"""
env_account = algorand_client.account.from_environment(
    name="MY_ACCOUNT", fund_with=AlgoAmount(algo=10)
)
```

#### 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]
```

An offline wallet may not accurately reflect account balances, but the state for those accounts e.g. its balance, online status is safely stored on the blockchain. kmd will repopulate those balances when connected to a node.

#### HD Wallets

Algorand’s Hierarchical Deterministic 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.
