Course outline · 13 lessons
Bitcoin Wallets & Self-Custody

Bitcoin Address Types and Derivation Paths

An open blank cream booklet with four ribbon bookmarks lies on a pale wooden table.

The first characters of a Bitcoin address tell you its type: 1 is Legacy, 3 is a script address (Nested SegWit, in a single-key wallet), bc1q is Native SegWit and bc1p is Taproot. A derivation path is the route a wallet follows from your recovery words to those addresses, and an app that follows a different route finds a different set of addresses, usually empty ones. With these two ideas you can check an address before you send to it, choose the type that costs you least in fees, and handle the most common scare in self-custody: restoring your words and seeing a balance of zero. Usually the coins are safe on the blockchain and the wallet is looking in the wrong place.

This lesson builds on Seed Phrases Explained, which showed how words become keys. If public keys and addresses are new to you, read Keys, Addresses and Signatures in Plain Language first.

Four Address Types on One Network

An address is a short way of writing down a locking script: the rule that says what it takes to spend the coins sent to it. Bitcoin has gained new kinds of locking script over the years, each with its own address format. All four below work on the same network today, and you can send from any type to any other, as long as the sending software knows the newer formats (more on that below).

Starts with Common name Technical name In use since Worth knowing
1 Legacy P2PKH (pay to public key hash) 2009 The original; the most expensive to spend from
3 Nested SegWit, in a single-key wallet P2SH (pay to script hash); here P2SH-P2WPKH, SegWit wrapped inside a script address 2017 (script addresses since 2012) A bridge for older software; a 3 address can also be a multisig wallet, one that needs several keys to spend
bc1q Native SegWit P2WPKH (42 characters); P2WSH, usually multisig (62 characters) August 2017 A common default today
bc1p Taproot P2TR (pay to Taproot) November 2021 Always 62 characters; the cheapest to spend from

SegWit (Segregated Witness) moved signatures into a separate part of the transaction that counts at a discount, which made spending cheaper; it activated at block 481,824 on 24 August 2017. Taproot, which added a newer signature scheme (Schnorr signatures) and the bc1p format, activated at block 709,632 on 14 November 2021.

One Set of Words, Four Separate Wallets

