Import all private keys in Electrum the right way

Our favorite wallet software Electrum requires a little help when importing a private key to include all its possible four public addresses. In other words the two legacy P2PKH adresses (one uncompressed, one compressed), one segwit P2WPKH-P2SH address, and one native segwit P2WPKH (bech32) address.

Let’s consider this randomly generated private key (never use this exact one, as it has been disclosed here):

Private Key (HEX):
Private Key Uncompressed (WIF):
Private Key Compressed (WIF):

In order to make Electrum read and understand all four different public addresses that belong to this one private key, we must prepend the base58 encoded private keys with certain prefixes (“p2pkh:” for both the uncompressed and the compressed private keys, “p2wpkh-p2sh:” once for the compressed private key and finally “p2wpkh:” for the compressed private key). Does it sound complicated? It really isn’t! Simply copy these four lines


into Electrum (under Wallet/Private keys/Import).

Finally, look under the Address tab (if needed: View/Show Addresses), and you should see all four public addresses


Boom, done! Four public addresses from one private key. (Now, actually using the uncompressed legacy address isn’t a great idea, due to high transaction fees, but that is a topic for another article.)

Comments or questions?

One more thing!

Consider the donation address at the bottom of the page. We re-invest all contributions into new projects for Help us create new content and remain ad-free forever. Thank you.

3 Replies to “Import all private keys in Electrum the right way”

  1. […] You should know this by now. A native segwit address (beginning with “bc1”) is what you are looking for. A lazy person (we like lazy people!) lets their wallet create one for them. We prefer generating a compressed private key WIF and importing it into a fresh Electrum wallet using the proper prefix. […]



    My together, Delara is 20 months old and diagnosed with a sever genetic disease, spinal Muscular Atrophy SMA. 

    To fight this disease and in order to have a normal life she needs the gene therapy medication zolgensma SMA. with your donation, We can save Delara 

    we live in  Afghanistan  

    here we don’t have debit card  and PayPal and …

    we do have just  crypto

    We need near 115000 dollars for medication payment and this is unattainable in my country

    If you and other people can help my daughter, this is my bitcoin wallet 



    If you do not help, she will die soon

    We are also human and we live on earth and we breathe and we have emotions

    So please treat us humanely

    If you don’t help us , please share this massage

    This is the only way to save my daughter


  3. You have cancer doctors in Afghanistan?


Leave a Reply

Your email address will not be published. Required fields are marked *