Repository navigation
Support four-letter BIP-39 prefixes during wallet import - #56
Open
dasdur-topmex wants to merge 1 commit into
Open
dasdur-topmex wants to merge 1 commit into
dasdur-topmex wants to merge 1 commit into
Conversation
Normalize valid English BIP-39 prefixes before wallet validation, derivation, duplicate checks, and persistence.
|
| Filename | Overview |
|---|---|
| extension/popup/screens/onboarding/ImportScreen.tsx | Applies ASCII-only case normalization and canonical mnemonic validation at the final manual and keyfile import boundary without changing the surrounding flow contract. |
| extension/shared/vault.ts | Canonicalizes mnemonics before duplicate checks, derivation, return values, and encrypted persistence in both vault setup and seed-source creation. |
| extension/shared/wallet-crypto.ts | Adds exact-word-first expansion of unique four-letter English prefixes and retains authoritative BIP-39 checksum validation. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Manual phrase or V1 keyfile] --> B[Import screen normalization]
B --> C{Valid English words or unique four-letter prefixes?}
C -- No --> D[Show invalid phrase error]
C -- Yes --> E[Canonical full mnemonic]
E --> F[Vault boundary normalization]
F --> G{BIP-39 checksum valid?}
G -- No --> H[Reject import]
G -- Yes --> I[Duplicate detection]
I --> J[Address derivation]
J --> K[Encrypted canonical persistence]
Reviews (1): Last reviewed commit: "feat: support four-letter BIP-39 prefixe..." | Re-trigger Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implementation
normalizeAndValidateMnemonichelper using the existing English BIP-39 wordlist.Vault.setupandVault.createMnemonicSeedSourceas the authoritative wallet boundary.Scope
This change covers the V1 wallet flows for:
The separate V0 migration flow is intentionally unchanged.
This change does not modify:
Validation
Repository checks
npm cinpm run typechecknpm run format:checknpm run buildgit diff --checkThe repository does not currently define an automated test runner or lint command.
Focused production-helper validation
Coverage included:
Manual extension validation
Tested in an isolated disposable Brave profile using the unpacked production build:
Security
Only public BIP-39 vectors and disposable wallet data were used during validation. No real mnemonic, private key, or production wallet data was used or committed.
Screenshots
Not applicable. This changes accepted import input behavior without changing the visual layout, and the repository does not document a screenshot requirement.
Maintainer Notes