Author

Topic: Seed Phrase Compatibility With Newer Version (Read 155 times)

legendary
Activity: 3472
Merit: 10611
January 23, 2022, 11:15:47 PM
#14
FWIW you can always post a permanent link to a specific line or lines on github so that regardless of what changes are made to the code in the future the link always goes to the same line at that specific commit. After selecting the lines you can do that easily by pressing "y" on your keyboard while that page is open in your browser. This adds the commit hash to the link and makes it "permanent".
legendary
Activity: 2268
Merit: 18748
If you find the time, it would be nice if you can edit that post I quoted with the correct information.
Sure. Done.

Did anything else change or is that it?
That's it. It changed because Ian Coleman implemented an option to change the number of PBKDF2 rounds from the default of 2048 to some other number for advanced users. That change is irrelevant to what we are discussing here, but it added in a little bit of extra code earlier in the same file which pushed everything else down a couple of lines.
legendary
Activity: 2730
Merit: 7065
The changes to be made are now on lines 118 and 146 respectively.
If you find the time, it would be nice if you can edit that post I quoted with the correct information. I will then edit my quote of your post as well. But it isn't really that important since you can always find the correct line with a CTRL+F search for the right string. Did anything else change or is that it?
legendary
Activity: 2268
Merit: 18748
Maybe indirectly it's possible to convert seed using some fork of Mnemonic Code Converter from iancoleman, but I didn't try doing this myself.
It is not possible to generate the same wallet doing this because of the way the seed phrase is turned in to your private keys.

There is approximately a 0.44% chance that a BIP39 seed phrase is also a valid Electrum seed phrase, and there used to be around a 1 in 16 chance that an Electrum seed phrase was a valid BIP39 seed phrase (prior to 4.1.3 when they implemented a check to prevent this). So you could use the same seed phrase to restore both a BIP39 wallet and an Electrum wallet. However, the two wallets you restored would be different because BIP39 uses the word "mnemonic" as part of the salt for PBKDF2, whereas Electrum uses the word "electrum". So even if you could somehow convert an Electrum seed phrase in to a corresponding BIP39 seed phrase encoding the same entropy, they would still generate different wallets.

-snip-
The changes to be made are now on lines 118 and 146 respectively.
legendary
Activity: 2730
Merit: 7065
@bitmover, I remember there are some ways Ian Coleman can still be modified though maybe something has changed since 2020.
I had to check my logs because I remember that I bookmarked two posts where HCP and o_e_l_e_o talked about this particular problem.
Let me just quote them here for reference. Maybe they can help.

This is the older post from HCP from 2018:
1. Search for this function (should be near Line ~104000):
Code:
self.check = function(mnemonic)

Change the last line from:
Code:
return h == nh;
to:
Code:
return true;


2. Search for this function (should be just under the one above):
Code:
self.toSeed = function(mnemonic, passphrase)

Change the following line from:
Code:
passphrase = "mnemonic" + passphrase;
to:
Code:
passphrase = "electrum" + passphrase;


NOTES:
- This will break the checksum functionality. The "return true;" modification basically makes it think ANY seed you type in is correct.
- To get it to generate the same addresses as Electrum:
1. Enter Electrum Seed
2. Click "BIP32" tab
3. Set "client" to "Custom Derivation Path"
4. Set "BIP32 Derivation Path" to: m/0 (to see "change" addresses, use m/1 )

And o_e_l_e_o  made this one in 2021:
Rather than use a tool which is 3 years out of date and forked from a version of Ian Coleman which is also 3 years out of date, better just to do it yourself with the latest version of the software, so you know you are not risking being subjected to any bugs or vulnerabilities. It takes 2 minutes to do.

Go to Ian Coleman's site and download the zip of the latest version. Extract and navigate to \src\js, and then open the file jsbip39.js with a text editor.

Navigate to line 118:
Code:
return h == nh;
Change this line to the following:
Code:
return true;

Navigate to line 146:
Code:
passphrase = "mnemonic" + passphrase
Change this line to the following:
Code:
passphrase = "electrum" + passphrase

