<p>You cannot convert an Electrum seed phrase to a BIP39 seed phrase, because in the process of deriving the master private keys, both algorithms use a different salt. This means, you cannot use Electrum seed phrases to generate BIP39-phrase addresses.</p>
<p>However, it <strong>is</strong> possible to derive Electrum addresses from Electrum seed phrases even outside Electrum. There is a short guide <a href="https://bitcointalk.org/index.php?topic=5482172.msg63525507#msg63525507" rel="nofollow noreferrer">here</a> even though it is for testnet, it also works for mainnet just by switching the coin type.</p>
<p>To quote it:</p>
<blockquote>
<ol>
<li><p>Download <a href="https://github.com/iancoleman/bip39/releases" rel="nofollow noreferrer">bip39-standalone.html</a>.</p>
</li>
<li><p>Go to line 28611 and replace &quot;return h == nh;&quot; with &quot;return true;&quot;.</p>
</li>
<li><p>Go to line 28639 and replace &quot;mnemonic&quot; with &quot;electrum&quot;.</p>
</li>
<li><p>Open bip39-standalone.html in your browser and paste your seed phrase.</p>
</li>
<li><p>Select &quot;Bitcoin - Testnet&quot; from &quot;Coin&quot;.</p>
</li>
<li><p>In &quot;Derivation Path&quot;, select BIP141, P2WPKH and use: m/0'/0</p>
</li>
</ol>
</blockquote>
<p>Note: To get P2PKH address use the m/0 path, m/0'/0 is only for Electrum's segwit P2WPKH.</p>

CC BY-SA 4.0
2024-01-26T12:21:23.457Z
the answer is correct and i also found a working tool right next to what you mention here https://github.com/FarCanary/ElectrumSeedTester
he lo
CC BY-SA 4.0
2024-01-26T13:34:02.323Z
actually its js code also i am unable to extract any python code from it or interpret how the html is actually calculating in short no progress made
he lo
CC BY-SA 4.0
2024-01-26T08:18:19.073Z
2024-01-26T08:18:19.073Z
Zenul_Abidin
<p>I am searching for an <strong>exact python code</strong> that can take a <em>standard wallet</em> seed as input and output the the <em>root key</em> or <em>xpub master public key</em>.
I had tried several codes but none of them gave me the '<strong>exact same</strong>' xpub mpk as of the real electrum wallet. Can I get some help.</p>

CC BY-SA 4.0
2024-01-25T19:52:39.987Z
thanks to give me this website name but this might take some time to understand what all this site has to offer. I will answer the question my self I got any break through .Thanks again
he lo
CC BY-SA 4.0
2024-01-25T20:01:58.513Z
iancoleman xpub doesn't match the electrum one
he lo
<electrum><public-key><seed><xpub><hardened-derivation>
deriving the master public key and the btc address from seed phrase of electrum wallet
he lo
# deriving the master public key and the btc address from seed phrase of electrum wallet

(Asked by: username_0 on 2024-01-25)

I am searching for an **exact python code** that can take a *standard wallet* seed as input and output the the *root key* or *xpub master public key*.
I had tried several codes but none of them gave me the '**exact same**' xpub mpk as of the real electrum wallet. Can I get some help.

**Tags:** electrum, public-key, seed, xpub, hardened-derivation

> **Comments:**
> **username_0**: thanks to give me this website name but this might take some time to understand what all this site has to offer. I will answer the question my self I got any break through .Thanks again  
> **username_0**: iancoleman xpub doesn't match the electrum one  

---

## 1 answers

### Answer by username_1 on 2024-01-26. Score: 1 | Accepted answer

You cannot convert an Electrum seed phrase to a BIP39 seed phrase, because in the process of deriving the master private keys, both algorithms use a different salt. This means, you cannot use Electrum seed phrases to generate BIP39-phrase addresses.

However, it **is** possible to derive Electrum addresses from Electrum seed phrases even outside Electrum. There is a short guide [here](https://bitcointalk.org/index.php?topic=5482172.msg63525507#msg63525507) even though it is for testnet, it also works for mainnet just by switching the coin type.

To quote it:

> 1. Download [bip39-standalone.html](https://github.com/iancoleman/bip39/releases).
> 2. Go to line 28611 and replace "return h == nh;" with "return true;".
> 3. Go to line 28639 and replace "mnemonic" with "electrum".
> 4. Open bip39-standalone.html in your browser and paste your seed phrase.
> 5. Select "Bitcoin - Testnet" from "Coin".
> 6. In "Derivation Path", select BIP141, P2WPKH and use: m/0'/0

Note: To get P2PKH address use the m/0 path, m/0'/0 is only for Electrum's segwit P2WPKH.

> **Comments:**
> **username_0**: the answer is correct and i also found a working tool right next to what you mention here https://github.com/FarCanary/ElectrumSeedTester  
> **username_0**: actually its js code also i am unable to extract any python code from it or interpret how the html is actually calculating in short no progress made  

---

