How to Import Your Bitcoin Private Keys in Electrum

In this short tutorial, I will explain how to import your private keys in Electrum. This tutorial might be especially useful to you if you tried to import your private keys in the past, but couldn’t get Electrum to detect your Bitcoins.

First of all, open Electrum. The Install Wizard might appear. If it does not, click on File in Electrum’s menu, and on New/Restore.

Screenshot

In the Install Wizard, name your wallet and click on Next.

Screenshot

Select the Import Bitcoin addresses or private keys option and click on Next again.

Screenshot

Now, you need to input your private keys into the text box that has appeared. The private keys need to be in a format called WIF. When a private key is in such a format, it will usually (but not always) start with 5, K or L and be comprised of 51 or 52 alphanumeric characters. For instance, KzQhifVHanPvBmnqTjNnRSqKU64LLJfJXbEmdmxeTdX8jLKkhFMr is a private key in WIF.

Screenshot

What you may not know is that you can generate different addresses from the same private key. By default, Electrum will generate only one of the possible addresses for a given private key, and your Bitcoins might not be available on that one. Thus, you might need to tell Electrum what kind of address to generate, which is done by prepending p2pkh:, p2wpkh-p2sh: or p2wpkh: to the private key.

  • p2pkh: will generate an address that starts with 1 (like 1KKJ88u3BeCXVv3Eg5FhGVQfe81raodoo4)
  • p2wpkh-p2sh: will generate an address that starts with 3 (like 3Ct4iSaBC8GVs3P2CzcJbpsmswrzzAhM9C)
  • p2wpkh: will generate an address that starts with bc1q (like bc1qer5qhp09j4u26zhav0sfzk75x0sp5mkmtmjjs7)

For instance, if you know that your Bitcoin address is bc1qer5qhp09j4u26zhav0sfzk75x0sp5mkmtmjjs7 (i.e., it starts with bc1q), you would input the following private key into the text box: p2wpkh:KzQhifVHanPvBmnqTjNnRSqKU64LLJfJXbEmdmxeTdX8jLKkhFMr. If you were to prepend something else than p2wpkh:, Electrum might not be able to detect your Bitcoins.

Note that you can import the same private key once for each address type. Therefore, if your private key is KzQhifVHanPvBmnqTjNnRSqKU64LLJfJXbEmdmxeTdX8jLKkhFMr, you can input the lines below in the text box. This will tell Electrum to generate three addresses from the same private key: one that starts with 1, one that starts with 3 and one that starts with bc1q.

1p2pkh:KzQhifVHanPvBmnqTjNnRSqKU64LLJfJXbEmdmxeTdX8jLKkhFMr
2p2wpkh-p2sh:KzQhifVHanPvBmnqTjNnRSqKU64LLJfJXbEmdmxeTdX8jLKkhFMr
3p2wpkh:KzQhifVHanPvBmnqTjNnRSqKU64LLJfJXbEmdmxeTdX8jLKkhFMr

Once you have input your private keys in the text box, click on Next. You will be prompted to protect your wallet with a password.

Screenshot

Choose a password and click on Next. Should you have any Bitcoins, they should be detected. To see your addresses, click on the Addresses tab.

Screenshot