Author

Topic: Cannot import BIP49 derivation (segwit) seed from BIP39 mnemonic (Read 489 times)

HCP
legendary
Activity: 2086
Merit: 4363
Then that actually sounds like an issue with the way the Trezor is generating addresses from the seed... As opposed to the way Electrum is generating the addresses.

It would seem that the Trezor is adding (or not removing) the trailing space. Possibly just an issue with SegWit wallet... Does the same thing happen if you try and restore a nonSegWit wallet? Ie. Using derivation path m/44'/0'/0' ?

I'll have a test with the Trezor when I get home... But like I said, fairly sure it's a Trezor fault, not an Electrum one... It's not a Trezor nor an Electrum fault


UPDATE: I have had a chance to reset my Trezor, and generated a new "BIP39" seed using the Trezor One:
Quote
feature loan detect fix glance voice cargo kangaroo pilot apple genuine parade business jazz fortune sell dynamic indoor same absorb host slight educate toe

I CANNOT replicate this issue. It works as intended...

- I then created a new wallet in Electrum v3.0.6... "File -> New\Restore -> Standard -> I already have a seed"
- Clicked the "Options" button and selected "BIP39 seed"
- Entered the seed above with NO SPACE after last word => "BIP39 (Checksum OK)"
- Clicked "Next"
- Wallet created with the same addresses as displayed by Trezor wallet.

OP, I suggest you check that the version of Electrum you downloaded is the legitimate version from the official website.... make sure you downloaded from: https://www.electrum.org/#download (check your browser history)... and I would also suggest checking the digital signature of the downloaded file using ThomasV's PGP signature

legendary
Activity: 1246
Merit: 1024
Electrum 3.0.6. Issue is with seed words generated by a Trezor One. 24 words, BIP 39 segwit addresses are different with and without a space. You need the space to match the addresses generated by the Trezor One.
HCP
legendary
Activity: 2086
Merit: 4363
No I do not. I figured out the issue after a lot of frustration and experimentation. There is a bug in Electrum and I submitted the issue to their GIT. You have to enter a blank space after the last seed word. If you use a passphrase then you must enter a blank space after the passphrase also. Only if you enter the blank spaces will you get the same Segwit addresses that are on  your Trezor. This is not something most people will think of.
I cannot replicate this... what version of Electrum were/are you using?

I just created a 24 word seed using https://iancoleman.io/bip39/
Quote
honey risk juice trip orient galaxy win situate shoot anchor bounce remind horse traffic exotic since escape mimic ramp skin judge owner topple erode

Then clicked the BIP49 tab and checked the addresses generated:
m/49'/0'/0'/0/0 3GcKN7q7gZuZ8eHygAhHrvPa5zZbG5Q1rK
m/49'/0'/0'/0/1 35p5LwCAE7mH2css7onyQ1VuS1jgWtQ4U3
m/49'/0'/0'/0/2 3Lp92LXhBKZWtZk8Lsx7yAWbcRYZDLWbHz
m/49'/0'/0'/0/3 3BZG7dEqYmr1U2ZpbMY4eM4hNnX6evZ7rp

Created a new wallet in Electrum v3.0.6 (File -> New\Restore -> Standard -> I already have a seed -> "Options" -> "BIP39 Seed", NO SPACE after seed)... set derivation path to: m/49'/0'/0'


Addresses generated:

legendary
Activity: 1246
Merit: 1024
I have been trying to use Trezor 24 word seed to restore Segwit account. When I put the seed words in Electrum in lower case and change derviation to "m/49'/0'/0'" I get a completely different set of addresses. I cannot figure out how to get the seed words to restore in Electrum and get the same addresses that I had in the Trezor. If I hook up the Trezor and make a new hardware wallet the addresses are the same, but the seed words, which restore properly in a Trezor, are not giving me the same addresses in Electrum. Any help would be appreciated.
Do you have multiple Trezor wallets?

If so, every account has a different derivation path.

m/49'/0'/' with being the number of the account. (E.g: account #3 is m/49'/0'/3')

No I do not. I figured out the issue after a lot of frustration and experimentation. There is a bug in Electrum and I submitted the issue to their GIT. You have to enter a blank space after the last seed word. If you use a passphrase then you must enter a blank space after the passphrase also. Only if you enter the blank spaces will you get the same Segwit addresses that are on  your Trezor. This is not something most people will think of.

I don't think it's a bug in Electrum, because Samourai Wallet works in the same way.

For recovery seed, you need to blank space the last word too.

I discussed it with Slush on Trezor's Telegram channel and he said he considers it a bug.
member
Activity: 137
Merit: 10
I have been trying to use Trezor 24 word seed to restore Segwit account. When I put the seed words in Electrum in lower case and change derviation to "m/49'/0'/0'" I get a completely different set of addresses. I cannot figure out how to get the seed words to restore in Electrum and get the same addresses that I had in the Trezor. If I hook up the Trezor and make a new hardware wallet the addresses are the same, but the seed words, which restore properly in a Trezor, are not giving me the same addresses in Electrum. Any help would be appreciated.
Do you have multiple Trezor wallets?

If so, every account has a different derivation path.

m/49'/0'/' with being the number of the account. (E.g: account #3 is m/49'/0'/3')

