1

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.

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".
    – Willtech
    Commented Feb 11, 2018 at 4:28

2 Answers 2

3

Electrum uses a modified WIF that encodes the address type:

Release notes

Source

1
  • You can convert between private key types using this script
    – Abdussamad
    Commented Feb 10, 2018 at 13:50
0

I wrote a code that follows the bip84 and I advise to generate electrum addresses using ZPub.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.