Bitcoin Forum
June 21, 2024, 12:00:37 AM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Cannot import BIP49 derivation (segwit) seed from BIP39 mnemonic  (Read 465 times)
hoffe (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
November 03, 2017, 08:52:14 PM
 #1

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!
Coin-Keeper
Hero Member
*****
Offline Offline

Activity: 758
Merit: 606



View Profile
November 03, 2017, 09:53:55 PM
Last edit: November 03, 2017, 10:28:33 PM by Coin-Keeper
 #2

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.

BTC: 1PYSBbuKM3kW19xe9TXJQfq64rPhd8XorF
Staked and Verified: https://bitcointalk.org/index.php?topic=996318.msg17102755#msg17102755
hoffe (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
November 03, 2017, 10:28:39 PM
 #3

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
Coin-Keeper
Hero Member
*****
Offline Offline

Activity: 758
Merit: 606



View Profile
November 03, 2017, 10:30:52 PM
 #4

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.

BTC: 1PYSBbuKM3kW19xe9TXJQfq64rPhd8XorF
Staked and Verified: https://bitcointalk.org/index.php?topic=996318.msg17102755#msg17102755
hoffe (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
November 03, 2017, 10:35:36 PM
 #5

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!
jackbox
Legendary
*
Offline Offline

Activity: 1246
Merit: 1024



View Profile
March 04, 2018, 08:02:27 AM
 #6

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.

Buy a Trezor and Protect your BTC, BCH, BTG, DASH, LTC, DGB, ZEC, ETH and ETC from hackers.
If I was helpful please buy me a coffee BTC: 1DWK7vBaxcTC5Wd2nQwLGEoy8xdFVzGKLK  BTG: AWvN1iBqCUqG2tEh3XoVvRbdcGrAzfBBpW
If I was helpful please buy me a burger DGB: DLASV6CUQpGtGSyaVz5FYuu5YxZ17MoGQz
TryNinja
Legendary
*
Offline Offline

Activity: 2870
Merit: 7116


Crypto Swap Exchange


View Profile WWW
March 04, 2018, 12:31:44 PM
 #7

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'/<account>' with <account> being the number of the account. (E.g: account #3 is m/49'/0'/3')

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
jackbox
Legendary
*
Offline Offline

Activity: 1246
Merit: 1024



View Profile
March 04, 2018, 01:30:26 PM
 #8

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'/<account>' with <account> 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.

Buy a Trezor and Protect your BTC, BCH, BTG, DASH, LTC, DGB, ZEC, ETH and ETC from hackers.
If I was helpful please buy me a coffee BTC: 1DWK7vBaxcTC5Wd2nQwLGEoy8xdFVzGKLK  BTG: AWvN1iBqCUqG2tEh3XoVvRbdcGrAzfBBpW
If I was helpful please buy me a burger DGB: DLASV6CUQpGtGSyaVz5FYuu5YxZ17MoGQz
Ayanamirs
Member
**
Offline Offline

Activity: 137
Merit: 10


View Profile
March 04, 2018, 02:00:31 PM
 #9

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'/<account>' with <account> 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.
jackbox
Legendary
*
Offline Offline

Activity: 1246
Merit: 1024



View Profile
March 04, 2018, 02:01:56 PM
 #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'/<account>' with <account> 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.

Buy a Trezor and Protect your BTC, BCH, BTG, DASH, LTC, DGB, ZEC, ETH and ETC from hackers.
If I was helpful please buy me a coffee BTC: 1DWK7vBaxcTC5Wd2nQwLGEoy8xdFVzGKLK  BTG: AWvN1iBqCUqG2tEh3XoVvRbdcGrAzfBBpW
If I was helpful please buy me a burger DGB: DLASV6CUQpGtGSyaVz5FYuu5YxZ17MoGQz
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
March 05, 2018, 04:06:41 AM
Last edit: November 15, 2023, 08:12:06 AM by HCP
 #11

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:


█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
jackbox
Legendary
*
Offline Offline

Activity: 1246
Merit: 1024



View Profile
March 05, 2018, 07:26:07 AM
 #12

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.

Buy a Trezor and Protect your BTC, BCH, BTG, DASH, LTC, DGB, ZEC, ETH and ETC from hackers.
If I was helpful please buy me a coffee BTC: 1DWK7vBaxcTC5Wd2nQwLGEoy8xdFVzGKLK  BTG: AWvN1iBqCUqG2tEh3XoVvRbdcGrAzfBBpW
If I was helpful please buy me a burger DGB: DLASV6CUQpGtGSyaVz5FYuu5YxZ17MoGQz
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
March 05, 2018, 09:00:05 AM
Last edit: March 06, 2018, 02:00:09 AM by HCP
 #13

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


█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!