The demonstration phrase from the seed-phrase lesson, abandon abandon … abandon about, gives these first receiving addresses on the four standard paths:

  • Legacy (m/44'/0'/0'/0/0): 1LqBGSKuX5yYUonjxT5qGfpUsXKYYWeabA
  • Nested SegWit (m/49'/0'/0'/0/0): 37VucYSaXLCAsxYyAPfbSi9eh4iEcbShgf
  • Native SegWit (m/84'/0'/0'/0/0): bc1qcr8te4kr609gcawutmrza0j4xv80jy8z306fyu
  • Taproot (m/86'/0'/0'/0/0): bc1p5cyxnuxmeuwuvkwfem96lqzszd02n6xdcjrs20cac6yqjjwudpxqkedrcr

Same twelve words, four unrelated addresses. Each path leads to its own family of addresses with its own balance, so one set of words can hold several wallets side by side, and an app that checks only one of them shows only that one’s coins. These words are public, so anyone can spend whatever lands at these addresses: read them, never fund them.

Your 12 or 24 words make one master key, which branches into four standard paths: m/44'/0'/0' for Legacy addresses starting with 1, m/49'/0'/0' for Nested SegWit starting with 3, m/84'/0'/0' for Native SegWit starting with bc1q and m/86'/0'/0' for Taproot starting with bc1p. In this example your coins sit on the Nested SegWit branch, but the app looks at the Native SegWit branch and shows a balance of 0. The coins are safe: choosing Nested SegWit makes them appear.
One set of words, four separate wallets. Each address type has its own branch and its own balance. An app looking at one branch shows only that branch’s coins, so a restore can show zero while your coins sit safely on another.

How to Read an Address

Addresses Starting With bc1

Take bc1qcr8te4kr609gcawutmrza0j4xv80jy8z306fyu apart:

  • bc means Bitcoin’s main network.
  • 1 is a separator.
  • The next character is the version: q stands for version 0 (SegWit) and p for version 1 (Taproot). Hence the names bc1q and bc1p.
  • The long middle part is the data: in a single-key wallet, it is made from your public key.
  • The last six characters are a checksum, a built-in error check calculated from everything before it.

After the separator these addresses use only digits and letters, and never 1, b, i or o: the characters were chosen to avoid look-alikes. They are normally written in lowercase. Capitals are allowed, but only for the whole address: the standard recommends them inside QR codes, where they pack more tightly, and BC1QCR8TE… is the same address. A mix of capitals and lowercase is invalid.

The address bc1qcr8te4kr609gcawutmrza0j4xv80jy8z306fyu split into its parts: bc means Bitcoin's main network; 1 is a separator; q is the version, 0, which means Native SegWit (p, version 1, would mean Taproot); the long middle part is the data, made from your public key; the last six characters, 306fyu, are a checksum that catches typos. After the 1 there are only digits and letters, never 1, b, i or o. Below, the same address in lowercase and in all capitals is valid either way, as in QR codes, while a mix of capitals and lowercase is invalid.
Every part of a bc1 address has a job. The fourth character tells you the type: q for Native SegWit, p for Taproot. The last six catch typos, but only a careful comparison tells you it’s the right address.

Addresses Starting With 1 or 3

These use an older encoding called Base58, which mixes capitals and lowercase and leaves out the look-alikes 0, O, I and l. Here capitals matter, so copy and paste rather than retype. A checksum is hidden inside these too.

What a Checksum Catches, and What It Can’t

Checksums catch typing mistakes. In a bc1 address, up to four wrong characters are guaranteed to be caught; in a 1 or 3 address, a random typo slips through only about once in four billion tries.

A checksum can’t tell whether an address is the right one, though. Malware that swaps a copied address, and scammers who plant look-alike addresses in your transaction history (address poisoning), use perfectly valid addresses. The protection is to compare the whole address, ideally on your hardware wallet’s own screen, as in How to Set Up a Hardware Wallet. The Scams That Empty Self-Custody Wallets covers these attacks.

Strings That Look Like Addresses but Aren’t

  • lnbc… is a Lightning invoice and lno… a reusable Lightning offer: pay them from a Lightning wallet.
  • tb1…, or Base58 strings starting with m, n or 2, belong to Bitcoin’s test networks, whose coins have no real-world value.
  • 0x… belongs to another blockchain. Bitcoin addresses start with 1, 3 or bc1. Your First Withdrawal shows why this matters when an exchange offers “BTC” on other networks.
  • xpub…, ypub…, zpub… are extended public keys, explained below. They reveal every address in a wallet, so they stay out of withdrawal forms.

Which Address Type Should You Use Today?

Fees by Type

Fees are charged by a transaction’s size in virtual bytes (vB), at a fee rate in satoshis per vB that rises and falls with demand. Each coin you spend is an input; each payment or change amount you create is an output. These sizes come from Bitcoin Optech’s transaction size calculator, with the Nested SegWit row worked out by the same method:

Type Spending one coin (input) One payment or change (output) One coin in, two out, all this type
Legacy (1) 148 vB 34 vB 226 vB
Nested SegWit (3) 91 vB 32 vB about 166 vB
Native SegWit (bc1q) 68 vB 31 vB about 141 vB
Taproot (bc1p) 57.5 vB 43 vB 154 vB

At an example fee rate of 10 sat/vB, that typical payment costs 2,260 sats from Legacy and about 1,410 sats from Native SegWit: nearly 40% less.

Bars for a payment that spends one coin and creates two outputs, a payment and your change. Legacy: 10 vB overhead, a 148 vB input and two 34 vB outputs, 226 vB in all, 2,260 sats at an example 10 sat/vB. Nested SegWit: a 91 vB input and two 32 vB outputs, about 166 vB, about 1,660 sats. Native SegWit: a 68 vB input and two 31 vB outputs, about 141 vB, about 1,410 sats. Taproot: a 57.5 vB input and two 43 vB outputs, 154 vB, 1,540 sats. From Legacy to Native SegWit the same payment costs nearly 40% less.
The address type sets the size, and the size sets the fee. Taproot has the smallest input but bigger outputs, so for this everyday payment Native SegWit comes out a little cheaper.

Between Native SegWit and Taproot it’s closer. The person paying you covers the output that creates your coin; you cover the input when you later spend it. Compared with a bc1q address, a Taproot address costs your sender 12 vB more and saves you 10.5 vB per coin you spend, so over one coin’s life the two come out about even. Taproot pulls ahead when you spend several coins at once: combining ten coins into one output takes about 722 vB from Native SegWit and about 629 vB from Taproot.

A coin's life has two parts. The person who pays you covers the output that creates your coin: 31 vB for a Native SegWit address, 43 vB for Taproot. You cover the input when you spend it: 68 vB for Native SegWit, 57.5 vB for Taproot. In total, 99 vB against 100.5 vB: about even. Spending ten coins at once into one output takes about 722 vB from Native SegWit and about 629 vB from Taproot, because each Taproot input is 10.5 vB smaller.
Native SegWit or Taproot: about even for one coin, Taproot ahead for many. Your sender pays for the output that creates your coin and you pay for the input that spends it. Taproot’s smaller input wins once you spend several coins together.

The Recommendation

  • For receiving, Native SegWit (bc1q) is the safe default. It has been standard since 2017, it is widely supported, and it gives the smallest everyday payment. Sparrow uses it by default, and so do Electrum’s own new wallets.
  • Taproot (bc1p) is a good choice when your whole setup supports it: your wallet app, your hardware wallet and the services that pay you. Besides cheaper inputs, Taproot was designed so that more kinds of wallet look alike on the blockchain, which helps privacy.
  • Keep existing Legacy and Nested SegWit coins, and stop creating new addresses of those types. Coins at 1 and 3 addresses are safe and spendable, and there’s no rush to move them. If you do, move them when fees are low, and read UTXO Management and Coin Control first, because combining coins in one transaction links them publicly.

When a form rejects your bc1p address. Taproot addresses use an updated checksum called bech32m; bc1q addresses keep the older one, bech32. Software that only knows bech32 sees a bc1p address as invalid and refuses it. The standard’s authors chose this on purpose, so that old software stops instead of losing coins. If an exchange rejects a bc1p address you copied from your wallet, first check that its network menu says Bitcoin (see Your First Withdrawal). If it does, your address is fine: give that service a bc1q address from a Native SegWit wallet made from the same words.

Derivation Paths: From Your Words to Your Addresses

Your words produce one master key, and every key in your wallet is calculated from it along a derivation path. Read m/84'/0'/0'/0/7 as: the Native SegWit family (84), Bitcoin (0), the first account (0), the receiving branch (0), the eighth address (7, counting from 0). An account is a separate set of addresses under the same words; wallets start with account 0. What Is a Bitcoin Wallet? explains the levels; here is how each standard path pairs with an address type:

Standard Account path Address type Account key usually shown as
BIP44 m/44'/0'/0' Legacy (1) xpub
BIP49 m/49'/0'/0' Nested SegWit (3) ypub
BIP84 m/84'/0'/0' Native SegWit (bc1q) zpub
BIP86 m/86'/0'/0' Taproot (bc1p) xpub

Multisig wallets usually follow a separate standard, BIP48, covered in Multisig Wallets Explained. The apostrophe marks a hardened step, a firewall in the tree: a key leaked from one account can’t be used to work out the keys of another account or of the master key. The last two steps aren’t hardened, which is what lets an account’s public key calculate all of its addresses.

The path m/84'/0'/0'/0/7 step by step. m is the master key, made from your words; 84' is the Native SegWit family; 0' is Bitcoin; 0' is the first account, one of several. These steps need your words, and the apostrophe marks each hardened step. They produce the account key. Then 0 is the receiving branch (1 would be change) and 7 is the eighth address, counting from 0. These two steps aren't hardened, so the account's public key, shown as an xpub or zpub, calculates every address in the account. The way back is blocked: even if the account key leaks, it can't be used to work out the master key or another account.
The apostrophe is a firewall. Only your words get through the hardened steps down to an account. From there, the account’s public key calculates every address, but nothing leads back up past the account.

Path and Address Type Must Both Match

Some wallets ask for the path and the address type separately, and both must match the wallet that received your coins. The key at m/84'/0'/0'/0/0 of the demonstration phrase gives bc1qcr8te…306fyu as Native SegWit. Shown as a Legacy address, the very same key gives 1JaUQDVNRdhfNsVncGkXedaPSM5Gc54Hso: a different, empty address.

xpub, ypub, zpub and Output Descriptors

An extended public key is an account’s public key plus the extra data needed to calculate all its addresses, but none of its spending keys. The labels xpub, ypub and zpub are different prefixes on the same kind of key: for the demonstration phrase, zpub6rFR7y4Q…AGutZYs and xpub6CatWdiZ…rjPC7PW6V are the same account key under two labels. The label hints at the address type, but only hints: Taproot has no label of its own and reuses plain xpub, and output descriptors (next) always write plain xpub, so an xpub alone can’t tell Legacy from Taproot.

An output descriptor removes the guesswork: one line naming the address type, the master key’s fingerprint, the path and the extended key. Shortened, the demonstration phrase’s Taproot receiving addresses are:

tr([73c5da0a/86h/0h/0h]xpub6BgBgses…MMj92pReUsQ/0/*)

Here tr means Taproot (Native SegWit would be wpkh), 73c5da0a is the master fingerprint, a short identifier of the master key and so of the words plus any passphrase, 86h/0h/0h is the path with h in place of the apostrophe, and /0/* means every address on the receiving branch. A descriptor can’t spend, but it reveals all your addresses and history, so keep it private. For a single-key wallet it’s an optional note that saves guesswork later; for multisig it’s essential, as Multisig Wallets Explained shows.

The descriptor tr([73c5da0a/86h/0h/0h]xpub6BgBgses…MMj92pReUsQ/0/*) split into its parts: tr is the address type, Taproot; 73c5da0a is the master fingerprint, which identifies your words and any passphrase; 86h/0h/0h is the path to the account, with h marking a hardened step; xpub6BgBgses…MMj92pReUsQ is the account's extended public key; /0/* means every address on the receiving branch. It is everything a wallet needs to find your coins, in one line; it can't spend, but it reveals every address, so keep it private.
A descriptor writes down where your coins are. Address type, master fingerprint, path and extended key, in one line. It can’t spend, but it reveals all your addresses, so keep it private.

Gap Limits and Accounts: Why a Restore Can Stop Too Soon

When you restore, the wallet checks your addresses one by one and stops after a run of unused ones, called the gap limit. The BIP44 standard sets it at 20, and Sparrow and Electrum use 20 for receiving addresses. If you once handed out many addresses that were never paid, for example on invoices, and a later one was paid, the scan can stop before reaching it. Raise the limit and the coins appear: in Sparrow, open the wallet’s Settings tab, click Advanced, raise the gap limit, then click Close and Apply; in Electrum, turn on the Console tab from the View menu and type wallet.change_gap_limit(100). A higher limit only makes scanning slower.

Receiving addresses numbered 0 to 24. Addresses 0 to 3 received payments; 4 to 23 were handed out but never paid, 20 unused in a row; address 24 was paid later. With the usual gap limit of 20, the restore stops after address 23 and never checks address 24, so that coin is missing from the balance. With the gap limit raised to 100, the scan keeps going, finds address 24 and the coin appears. Nothing was lost; a higher limit only makes the scan slower.
A restore stops after 20 unused addresses in a row. A coin paid to an address beyond that run stays out of view until you raise the gap limit.

Accounts work the same way one level up. If you used a second account (account 1) in your old wallet, a wallet that checks only account 0 won’t show it; the BIP44 search even stops at the first account with no transactions. Add the account manually.

Part of your balance also sits on change addresses, the second branch, which you may never have seen. That’s why the address you remember can look empty while the wallet’s total is correct (see Why Does My Bitcoin Address Keep Changing?).

Your Restore Shows Zero: A Calm Checklist

Keep the words where they are: savings words belong only on your hardware wallet, and nobody offering “recovery help” in a chat or email needs them. Then work through these in order:

  1. Check that the wallet is connected and has finished syncing. A wallet that can’t reach its server shows zero too.
  2. Check the words and the kind of phrase. Compare each word and its number with your backup: a wrong or swapped word usually fails the checksum, but not always. A 20-word Trezor backup, an Electrum seed or a Lightning wallet’s words may not restore in this wallet at all (next section).
  3. Check the passphrase, if you added one to your words. A missing or misspelled one, down to capitals and spaces, opens a valid but different wallet with no error message. If you noted your master fingerprint, compare it: a different fingerprint means different words or a different passphrase.
  4. Find the address type. Look up an address you once received to, for example in your exchange’s withdrawal history. Its first characters tell you the type: 3 means Nested SegWit, bc1p means Taproot.
  5. Check the path and account. Use the standard path for that type, add account 1 if you used one, and look up wallet-specific paths on Wallets Recovery.
  6. Raise the gap limit.

Try address types without exposing your words. With a hardware wallet, connect it to Sparrow or Electrum and create a wallet from the device for each address type to try: the device hands over only extended public keys. Sparrow (version 2.4 or later) can search for you: choose File → Import Wallet, click Scan for Connected Devices, open the menu beside Import Keystore and choose Discover Wallet. It checks every address type your device supports, and as many accounts as you ask for, for past transactions. It needs an Electrum server, the kind of server that answers wallets’ questions about their addresses (a public one or your own), so it doesn’t work when Sparrow connects directly to Bitcoin Core. Every lookup tells that server, or any block explorer (a website that shows what’s on the blockchain) you check, which addresses interest you, so where you can, use your own node: a computer running Bitcoin software with its own copy of the blockchain (Network Privacy: Tor, VPNs and Your Own Node).

Which Kind of Recovery Phrase Do You Have?

Seed Phrases Explained introduced the recovery phrases that aren’t BIP39. This table gathers them with a few more, so you can tell what you’re holding before you restore it.

What you have How to recognise it Where it restores
BIP39 seed 12, 15, 18, 21 or 24 words from the standard 2,048-word list Any BIP39 wallet, with the right address type, path and passphrase
SLIP-39 backup (Trezor’s default since June 2024) 20 or 33 words per share, from a different 1,024-word list; a multi-share backup has several sets Trezor devices and wallets that support SLIP-39, such as Sparrow and Electrum; it can’t be converted into BIP39 words
Electrum seed Usually 12 words from the same 2,048-word list, so it looks exactly like BIP39 (seeds from before Electrum 2.0 use Electrum’s own 1,626-word list) Electrum, entered as an Electrum seed; BIP39 wallets usually reject it as invalid
LND node seed (aezeed) 24 words from the BIP39 list, in its own format Lightning node software built on LND
Wallet of Satoshi self-custody 12 words that are a Spark recovery phrase Wallets that support Spark recovery, not hardware or BIP39 wallets
Coldcard Seed XOR part A normal-looking 12- or 24-word BIP39 phrase On its own, a different wallet; all the parts together rebuild the real seed
One key of a multisig wallet Usually a normal BIP39 phrase Restores that one key; you also need the other keys or the descriptor

Electrum uses the BIP39 word list but its own checksum and its own way of turning words into keys, so even a wallet that accepted the words would calculate different keys. Current Electrum avoids creating seeds that pass the BIP39 checksum, but older versions didn’t always, so an old Electrum seed may occasionally open an empty BIP39 wallet. For Lightning, the words are only part of the story: channel balances also depend on channel backups, as Lightning Backups and Watchtowers explains.

Electrum seeds, LND seeds and Spark phrases restore only in software, which puts the words on an internet-connected computer or phone. Use one you trust, and move any savings on to a wallet whose words your hardware wallet created.

The habit that prevents all of this: next to your words, note which wallet made them, which standard they use, the address type, the account and the master fingerprint. Keep the passphrase off that note, in a separate place.

Check Your Understanding

1. An exchange’s withdrawal form says your address starting with bc1p is invalid. Is your address wrong, and what do you do?

Answer

First check that the withdrawal’s network menu says Bitcoin. If it does, your address is most likely fine and the exchange’s software doesn’t support bech32m, the checksum Taproot addresses use. Older software refuses them by design, so that it stops instead of losing coins. Give the exchange a bc1q address from a Native SegWit wallet made from the same words, compare the whole address after pasting it, and send a small test amount first.

2. You restore your 24 words on a new hardware wallet, connect it to a desktop wallet, and the balance shows zero. Your exchange history shows you always withdrew to addresses starting with 3. What’s the likely cause, and how do you fix it safely?

Answer

The desktop wallet is probably looking at Native SegWit (bc1q) addresses while your coins sit on Nested SegWit (m/49'/0'/0'). Create the wallet from the device again with the Nested SegWit address type, or let Sparrow’s Discover Wallet search every type for you. If it’s still empty, check your passphrase, any second account and the gap limit. The words stay on the hardware wallet: never in other apps, and never with anyone offering help.

3. You find an old 12-word phrase from Electrum, and a BIP39 wallet says the words are invalid. Is the phrase damaged?

Answer

Probably not. Electrum creates seeds in its own format, usually with the same word list as BIP39 but a different checksum and a different way of making keys, so BIP39 wallets usually reject them. Restore it in Electrum and leave the seed type on Electrum, the default, rather than BIP39; as you type, Electrum names the type it recognises, such as segwit. Do it on a computer you trust, and if the wallet holds savings, send them on to an address from your hardware wallet, checked on its screen.