Skip to content

Conversation

@Thegreenpiranha
Copy link

Summary

Adds BIP39 mnemonic validation before wallet creation and restoration to prevent cryptic errors from invalid seed phrases.

Problem

Currently, users can enter invalid mnemonics (wrong words, wrong word count, gibberish) when restoring a wallet. The app accepts these and attempts to connect, resulting in cryptic Breez SDK errors that confuse users.

Example invalid inputs that are currently accepted:

  • Random words not in BIP39 wordlist
  • Incorrect word count (not 12 or 24 words)
  • Complete gibberish like "hello world test fake"

Solution

  • Import validateMnemonic from @scure/bip39
  • Add validation in handleCreateWallet() before creating wallet
  • Add validation in handleRestoreFromManual() before restoring wallet
  • Show clear error message: "Invalid seed phrase. Please check your 12-word recovery phrase."

Testing

  • Tested with invalid mnemonic - shows error message
  • Tested with valid mnemonic - wallet creates/restores successfully
  • No functional changes to valid wallet operations

Impact

Improves UX by catching invalid seed phrases early with clear error messages instead of cryptic SDK failures.

- Import validateMnemonic from @scure/bip39
- Add validation in handleCreateWallet before creating new wallet
- Add validation in handleRestoreFromManual before restoring wallet
- Prevents cryptic errors from invalid seed phrases
- Shows clear error message: 'Invalid seed phrase. Please check your 12-word recovery phrase.'
@vercel
Copy link

vercel bot commented Nov 26, 2025

@Thegreenpiranha is attempting to deploy a commit to the The Daniel's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant