How to Build a Wallet That Supports BRC-20 Tokens
A BRC-20 wallet protects inscribed sats, reads token balances from an indexer, and handles two-step transfers. Here is what to build and what to get wrong.
On this page
Short answer
A BRC-20 wallet is a Bitcoin wallet built to hold tokens that exist as JSON inscriptions on individual satoshis, with balances worked out by off-chain indexers rather than by Bitcoin itself. It needs Taproot addresses, coin control that never spends an inscribed sat by accident, and an indexer that turns inscription history into token balances. Without those three parts, tokens can be lost in an ordinary payment.
What is a BRC-20 wallet?
A BRC-20 wallet is a Bitcoin wallet that can receive, hold and send BRC-20 tokens, which are fungible tokens recorded as JSON text inscribed onto individual satoshis.
BRC-20 was proposed in March 2023 by a pseudonymous developer known as Domo. It builds on Ordinals, a protocol created by Casey Rodarmor that gives every satoshi a serial number and lets data be inscribed onto it. The first inscription was made in December 2022.
A BRC-20 token has three operations, all written as JSON inscriptions: deploy creates the token and its supply rules, mint claims units up to a per-mint limit, and transfer moves units to another address. Bitcoin itself does not enforce any of this. Off-chain indexers read every inscription in order and work out who owns what.
That last point is what makes the wallet different. A normal Bitcoin wallet reads balances from the chain. A BRC-20 wallet must also read balances from an indexer, because the token balances do not exist in Bitcoin's own transaction data.
How is a BRC-20 wallet different from a normal Bitcoin wallet?
A BRC-20 wallet differs from a normal Bitcoin wallet in how it handles addresses, balances, coin selection and transfers, because inscribed sats must never be treated as ordinary coins.
| Area | Normal Bitcoin wallet | BRC-20 wallet |
|---|---|---|
| Address type | Any address works | Taproot (bc1p) addresses for inscriptions |
| Balance source | Bitcoin chain data | Off-chain indexer plus chain data |
| Coin selection | Automatic, any UTXO | Coin control that locks inscribed UTXOs |
| Transfer | One transaction | Two steps: inscribe, then send the UTXO |
| Fees | One fee | Two fees, one per step |
The most dangerous difference is coin selection. A normal wallet picks whichever coins cover the amount. If one of those coins carries an inscription, the inscribed sat can end up paying a miner fee or landing with a stranger, and once it is gone it is gone.
A BRC-20 wallet therefore treats inscribed UTXOs as locked by default. It shows the user each coin separately and refuses to spend a locked coin unless the user confirms the inscription is being moved on purpose.
What parts does a BRC-20 wallet need?
A BRC-20 wallet needs six parts, and skipping any of them leaves tokens at risk or invisible to the user.
- Taproot key management. Inscriptions are received at Taproot addresses, which arrived with the Taproot upgrade in November 2021. The wallet must generate bc1p addresses and sign Taproot transactions.
- An indexer client. The wallet talks to an indexer, such as UniSat, OKX or Best in Slot, to fetch token balances, transferable balances and inscription data for each address.
- UTXO labelling and coin control. Every coin is tagged with what it carries, and inscribed coins are excluded from automatic selection.
- An inscription builder. The wallet creates the two transactions needed to inscribe data: a commit transaction and a reveal transaction.
- PSBT signing. Partially signed Bitcoin transactions let the wallet prepare, review and sign transfers in stages, which matters when a transfer needs two steps.
- Fee estimation for two transactions. Both steps of a transfer need fees, so the wallet must estimate and display the combined cost before the user confirms.
On the interface side, the wallet should show three balances for each token: the available balance, the transferable balance waiting to be sent, and the total. Users who only see one number will misunderstand the two-step transfer. For the basics of how token balances work, see our guide to the BRC-20 token standard.
How does a BRC-20 transfer work?
A BRC-20 transfer works in two steps, because Bitcoin has no smart contract to move the token in one call.
- Inscribe the transfer. The sender creates a JSON inscription that names the token and the amount, using a commit transaction followed by a reveal transaction.
- Indexer updates the balance. Indexers read the new inscription and move the amount from the sender's available balance into a transferable balance.
- Send the inscription UTXO. The sender sends the UTXO carrying that inscription to the recipient's Taproot address.
- Indexer credits the recipient. After the transaction confirms, indexers read the chain and credit the recipient's available balance.
Both steps cost fees, and the transfer is not complete until the second transaction confirms. A wallet must therefore show the transfer as pending between the two steps, and it must handle the case where the user inscribes a transfer but never sends it.
The two-step design also means a transfer can fail in ways an ERC-20 transfer cannot. If the inscription is malformed, if the amount exceeds the available balance, or if the inscription UTXO is spent by mistake, the indexer will ignore the transfer and the tokens stay where they were.
How do you protect inscribed sats?
You protect inscribed sats by making the wallet treat them as distinct objects, not as interchangeable coins, and by giving the user clear warnings before any of them can move.
Start with separate addresses. Keep a receiving address for inscriptions and BRC-20 tokens apart from the address used for everyday spending. That single habit prevents most accidents, because the spending address simply holds no inscribed coins.
Add coin control with locking. The wallet should list every UTXO, mark the ones carrying inscriptions, and lock them so automatic selection never picks them. Freeing a locked coin should need an explicit action and a warning that explains what will be lost.
Never use an inscribed sat to pay a fee. Fee estimation must draw from uninscribed coins only, and the wallet should refuse to build a transaction if no uninscribed coins can cover the fee.
Finally, back up the inscription inventory with the seed phrase. A seed phrase restores the keys, but it does not tell the user which coins carry inscriptions, so the wallet should rebuild that list from the indexer after every restore.
How do you build one, step by step?
You build a BRC-20 wallet by starting with a solid Bitcoin wallet and then adding the inscription and indexer layers on top, in that order.
- Pick the stack. Use a Bitcoin node or a hosted node provider for chain data, and choose an indexer API, such as UniSat or the ord client, for BRC-20 state.
- Build Taproot key management. Generate bc1p addresses, support Taproot signing, and test receiving and spending on testnet before touching real funds.
- Add a UTXO store with flags. Store every coin with its value, address and inscription status, and make coin selection read those flags.
- Sync the indexer. Fetch token balances and inscription lists per address, handle indexer disagreement by checking a second source, and show balances as available and transferable.
- Build the transfer flow. Implement inscribe-then-send as one guided flow with two fee estimates, a pending state, and a clear confirmation screen.
- Test, then audit. Test on signet and testnet with real inscriptions, including failed transfers and accidental-spend attempts, then get the signing and coin-selection code reviewed before launch.
Teams that already ship a Bitcoin wallet can add BRC-20 support as a feature, but the coin-control changes reach into the signing path, so treat it as a core change rather than a display-only addition. For the wider wallet build, see our guide on how to develop a Bitcoin wallet app.
Example (hypothetical): a first BRC-20 transfer in a new wallet
Example (hypothetical): a user holds 1,000 units of a token called DEMO in a new BRC-20 wallet and wants to send 400 units to a friend.
First the wallet inscribes a transfer of 400 DEMO. The commit and reveal transactions cost a combined fee of 0.0002 BTC. The indexer reads the inscription and moves 400 units from the available balance into the transferable balance, leaving 600 units available and 400 units transferable.
Next the wallet sends the UTXO carrying the transfer inscription to the friend's Taproot address. That transaction costs a fee of 0.0001 BTC. After it confirms, the indexer credits the friend with 400 DEMO and the sender's transferable balance drops to zero.
The total fees are 0.0003 BTC, and the sender keeps 600 DEMO. If the user had tried to send the tokens with an ordinary wallet, the inscription could have been spent as a fee and the 400 units lost, which is exactly the accident this wallet design prevents.
What are the common mistakes?
The most common mistakes in BRC-20 wallet development come from treating the token like an ERC-20 token and forgetting that Bitcoin enforces nothing about it.
- Trusting one indexer blindly. Indexers can disagree on rules, so check balances against a second source before showing large amounts as final.
- No coin control. Automatic UTXO selection is the fastest way to lose an inscription to a miner fee.
- Showing one balance. Available and transferable balances are different states, and hiding the difference confuses users mid-transfer.
- Using legacy addresses. Inscriptions belong on Taproot addresses; sending them to legacy or SegWit addresses breaks the flow.
- Skipping testnet. Inscription and two-step transfer bugs only show up with real transactions, so test them on signet first.
- Confusing BRC-20 with Runes. Runes is a separate Bitcoin token standard that arrived at the April 2024 halving; a wallet that supports both must keep their rules apart.
Ordinals explain why inscriptions exist at all, so read our guide to what Bitcoin Ordinals are before designing the inscription flow.
Key takeaways
- A BRC-20 wallet needs Taproot addresses, coin control and an indexer; a normal Bitcoin wallet has none of these
- BRC-20 balances are computed off-chain by indexers, not enforced by Bitcoin consensus
- Transfers take two steps, inscribe then send, and each step costs a fee
- Inscribed sats must be locked from automatic coin selection or they can be lost as fees
- Available and transferable balances are different states and both must be shown
Frequently asked questions
What is a BRC-20 token?
A BRC-20 token is a fungible token recorded as JSON inscriptions on individual satoshis, proposed by Domo in March 2023. It defines deploy, mint and transfer operations as text inscriptions, and off-chain indexers read those inscriptions in order to work out balances.
Which wallets support BRC-20 tokens?
Wallets built for Ordinals support BRC-20 tokens, including UniSat, Xverse, OKX Wallet and Leather. A wallet needs Taproot addresses, coin control that protects inscribed sats, and an indexer that displays token balances.
Why do BRC-20 transfers need two transactions?
Bitcoin has no smart contract to move a BRC-20 token in one call. The sender first inscribes a transfer note, which moves the amount into a transferable balance, and then sends the UTXO carrying that inscription to the recipient. Both steps cost fees.
Can a BRC-20 token be lost?
Yes. If a wallet spends the UTXO carrying an inscription as an ordinary coin or as a fee, the inscription is gone and the token balance disappears with it. Coin control that locks inscribed UTXOs is the main defence.
What is the difference between BRC-20 and Runes?
BRC-20 records tokens as JSON inscriptions and relies on indexers to compute balances. Runes is a separate Bitcoin token standard that arrived at the April 2024 halving and uses a different on-chain model. A wallet can support both, but must keep their rules apart.
Do BRC-20 wallets need a full Bitcoin node?
Not always. A wallet can use a hosted node or API for chain data, but it still needs an indexer for BRC-20 balances, because Bitcoin nodes do not compute token balances. Teams building for production usually run their own indexer or use two providers.