<p>The entire process is as follows: (these instructions are correct for Electrum v3.0.6)</p>

<ol>
<li>Install Electrum. The installation methods vary but, the official download is <a href="https://bitcoin.org/en/wallets/desktop/windows/electrum/" rel="nofollow noreferrer">here</a>. On some varieties of Linux it is in the default distro repository.</li>
<li>Run Electrum.

<ol>
<li>Choose Automatically Connect and click on Next.</li>
<li>Name your wallet if you like or accept the default and click on Next.</li>
<li>Select Standard Wallet and click on Next.</li>
<li>Select Create a new seed and click on Next.</li>
<li>Select Segwit and click on Next.</li>
<li>Securely, privately and accurately store your seed. This is your wallet backup. If it is lost all your BTC is gone permanently. Click on Next.</li>
<li>Type your seed in the box and click on Next to verify you have it correctly.</li>
<li>Set a good password that you will never forget. This must be secure to ensure your wallet cannot be stolen. Click on Next.</li>
<li>Your wallet is setup.</li>
</ol></li>
<li>With Electrum setup and running, go to View -> Show console.</li>
<li>Click on the Console tab.</li>
<li>Using the instructions from <a href="https://bitcoin.stackexchange.com/questions/72911/importing-private-keys-creates-different-address">here</a>:

