Recover a Seed Phrase From Partially Remembered Words
Last updated: November 29, 2026
Quick Overview
A customer remembers most of a 12-word BIP39 recovery phrase but has a few candidates for some positions and has forgotten the last word. Enumerate every phrase consistent with the candidates whose checksum is valid.
Coinbase
November 29, 20260
0
0 solved
A customer remembers most of a 12-word BIP39 recovery phrase but has a few candidates for some positions and has forgotten the last word. Enumerate every phrase consistent with the candidates whose checksum is valid.
Self-custody through Coinbase Wallet means users sometimes misrecord a recovery phrase, and the BIP39 checksum is the only built-in check. The interviewer looks for backtracking with a bounded search space, correct bit packing of 11-bit word indices and the insight that the last word can be derived rather than searched.
What the Interviewer Expects
- Explain the 12-word layout: 128 entropy bits plus a 4-bit checksum
- Backtrack over candidate lists while carrying the bit prefix
- Derive valid last words from 128 entropy choices instead of testing all 2048
- Refuse searches that are too large before starting
- Discuss why this is only safe offline on the user's device
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How does the approach change for 24-word phrases with an 8-bit checksum?
- How would you rank candidates if the user also remembers a funded address?
- How would you parallelize a large search safely?
- Why must this never run on a server with the user's phrase?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input: 12 lists of candidate indices into the 2048-word list (known words are single-element lists). Output: all index sequences whose checksum is valid. The last 4 bits of the 132-bit sequence must e...
High-Level Design
Backtrack through positions 1 to 11, shifting each 11-bit index into an integer prefix as you go. At the last position, the word contributes 7 entropy bits and the 4 checksum bits. Rather than testing...