Post
Topic
Board Electrum
Merits 2 from 1 user
Re: Seed Phrase Compatibility With Newer Version
by
Pmalek
on 23/01/2022, 09:19:13 UTC
⭐ Merited by pooya87 (2)
@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:
Quote
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:
Quote
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 116:
Code:
return h == nh;
Change this line to the following:
Code:
return true;

Navigate to line 144:
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.