<ol>
<li>Type (or copy and paste) at the >> prompt <code>key = 'your_key'</code> and press <kbd>Enter</kbd> (leave the single quotes in).</li>
<li>Type (or copy and paste) at the >> prompt <code>txin_type, secret, compressed = bitcoin.deserialize_privkey(key)</code> and press <kbd>Enter</kbd>.</li>
<li>Type (or copy and paste) at the >> prompt <code>wif2 = bitcoin.serialize_privkey(secret, compressed, 'p2wpkh-p2sh')</code> and press <kbd>Enter</kbd>.</li>
<li>Type (or copy and paste) at the >> prompt <code>print(wif2)</code> and press <kbd>Enter</kbd>.</li>
</ol></li>
<li>Highlight and copy the one-line string that is output (make sure you do not get any extra spaces) in your clipboard or, write it down.</li>
<li>Click on Wallet -> Private Keys -> Sweep</li>
<li>Paste the string you copied into the big box. The address that is pre-filled in starting (as of writing) with bc1 is one of your many receiving addresses. The balance will be transferred to that address.</li>
<li>Click on Sweep and follow the prompts (I didn't proceed to actually do this step - when I originally tested I used completely different steps to 'Import, not Sweep' just to prove it worked and not take the balance).</li>
<li>This will create a Bitcoin transaction transferring the balance to your own address.</li>
<li>Wait for at least 1 confirmations.</li>
</ol>

<p>Done!</p>

<p>If you just want to import the address to make sure it is correct without trying to sweep you need different steps.</p>

CC BY-SA 3.0
2018-03-31T19:32:07.633Z
That's sweeping rather than importing and as far as the private key format goes just prepend "p2wpkh-p2sh:" to the WIF and you're good to go in 3.1 or newer. You shouldn't be using old versions like 3.0.6.
Abdussamad
CC BY-SA 3.0
2018-04-01T00:31:50.953Z
@Abdussamad When Electrum gets the new version in the Fedora repository then I will get the new version.
Willtech
CC BY-SA 3.0
2018-04-02T13:24:12.650Z
in the case of Electrum you should be installing from source. That's because it updates far too frequently for distro repos to keep up.
Abdussamad
CC BY-SA 3.0
2018-03-29T13:58:16.717Z
2018-03-29T14:24:49.363Z
2018-03-29T14:24:49.363Z
Willtech
<p>I need to import a private key like in <a href="https://bitcoin.stackexchange.com/questions/72911/importing-private-keys-creates-different-address">this question</a> for a p2wpkh-p2sh address. What is the entire process?</p>

CC BY-SA 3.0
2018-03-29T14:03:10.463Z
Maybe add electrum to the question title - Google might show this for generic import queries otherwise, and the import process will likely differ for different clients
Raghav Sood
CC BY-SA 3.0
2018-03-29T14:03:43.773Z
Good plan! And, done.
Willtech
CC BY-SA 3.0
2018-03-29T14:07:02.367Z
This Q/A is linked on [Puzzling.SE](https://puzzling.stackexchange.com/questions/62588/who-can-solve-this-cipher).
Willtech
<private-key><electrum><private-key-import>
I need to import a private key - what is the entire process? [Electrum]
Willtech
# I need to import a private key - what is the entire process? [Electrum]

(Asked by: username_0 on 2018-03-29)

I need to import a private key like in [this question](https://bitcoin.stackexchange.com/questions/72911/importing-private-keys-creates-different-address) for a p2wpkh-p2sh address. What is the entire process?

**Tags:** private-key, electrum, private-key-import

> **Comments:**
> **username_1**: Maybe add electrum to the question title - Google might show this for generic import queries otherwise, and the import process will likely differ for different clients  
> **username_0**: Good plan! And, done.  
> **username_0**: This Q/A is linked on [Puzzling.SE](https://puzzling.stackexchange.com/questions/62588/who-can-solve-this-cipher).  

---

## 1 answers

### Answer by username_0 on 2018-03-29. Score: 2 | Accepted answer

The entire process is as follows: (these instructions are correct for Electrum v3.0.6)

1. Install Electrum. The installation methods vary but, the official download is [here](https://bitcoin.org/en/wallets/desktop/windows/electrum/). On some varieties of Linux it is in the default distro repository.
2. Run Electrum.
   1. Choose Automatically Connect and click on Next.
   2. Name your wallet if you like or accept the default and click on Next.
   3. Select Standard Wallet and click on Next.
   4. Select Create a new seed and click on Next.
   5. Select Segwit and click on Next.
   6. Securely, privately and accurately store your seed. This is your wallet backup. If it is lost all your BTC is gone permanently. Click on Next.
   7. Type your seed in the box and click on Next to verify you have it correctly.
   8. Set a good password that you will never forget. This must be secure to ensure your wallet cannot be stolen. Click on Next.
   9. Your wallet is setup.
3. With Electrum setup and running, go to View -> Show console.
4. Click on the Console tab.
5. Using the instructions from [here](https://bitcoin.stackexchange.com/questions/72911/importing-private-keys-creates-different-address):
   1. Type (or copy and paste) at the >> prompt `key = 'your_key'` and press `Enter` (leave the single quotes in).
   2. Type (or copy and paste) at the >> prompt `txin_type, secret, compressed = bitcoin.deserialize_privkey(key)` and press `Enter`.
   3. Type (or copy and paste) at the >> prompt `wif2 = bitcoin.serialize_privkey(secret, compressed, 'p2wpkh-p2sh')` and press `Enter`.
   4. Type (or copy and paste) at the >> prompt `print(wif2)` and press `Enter`.
6. Highlight and copy the one-line string that is output (make sure you do not get any extra spaces) in your clipboard or, write it down.
7. Click on Wallet -> Private Keys -> Sweep
8. Paste the string you copied into the big box. The address that is pre-filled in starting (as of writing) with bc1 is one of your many receiving addresses. The balance will be transferred to that address.
9. Click on Sweep and follow the prompts (I didn't proceed to actually do this step - when I originally tested I used completely different steps to 'Import, not Sweep' just to prove it worked and not take the balance).
10. This will create a Bitcoin transaction transferring the balance to your own address.
11. Wait for at least 1 confirmations.

Done!

If you just want to import the address to make sure it is correct without trying to sweep you need different steps.

> **Comments:**
> **username_2**: That's sweeping rather than importing and as far as the private key format goes just prepend "p2wpkh-p2sh:" to the WIF and you're good to go in 3.1 or newer. You shouldn't be using old versions like 3.0.6.  
> **username_0**: @username_2 When Electrum gets the new version in the Fedora repository then I will get the new version.  
> **username_2**: in the case of Electrum you should be installing from source. That's because it updates far too frequently for distro repos to keep up.  

---

