What Is the Bitcoin Gap Limit?
The BIP-44 address gap limit is the most common reason Bitcoin HD wallets show a zero balance after restoring from a seed phrase. Here's exactly what it is, why it exists, and how to fix it.
The Gap Limit in Plain English
When you restore a Bitcoin wallet from a seed phrase (or import an extended public key), the wallet needs to figure out which addresses belong to you and whether they hold any Bitcoin. It does this by generating addresses one by one — address 0, address 1, address 2, and so on — and checking each against the blockchain for transaction history.
But here's the problem: a seed phrase can generate billions of addresses. The wallet can't check all of them. So it uses a rule: if it encounters 20 consecutive addresses with zero transaction history, it stops scanning and assumes it has found everything.
That number — 20 — is the gap limit. It's defined in BIP-44 (Bitcoin Improvement Proposal 44), the standard that governs how HD (Hierarchical Deterministic) wallets derive addresses.
Key Takeaway
The gap limit is a performance optimization, not a security feature. It tells the wallet "stop looking after 20 empty addresses in a row." When your Bitcoin sits beyond that gap, the wallet simply never sees it — but the funds are still safely on-chain.
Why Does the Gap Limit Exist?
HD wallets (defined in BIP-32) can derive an effectively infinite number of addresses from a single seed. Without a stopping rule, a wallet would need to check addresses forever — which is impractical both in terms of time and API rate limits.
The BIP-44 authors chose 20 as a reasonable default. Under normal use, you rarely generate more than a few addresses without receiving at least one payment. Twenty empty addresses in a row almost always means "there's nothing further." It's a good heuristic — until it isn't.
When the Gap Limit Causes Problems
The gap limit becomes a real issue in several common scenarios:
1. Wallet Migration
You used Wallet A for years and generated dozens of receive addresses. When you import your seed into Wallet B, it starts scanning from index 0. If there's a stretch of 20+ unused addresses anywhere in the middle, Wallet B stops there — even though you have funds at higher indices.
2. Pre-Generated Receive Addresses
You created 30 receive addresses in advance (for invoices, donations, a merchant checkout system) but only received funds on address #25. A wallet with a gap limit of 20 stops at index 20 and never checks index 25.
3. Exchange Deposits
Some exchanges or payment processors assign deposit addresses non-sequentially, or generate many addresses internally. If Bitcoin lands on an address far ahead in the derivation sequence, it falls beyond the gap.
4. Multiple Wallet Software
Different wallet software may track different subsets of addresses. When you consolidate everything under one wallet, some addresses may appear "skipped" from that wallet's perspective, creating a gap.
5. Change Addresses
The gap limit applies to both the external chain (receive addresses, m/0/*) and the internal chain (change addresses, m/1/*). Change addresses are created automatically when you spend Bitcoin, and gaps can form there too — especially if you imported a wallet that made many transactions.
Gap Limits by Wallet
Not every wallet uses the same gap limit. Here's what the most popular wallets default to:
| Wallet | Default Gap Limit | Configurable? |
|---|---|---|
| Electrum | 5 (internal scanning) / 20 (BIP-44 mode) | Yes — console command wallet.change_gap_limit(n) |
| Ledger Live | 20 | No |
| Trezor Suite | 20 | No |
| Sparrow Wallet | 20 | Yes — Preferences → Gap Limit |
| Wasabi Wallet | 21 | No |
| BlueWallet | 20 | No |
| Coldcard | 20 (via connected wallet) | Depends on companion software |
| Bitcoin Core | N/A (uses key pool model) | N/A |
Note on Electrum
Electrum's internal scanning gap limit defaults to 5, which is even more aggressive than BIP-44's 20. This means Electrum users are particularly susceptible to the gap limit problem. You can increase it via the console: wallet.change_gap_limit(50), then restart.
How to Detect a Gap Limit Problem
You likely have a gap limit issue if:
- Your wallet shows 0 balance (or less than expected) after restoring from a seed phrase
- You know you received Bitcoin but the wallet doesn't show the transaction
- A blockchain explorer shows funds at an address you own, but your wallet doesn't
- You migrated from one wallet to another and the balance doesn't match
- You generated many receive addresses in advance
The quickest way to confirm is to scan your extended public key (xpub, ypub, or zpub) with a tool that checks far beyond the standard gap limit — such as GapFix, which scans up to 1,000 addresses on each chain.
How to Fix the Gap Limit Problem
There are three approaches, from simplest to most technical:
Option 1: The Dust Fix (Recommended)
The dust fix is the most universal solution. It works with any wallet without requiring configuration changes:
- Scan your xpub with GapFix to identify which addresses are in the gap and which have funds beyond it
- Send dust (294–546 satoshis per address) to each empty address inside the gap
- Rescan your wallet — it will now see transactions on those addresses, continue scanning past them, and discover the hidden funds
This approach is wallet-agnostic. Once the gap addresses have transactions, any BIP-44-compliant wallet will scan past them.
Read the full step-by-step guide: How to Fix Bitcoin Wallet Showing 0 Balance
Option 2: Increase the Gap Limit
If your wallet supports it, you can increase the gap limit directly:
- Electrum: Open the console (View → Console) and run
wallet.change_gap_limit(100) - Sparrow: Go to Preferences → Gap Limit and set a higher value
This approach is faster but wallet-specific. If you switch to a different wallet later, you'll face the same problem again unless that wallet also has an increased limit.
Option 3: Manual Address Import
Some wallets allow importing individual addresses as watch-only. If you know exactly which addresses have funds (e.g., from a blockchain explorer), you can add them manually. This is cumbersome for more than a few addresses.
Technical Deep Dive: BIP-32 Derivation and the Gap
For those who want to understand the mechanics:
BIP-32 defines a tree structure for key derivation. Each HD wallet has a root key, and addresses are derived at specific paths:
m / purpose' / coin_type' / account' / change / address_index
For a standard BIP-84 (native segwit) Bitcoin wallet, your first receive address is at:
m/84'/0'/0'/0/0
Your second receive address is at m/84'/0'/0'/0/1, and so on. Change addresses live on the m/84'/0'/0'/1/* branch.
The gap limit applies independently to each chain (external and internal). The wallet scans m/.../0/0, m/.../0/1, m/.../0/2... and stops after 20 consecutive indices with no on-chain activity.
When GapFix scans your xpub, it derives addresses at indices 0 through 999+ on both chains, checking all four address types (P2PKH, P2SH-P2WPKH, P2WPKH, and P2TR) to ensure nothing is missed regardless of which derivation standard was used.
Preventing Gap Limit Issues
To avoid running into this problem in the future:
- Don't pre-generate excessive addresses — only generate new receive addresses as needed
- Use the same wallet software consistently — or at minimum, use wallets that follow the same BIP standards
- Before migrating wallets, verify the balance matches by checking your xpub with GapFix or a similar scanner
- Keep a record of your highest-index used address so you know what to look for if something goes wrong
Frequently Asked Questions
What is the default Bitcoin gap limit?
The default is 20 consecutive empty addresses, as defined in BIP-44. Some wallets use different values — Electrum defaults to 5 for its internal scanning.
Can I change the gap limit in my wallet?
Some wallets allow it. Electrum supports wallet.change_gap_limit(n) in the console. Sparrow has a setting in Preferences. Most hardware wallet interfaces (Ledger Live, Trezor Suite) do not expose this setting.
Does the gap limit affect Bitcoin safety?
No. Your funds exist on the blockchain regardless of whether your wallet can see them. The gap limit only affects visibility — it determines how far the wallet scans. Funds beyond the gap are not lost, just hidden from the wallet's view.
What is the difference between gap limit and UTXO?
A UTXO (Unspent Transaction Output) is the fundamental unit of Bitcoin balance — it's the actual Bitcoin sitting at an address. The gap limit is a wallet scanning rule that determines which addresses the wallet checks. When a UTXO exists at an address beyond the gap limit, the wallet doesn't know about it.