No I do not. I figured out the issue after a lot of frustration and experimentation. There is a bug in Electrum and I submitted the issue to their GIT. You have to enter a blank space after the last seed word. If you use a passphrase then you must enter a blank space after the passphrase also. Only if you enter the blank spaces will you get the same Segwit addresses that are on  your Trezor. This is not something most people will think of.

I don't think it's a bug in Electrum, because Samourai Wallet works in the same way.

For recovery seed, you need to blank space the last word too.
legendary
Activity: 1246
Merit: 1024
I have been trying to use Trezor 24 word seed to restore Segwit account. When I put the seed words in Electrum in lower case and change derviation to "m/49'/0'/0'" I get a completely different set of addresses. I cannot figure out how to get the seed words to restore in Electrum and get the same addresses that I had in the Trezor. If I hook up the Trezor and make a new hardware wallet the addresses are the same, but the seed words, which restore properly in a Trezor, are not giving me the same addresses in Electrum. Any help would be appreciated.
Do you have multiple Trezor wallets?

If so, every account has a different derivation path.

m/49'/0'/' with being the number of the account. (E.g: account #3 is m/49'/0'/3')

No I do not. I figured out the issue after a lot of frustration and experimentation. There is a bug in Electrum and I submitted the issue to their GIT. You have to enter a blank space after the last seed word. If you use a passphrase then you must enter a blank space after the passphrase also. Only if you enter the blank spaces will you get the same Segwit addresses that are on  your Trezor. This is not something most people will think of.
legendary
Activity: 2758
Merit: 6830
I have been trying to use Trezor 24 word seed to restore Segwit account. When I put the seed words in Electrum in lower case and change derviation to "m/49'/0'/0'" I get a completely different set of addresses. I cannot figure out how to get the seed words to restore in Electrum and get the same addresses that I had in the Trezor. If I hook up the Trezor and make a new hardware wallet the addresses are the same, but the seed words, which restore properly in a Trezor, are not giving me the same addresses in Electrum. Any help would be appreciated.
Do you have multiple Trezor wallets?

If so, every account has a different derivation path.

m/49'/0'/' with being the number of the account. (E.g: account #3 is m/49'/0'/3')
legendary
Activity: 1246
Merit: 1024
I have been trying to use Trezor 24 word seed to restore Segwit account. When I put the seed words in Electrum in lower case and change derviation to "m/49'/0'/0'" I get a completely different set of addresses. I cannot figure out how to get the seed words to restore in Electrum and get the same addresses that I had in the Trezor. If I hook up the Trezor and make a new hardware wallet the addresses are the same, but the seed words, which restore properly in a Trezor, are not giving me the same addresses in Electrum. Any help would be appreciated.
newbie
Activity: 3
Merit: 0
Yeah, now I see that your description is more accurate. Wink

I did it with my segwit wallet in the Trezor now and verified that the derived addresses are the same, so seems to work. Thanks!
hero member
Activity: 761
Merit: 606
I just edited my post while you were typing yours.  Glad you got it all worked out!!  I haven't tried this with any new Segwit stuff yet.
newbie
Activity: 3
Merit: 0
Thanks for the warning. I intend to run Electrum on an offline singel-use computer that is encrypted, so should be fine.

I managed to do it with your input. However, you have to actually tick the box "Extend this seed with custom words", which seems to be the passphrase passed to the PBKDF2 function described in BIP39. I saw this checkbox previously, but couldn't imagine that it was the passphrase. Very confusing. Would strongly recommend to rename it "BIP39 passphrase" or similar, and also to rewrite the text on the "Seed extension" page that follows.

Here is the procedure, to help others:

1. Create new/Restore wallet
2. "Standard wallet"
3. "I already have a seed"
4. Enter 12-24 word mnemonic in textbox (lowercase, won't work otherwise)
5. Click Options button and tick both boxes "Extend this seed with custom words" and "BIP39 seed"
6. On the "Seed extension" page, enter the BIP39 passphrase in the textbox
7. Change the derivation path to "m/49'/0'/0'" on the next page
hero member
Activity: 761
Merit: 606
That's easy, but let me first caution you that doing what you want is going to subject the private keys of the BTC wallet to a computer.  The greatest value of a hardware wallet is that no private keys ever leave the "inside" of the Trezor.  I wouldn't do it myself with a coin containing wallet, but I will tell you how to do what you ask.  Let me confirm that I have done this numerous times with test wallets because I wanted to KNOW I could restore a wallet if I lost or broke my Trezor.  You open Electrum and select RESTORE a wallet.  Then you will select the standard wallet option.  Then select the I have my seed option.  You will enter your 24 SEED words from the Trezor recovery sheet you should have kept.  Now you click on the options button just under where you enter your seed.  Then enter the BIP/extended seed password that matches the wallet.  Reminding you once again; that you are creating a FULLY functional, SEED containing wallet.  That's good and bad.  You can do anything you want with your new Electrum fully functional wallet, but you have LEFT the safety of the hardware wallet design.  Its easy as can be.  If you get stuck or have further questions please ask and someone will chime in.
newbie
Activity: 3
Merit: 0
Hi,

I have a Trezor with a BIP39 password-protected mnemonic. Now when Electrum 3.0 is out, I would like to import this to Electrum (i.e. not connect to the Trezor for signing, but use Electrum separately). I managed to do this when the mnemonic was NOT password protected, but I cannot find anywhere how to do this with a password. Password protection of the mnemonic is essential when using the Trezor, and to have password protection is also an essential part of BIP39. But how do I do this?

Thanks!
Jump to: