Skip to content

Enhance Seed Handling: Support Both Hex and BIP39 Mnemonic Import #1006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

JFixby
Copy link

@JFixby JFixby commented Apr 19, 2025

Description

This PR updates the Seed function to improve wallet setup and restore experience.

Changes

  • When generating a new seed:
    • Seed is displayed in hex format.
    • Seed is also displayed as a BIP39 mnemonic.
    • Original entropy and derived seed are displayed.
  • When restoring an existing wallet:
    • User can now enter either a hexadecimal seed or a BIP39 mnemonic phrase.
  • Validation added for both input types.
  • User flow is preserved (prompt for "OK" confirmation before proceeding).

Motivation

  • Allow interoperability: users can restore wallets using their mnemonic across different wallets (Electrum, BlueWallet, Sparrow, etc).

Dependencies

Example Usage

New wallet flow:

Do you have an existing wallet seed you want to use? (no): no
> Your wallet mnemonic phrase (VERY IMPORTANT):
> "squirrel envelope moon ..."
>
> Original entropy used (hex):
> a1b2c3...
>
> Derived seed (hex) from mnemonic (for wallet generation):
> 89abcdef...
>
> IMPORTANT: Keep the mnemonic and entropy in a safe place as you
> you will NOT be able to restore your wallet without them.
> Anyone with access to the mnemonic or seed can restore your wallet
> and access all your funds, so it is critical to store it securely.
>
> (User types OK after saving)

Restore wallet flow from mnemonic:

Do you have an existing wallet seed you want to use? (no): yes
> Enter mnemonic or hex: "squirrel envelope moon ..."
> Wallet restored from mnemonic!

Restore wallet flow from hex seed:

Do you have an existing wallet seed you want to use? (no): yes
> Enter mnemonic or hex: "89abcdef..."
> Wallet restored from hex seed!

@JFixby
Copy link
Author

JFixby commented Apr 19, 2025

Fixing #730

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