The first change tells it to ignore the checksum since you are using an Electrum seed phrase and not a BIP39 seed phrase. The second change fixes the salt that Electrum uses when turning seed phrases in to private keys. That's all you need to do. Then just go back in to the \src\ folder and run index.html, and you'll have a working Electrum seed checker.

Edit: Typo fixed, thanks.
legendary
Activity: 3472
Merit: 10611
Nothing about the seed generation algorithm changed between versions 3.x and 4.x so there is no reason for the new version to not recognize the seed phrases generated by that old version. Additionally Electrum like most softwares will try to always keep backward compatibility so that you can always use any seed phrase or wallet file created by the older versions (that includes version 1.8+) in the new versions.
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
Will the seed phrase (12 words) from a version 3.x wallet successfully create the private keys with Electrum V4.x ?

It's been a while since I upgraded to v4 but I think it recognised my wallet files too?



It's also possible to use a master private key on many different pieces of bip39 compliant wallet software and tools from your electrum wallet. That's the part that has quite good cross compatibility afaik.
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
@bitmover, I remember there are some ways Ian Coleman can still be modified though maybe something has changed since 2020. You can find more information in this thread, with special emphasis on this post.

I'm not sure if OP will need this/go this far, however, I think that these are better links than what you've posted:

Like this: https://github.com/HardCorePawn/electrumBIP39
or the more complete version that validates the checksum: https://github.com/FarCanary/ElectrumSeedTester
legendary
Activity: 3234
Merit: 5637
Blackjack.fun-Free Raffle-Join&Win $50🎲
@bitmover, I remember there are some ways Ian Coleman can still be modified though maybe something has changed since 2020. You can find more information in this thread, with special emphasis on this post.
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
Maybe indirectly it's possible to convert seed using some fork of Mnemonic Code Converter from iancoleman, but I didn't try doing this myself.

It won't

Although Electrum  Seed system uses the same wordlist as BIP39, it is not the same system.

If you generated the seed using Electrum and you put that seed into iancoleman software, the private keys won't match, AFAIK.


Quote
Security implications
Electrum currently use the same wordlist as BIP39 (2048 words). A typical seed has 12 words, which results in 132 bits of entropy in the choice of the seed.
https://electrum.readthedocs.io/en/latest/seedphrase.html

However, you can open BIP39 seeds into electrum wallet if you check BIP39 checkbox.

Edit: I just decided to test it myself.

I just create a new wallet in Electrum and it generate a new wallet with this seed:
Code:
song actual win spike combine phone sad borrow loop job initial very

I put it into iancoleman.io/bip39 and it failed the checksum (Invalid mnemonic).
Electrum seeds must be recovered in Electrum, AFAIK.
legendary
Activity: 2380
Merit: 5213
They are compatible with all new versions of Electrum wallet, but I don't think it can work on any other brand of wallets (software or hardware).
In the case the wallet generated by electrum has been already funded, you can import it into bluewallet using its seed phrase.
It should be mentioned that, if there is no transaction in the wallet generated by electrum, it can't be imported into bluewallet.
legendary
Activity: 2212
Merit: 7064
Will the seed phrase (12 words) from a version 3.x wallet successfully create the private keys with Electrum V4.x ?
They are compatible with all new versions of Electrum wallet, but I don't think it can work on any other brand of wallets (software or hardware).
Maybe indirectly it's possible to convert seed using some fork of Mnemonic Code Converter from iancoleman, but I didn't try doing this myself.
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
Will the seed phrase (12 words) from a version 3.x wallet successfully create the private keys with Electrum V4.x ?

Yes, the seed from 3.x should work. Just make sure you have Electrum downloaded from electrum.org and verified https://bitcoinelectrum.com/how-to-verify-your-electrum-download/
jr. member
Activity: 32
Merit: 37
Will the seed phrase (12 words) from a version 3.x wallet successfully create the private keys with Electrum V4.x ?
Jump to: