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
Coding & Algorithms
Software Engineer
Coinbase
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Hard

0

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
backtracking
bit manipulation
hashing
pruning
BIP39
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. 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 Problems
Sample 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...


Submit Your Answer
Markdown supported