<p>Electrum uses a modified WIF that encodes the address type:</p>

<p><a href="https://github.com/spesmilo/electrum/blob/42a16d9c3e19785ad39f272517aa2ce54b9e0f7f/RELEASE-NOTES#L126-L139" rel="nofollow noreferrer">Release notes</a></p>

<p><a href="https://github.com/spesmilo/electrum/blob/42a16d9c3e19785ad39f272517aa2ce54b9e0f7f/lib/bitcoin.py#L524" rel="nofollow noreferrer">Source</a></p>

CC BY-SA 3.0
2018-02-10T13:50:47.597Z
You can convert between private key types using [this script](https://gist.github.com/AbdussamadA/dd46a31033f2eb9e5189ed0b849c4be8)
Abdussamad
CC BY-SA 3.0
2018-02-09T22:45:43.017Z
2018-02-10T01:15:18.043Z
2018-02-10T01:15:18.043Z
Gustav Almgren
<p>I wrote a <a href="https://github.com/Anderson-Juhasc/bip84" rel="nofollow noreferrer">code</a> that follows the bip84 and I advise to generate electrum addresses using ZPub.</p>

CC BY-SA 4.0
2019-05-09T23:49:27.223Z
2019-05-10T11:51:01.857Z
2019-05-10T11:51:01.857Z
Anderson Juhasc
<p>I'm running pre-release version <a href="https://github.com/spesmilo/electrum/commit/d8dad74267fe1bdcd98dce0d79e2196f7ced60dc" rel="nofollow noreferrer">d8dad7</a> of Electrum that supports BIP-84 HD derivations.</p>

<p>When exporting private keys, I'm getting WIF keys that are different from the expected output generated by <a href="https://github.com/libbitcoin/libbitcoin-explorer" rel="nofollow noreferrer">bx</a> or <a href="https://iancoleman.io/bip39/" rel="nofollow noreferrer">iancoleman.io/bip39</a>.</p>

<h3>Example</h3>

<p>Create a new Electrum wallet by importing the mnemonic <code>tumble mistake gift ill hungry chunk suggest limit artwork filter peanut exhaust</code> with path <code>m/84'/0'/0'</code>.</p>

<p>The first pubkey (<code>m/84'/0'/0'/0/0</code>) is correctly generated:
<code>0300e0d90c8cb3e1bb7b7a82bd1a118c615d97c03dd3c5f607636e9305a22bbd3e</code></p>

<p><code>bx</code> shows the same key:</p>

<pre><code>mnemonic="tumble mistake gift ill hungry chunk suggest limit artwork filter peanut exhaust"
echo $mnemonic | bx mnemonic-to-seed | bx hd-new | bx hd-private -i 84 -d | bx hd-private -i 0 -d | bx hd-private -i 0 -d | bx hd-private -i 0 | bx hd-private -i 0 |bx hd-to-public | bx hd-to-ec
</code></pre>

<p>In Electrum, the corresponding private key (<code>Wallet -&gt; Private keys -&gt; export</code>) is displayed as <code>LEF3hMKjm4E1MVsGZLpPb5Bjza8p7qqRYn4GzjyCK8Uo1CX8w3z2</code>.</p>

<p>But <code>bx</code> ...</p>

<pre><code> echo $mnemonic | bx mnemonic-to-seed | bx hd-new | bx hd-private -i 84 -d | bx hd-private -i 0 -d | bx hd-private -i 0 -d | bx hd-private -i 0 | bx hd-private -i 0 | bx hd-to-wif
</code></pre>

<p>... (like <a href="https://iancoleman.io/bip39/" rel="nofollow noreferrer">iancoleman.io/bip39</a>) gives another result:
<code>L5fR8BxqauJsNyrW1GRVnu6Fk8wAHRZhPLS9SHd6pej5isKt3qJH</code></p>

<p>Is this a bug in Electrum or an export scheme that differs from the regular WIF?</p>

<p>This discrepancy in private keys doesn't appear when using <code>m/44'/0'/0'</code> as the derivation path in Electrum.</p>

CC BY-SA 3.0
2018-02-11T04:28:21.460Z
Welcome to Bitcoin.SE! You can help by marking your answer as accepted unless you are doubtful that it is entirely correct so that the question does not remain "unanswered".
Willtech
<electrum>
Wrong Electrum private keys when using BIP-84?
Gustav Almgren
# Wrong Electrum private keys when using BIP-84?

(Asked by: username_0 on 2018-02-09)

I'm running pre-release version d8dad7 of Electrum that supports BIP-84 HD derivations.
When exporting private keys, I'm getting WIF keys that are different from the expected output generated by bx or iancoleman.io/bip39.
Example
Create a new Electrum wallet by importing the mnemonic tumble mistake gift ill hungry chunk suggest limit artwork filter peanut exhaust with path m/84'/0'/0'.
The first pubkey (m/84'/0'/0'/0/0) is correctly generated:
0300e0d90c8cb3e1bb7b7a82bd1a118c615d97c03dd3c5f607636e9305a22bbd3e
bx shows the same key:
mnemonic="tumble mistake gift ill hungry chunk suggest limit artwork filter peanut exhaust"
echo $mnemonic | bx mnemonic-to-seed | bx hd-new | bx hd-private -i 84 -d | bx hd-private -i 0 -d | bx hd-private -i 0 -d | bx hd-private -i 0 | bx hd-private -i 0 |bx hd-to-public | bx hd-to-ec

In Electrum, the corresponding private key (Wallet -> Private keys -> export) is displayed as LEF3hMKjm4E1MVsGZLpPb5Bjza8p7qqRYn4GzjyCK8Uo1CX8w3z2.
But bx ...
 echo $mnemonic | bx mnemonic-to-seed | bx hd-new | bx hd-private -i 84 -d | bx hd-private -i 0 -d | bx hd-private -i 0 -d | bx hd-private -i 0 | bx hd-private -i 0 | bx hd-to-wif

... (like iancoleman.io/bip39) gives another result:
L5fR8BxqauJsNyrW1GRVnu6Fk8wAHRZhPLS9SHd6pej5isKt3qJH
Is this a bug in Electrum or an export scheme that differs from the regular WIF?
This discrepancy in private keys doesn't appear when using m/44'/0'/0' as the derivation path in Electrum.

**Tags:** electrum

> **Comments:**
> **username_1**: Welcome to Bitcoin.SE! You can help by marking your answer as accepted unless you are doubtful that it is entirely correct so that the question does not remain "unanswered".  

---

## 2 answers

### Answer by username_0 on 2018-02-09. Score: 3 | Accepted answer

Electrum uses a modified WIF that encodes the address type:

[Release notes](https://github.com/spesmilo/electrum/blob/42a16d9c3e19785ad39f272517aa2ce54b9e0f7f/RELEASE-NOTES#L126-L139)

[Source](https://github.com/spesmilo/electrum/blob/42a16d9c3e19785ad39f272517aa2ce54b9e0f7f/lib/bitcoin.py#L524)

> **Comments:**
> **username_2**: You can convert between private key types using [this script](https://gist.github.com/username_2A/dd46a31033f2eb9e5189ed0b849c4be8)  

---

### Answer by username_3 on 2019-05-09. Score: 0

I wrote a [code](https://github.com/Anderson-Juhasc/bip84) that follows the bip84 and I advise to generate electrum addresses using ZPub.


---

