Author

Topic: Electrum and Ian Coleman's BiP39 (Read 398 times)

newbie
Activity: 23
Merit: 853
June 27, 2020, 07:08:44 AM
#11
Line 35217 is "return h == nh;" while 35245 is "passphrase = "mnemonic" + passphrase;" If I make the proposed changes,  the resulting file would be suitable solely  for Electrum or it can be used to generate data relevant to traditional BIP 39 scheme?
For Electrum only.

Cool, didn't even know there was such a possible modification of that file to check the consistency  of keys and addresses generated by Electrum. Just have made the required changes and everything worked out, will be used  in my routine.
legendary
Activity: 1848
Merit: 2033
Crypto Swap Exchange
June 27, 2020, 06:13:39 AM
#9
Line 35217 is "return h == nh;" while 35245 is "passphrase = "mnemonic" + passphrase;" If I make the proposed changes,  the resulting file would be suitable solely  for Electrum or it can be used to generate data relevant to traditional BIP 39 scheme?
For Electrum only.
legendary
Activity: 1848
Merit: 2033
Crypto Swap Exchange
June 25, 2020, 10:54:09 AM
#8
The iancoleman code has been updated since those changes were suggested by HCP, so although those are still the changes you need to make, you will no longer find that code at the same places.
Right, I didn't think it was so important to specify the exact line. In the current version of the file, you have to change the lines 35217 and 35245.
legendary
Activity: 2268
Merit: 18711
June 25, 2020, 08:12:00 AM
#7
The iancoleman code has been updated since those changes were suggested by HCP, so although those are still the changes you need to make, you will no longer find that code at the same places.

Download the repository from here: https://github.com/iancoleman/bip39
Navigate to the folder BIP39/src/js
Open the file jsbip39.js
The string return h == nh; is at line 116, and the string passphrase = "mnemonic" + passphrase; is at line 144.

The other instructions OP has given are correct. Make these code changes and repeat those steps, and you will be able to replicate your Electrum addresses.
legendary
Activity: 1848
Merit: 2033
Crypto Swap Exchange
legendary
Activity: 1624
Merit: 2481
June 24, 2020, 11:40:29 AM
#5
Electrum does not use BIP 39.
It has its own mnemonic code derivation. Once the root key (BIP 38) is obtained, the derivation of the keys is the same. But the step from the mnemonic to the root key is different.

You won't be able to recreate your private keys from an electrum mnemonic using a BIP 39 software.
legendary
Activity: 2380
Merit: 5213
June 24, 2020, 05:22:53 AM
#4
If you want to have a seed phrase generating same addresses in Electrum and iancoleman, instead of generating the seed phrase using Electrum, you can generate the seed phrase in iancoleman and import it into Electrum. You only need to check "BIP39" when importing the seed phrase generated by iancoleman in Electrum.
The seed generated by Electrum doesn't work in iancoleman. But Electrum can generate same addresses as iancoleman.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
June 24, 2020, 04:43:59 AM
#3
Any particular reason why you'd want to restore your addresses despite having Electrum?
That's for members to be able to answer straight to the point.

BTW, you can follow this post from the third link above: /index.php?topic=5253904 Post#19
But that requires you to restore the wallet to Electrum if you didn't have a backup of the master private key.
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
June 24, 2020, 04:01:33 AM
#2
It was discussed here too in the past multiple times. Electrum's seed system also uses a version number. https://electrum.readthedocs.io/en/latest/seedphrase.html
This means that Electrum's seed only works in Electrum.
If you want to make a seed that works anywhere (and also in Electrum!, just you'll have to perform one extra step at importing), then use Ian Coleman's.

Edit: topics on similar subject:
https://bitcointalksearch.org/topic/restore-wallet-using-bip39-5111828
https://bitcointalksearch.org/topic/ledger-with-electrum-seed-5203955 (yes, I had the same surprise in the past)
https://bitcointalksearch.org/topic/ian-coleman-bip39-derive-p2sh-addresses-from-electrum-generated-seed-5253904
member
Activity: 81
Merit: 30
June 24, 2020, 03:57:32 AM
#1
Not able to get my Electrum addresses replicated in Ian Coleman's BiP39.  Any ideas?

I have setting as follows,

BIP39 Mnemonic                                Electrum 12 seed words entered
BIP39 Passphrase (optional)                Electrum extended seed words entered
Derivation Path                                   set to BIP141
BIP32 Derivation Path                         set to m/0'/0
Script Semantics                                 set to P2WPKH

 Huh
Jump to: