Wallets & Accounts

Introduction
Stacks wallets are software or hardware tools for storing cryptocurrencies, NFTs, and other digital assets. They are also used for establishing on-chain identity in decentralized applications (dApps). These wallets cryptographically store and manage each user’s identity and funds through a single blockchain address, which leverage public-key cryptography.
Purpose of a Stacks wallet
Establish User Identity
Store Assets
Display Balances
Sign Transactions
Sign Messages
Participate in the Bitcoin Economy
Wallets in Stacks consists of accounts, which uses an accounts-based model, rather than a UTXO model like Bitcoin. This model is simpler than the UTXO model and has a more traditional concept of “balance”, similar to what you would encounter at a bank. In this model, each address has a single “balance” figure for a given token that increases/decreases as transactions are sent to/from that account. This is what most Web3 ecosystems use. In a UTXO model, the network operates as a ledger, with each UTXO being analogous to a cash bill.
Components of a Stacks account
Private Key - The private key is an alphanumeric code that is paired to a single public key on a 1:1 basis. Never share your private key with anyone. A private key is how you prove ownership of a public key and how you can spend assets held by that particular key-pair. Example private key in Stacks (32 bytes appended with a 0x01 byte):
5a4133fec2cf923d37238d3ba2fcd2ee9c8dce882c22218fd210d8a02ceb2c7401Public Key - The public key is derived mathematically from the private key. It can be shared safely and is used by the network to verify signatures created by the private key, without revealing the private key itself. Example public key in Stacks (compressed format):
02e8eb87862945d369511fdcce326ffef9a01b68c7d070e3ce685a5cbb9b1ecfc5Address (Principal) - The address is a shorter, user-friendly representation derived from the public key. It’s what you share to receive sBTC, STX, tokens, or NFTs on Stacks, and it acts as the on-chain identifier for the user. Example public address in Stacks (c32check encoding):
SPM9G3CNGSCTB4956290NESM0MR9W9CCEPVEPSQC
Stacks accounts are entities that own assets, like Stacks (STX) tokens. An account has an address, private key, nonce, and one or more asset balances. Assets cannot leave an account without an action from the account owner. All changes to assets (and the balances of the account) require a corresponding transaction.
All Stacks wallets also support Bitcoin addresses, enabling seamless participation across both the Stacks and Bitcoin ecosystems.
Creation
An wallet's accounts are generated from a 24-word mnemonic phrase conforming to the BIP39 standard. This is often referred to as the seed phrase. The seed phrase provides access to Stacks accounts.
If the seed phrase is lost, access to the associated account cannot be restored. No person or organization can recover a lost seed phrase.
The easiest way to generate a new Stacks account is to use the Stacks CLI:
make_keychain creates the following file:
mnemonic
A 24-word seed phrase used to access the account, generated using BIP39 with 256 bits of entropy
keyInfo.privateKey
Private key for the account. Required for token transfers and often referred to as senderKey
keyInfo.address
Stacks address for the account
keyInfo.btcAddress
Corresponding BTC address for the account.
keyInfo.wif
Private key of the btcAddress in compressed format.
keyInfo.index
Nonce for the account, starting at 0
Note that a new account automatically exists for each new private key. There is no need to manually instantiate an account on the Stacks blockchain.
Alternatively to the CLI creation, the Stacks Transactions JS library can be used:
Finally, you can generate new account using a Stacks-enabled wallet like Leather, Xverse, or Asigna.
Handling different formats
It's common for new Stacks developers to get tripped up on the different ways when specifying Stacks' principals (aka addresses) in their development.
Here's a breakdown of dealing with principals in 3 different use cases.

The Stacks and Bitcoin address connection
What makes Stacks beautifully connected to its L1 settlement layer, Bitcoin, is their many shared aspects. One being how both utilize a similar address generation scheme based on the P2PKH format, which allows for both a Bitcoin & Stacks address to share the same public key hash. If you base58check decode a legacy bitcoin address, you can reveal the public key hash, which can then be used to generate its respective c32check encoded Stacks address.
Programmatically, you could also use a method called b58ToC32, from the c32check javascript library, which can abstract the conversion for you.

Additional Resources
Last updated
Was this helpful?
