Definition
The gap limit is the rule a hierarchical deterministic wallet uses to decide when to stop scanning for funds. Because an HD wallet can derive an effectively infinite sequence of addresses, it needs a stopping condition during recovery and balance checks. The BIP44 convention sets this limit at 20: if the wallet encounters 20 consecutive addresses with no transaction history, it assumes there is nothing further on that branch and halts the scan.
Why it can lose funds
The gap limit is a heuristic, not a guarantee. If you (or a generating tool) skip ahead and receive payment to, say, the 25th address while addresses 5 through 24 stay empty, a fresh wallet restored from the seed may never scan far enough to find it. The balance appears as zero even though the coins are safely on-chain. This is a classic and avoidable cause of "my restored wallet shows nothing" panic.
Working with it safely
Standard wallet UIs respect the gap limit automatically by handing out addresses in order and only advancing as previous ones are used. Problems arise mainly when importing seeds across wallets, using third-party address generators, or recovering an old setup. If funds seem missing, raise the gap limit in a recovery tool, or rescan with an output descriptor that specifies the exact range.
Gap-limit behavior is defined alongside the account-discovery process in HD wallet accounts, and understanding it is part of disciplined self-custody for anyone who values BIP32 HD wallet sovereignty.
In Simple Terms
The gap limit is the rule a hierarchical deterministic wallet uses to decide when to stop scanning for funds. Because an HD wallet can derive…
