Author

Topic: How to restore a bip39 seed from linux console and not the GUI client electrum (Read 622 times)

legendary
Activity: 3710
Merit: 1586
note you shouldn't be running electrum as root
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
-snip-
-snip-
I am trying to recover a wallet using your script https://gist.github.com/AbdussamadA/6dc1a09b79f00d7f6a00e91a99d32ef3 which works great, although I changed m/44' to m/49' (for bip49). But inputting the resulted yprv using
-snip-
I have tried the script and edited what you mentioned BIP44 to BIP49 and it printed the same yrpv as the one generated by Electrum GUI.
Sample BIP39 seed: random arctic maze lazy chase cattle need rural census beauty green series
Result: yprvAJZLm5mo51QHF3SjP4LsmojahZfJ421Q11BvRVJ4mTdUb7eszhDkDexaq9QpZnzkvQMGd2exPBo f4NWQ9H6hfn35KdR9q71w66443XnuPuW

It also generated the same set of "3" addresses when used per his example:
Command: BIP39-BIP49.py random arctic maze lazy chase cattle need rural census beauty green series| python electrum-3.3.8/run_electrum -w wallet_test_delete_cli restore -
Console command - getmasterprivate(): same yprv as the above.

So Electrum should generate the same addresses if it's based from that master private key.

Here's what I've edited:
Code:
#converts bip39 mnemonic to bip49 first account xprv
-snip-
    k = keystore.from_bip39_seed( mnemonic, "", "m/49'/0'/0'" )
Just the 'comment' and the 'derivation path' and it worked.

Quote from: xhiroz
Any clue what might be it?
The 'wallet file' will be created in the same folder as the script, perhaps you've opened a different wallet with a similar name.
newbie
Activity: 2
Merit: 0
The electrum cli doesn't have that option. You can use this script instead: https://gist.github.com/AbdussamadA/6dc1a09b79f00d7f6a00e91a99d32ef3 . Run it with python3 interpreter on your system and pass it the seed words. It'll output the xprv for the first bip44 account. You can then pipe the output to electrum restore. For example:

Code:
python3 the-script.py seedwords1 seedword2 | electrum -w wallet_file_name restore -

Hello there!

I am trying to recover a wallet using your script https://gist.github.com/AbdussamadA/6dc1a09b79f00d7f6a00e91a99d32ef3 which works great, although I changed m/44' to m/49' (for bip49). But inputting the resulted yprv using

rm -f /root/.electrum/wallets/default_wallet; script.py "asd asd asd asd asd asd asd asd asd asd asd asd" | electrum -w /root/.electrum/wallets/default_wallet restore -

doesn't yield the same results as manually inputting the *same* yprv via Electrum windows gui, which properly recovers the wallet I am looking for (addresses starting with 3). Via CLI it just gives a totally different set of addresses (starting with bc1), even when the yprv is be the same.

Any clue what might be it?
newbie
Activity: 95
Merit: 0
legendary
Activity: 3710
Merit: 1586
The electrum cli doesn't have that option. You can use this script instead: https://gist.github.com/AbdussamadA/6dc1a09b79f00d7f6a00e91a99d32ef3 . Run it with python3 interpreter on your system and pass it the seed words. It'll output the xprv for the first bip44 account. You can then pipe the output to electrum restore. For example:

Code:
python3 the-script.py seedwords1 seedword2 | electrum -w wallet_file_name restore -
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
If I understood you correctly, you have a BIP 39 seed phrase from a wallet on Linux and you want to import it into Electrum GUI?
To restore select "I already have a seed" not "create new seed"
Then you'll see the check box for BIP 39
He meant linux console like http://docs.electrum.org/en/latest/console.html it doesn't have a checkbox like the GUI verson.
sr. member
Activity: 322
Merit: 363
39twH4PSYgDSzU7sLnRoDfthR6gWYrrPoD
If I understood you correctly, you have a BIP 39 seed phrase from a wallet on Linux and you want to import it into Electrum GUI?
To restore select "I already have a seed" not "create new seed"
Then you'll see the check box for BIP 39
newbie
Activity: 95
Merit: 0
How to restore a bip39 seed that i have from linux console and not in the GUI client electrum?

like described here https://freedomnode.com/blog/105/restore-any-bitcoin-wallet-with-electrum

How do i enable this because i see it supports bip39 seeds to create but i dont know how to restore my seed i dont see the option "bip39"

only bip32 or so, correct me if im wrong...
Jump to: