<p>Use this python script:</p>

<pre><code>from electrum import bitcoin

format,privkey,compressed=bitcoin.deserialize_privkey("&lt;yourprivatekeyhere&gt;")
print( bitcoin.serialize_privkey( privkey, compressed, "p2wpkh") )
</code></pre>

<p>Run the above in python 3 and then import the priv key it outputs into electrum as <a href="https://bitcoinelectrum.com/importing-your-private-keys-into-electrum/" rel="nofollow noreferrer">per this guide</a>.</p>

<p>The reason you have to do this is because Electrum went its own way with the private key format. See the <a href="https://github.com/spesmilo/electrum/blob/master/RELEASE-NOTES#L94" rel="nofollow noreferrer">release notes for 3.0</a>.</p>

CC BY-SA 3.0
2018-02-03T01:28:19.353Z
2018-02-03T01:36:53.787Z
2018-02-03T01:36:53.787Z
Abdussamad
<p>I have a segwit private key that I generated from another app. How can I create a new electrum wallet file with just this private key in there? </p>

<p>I tried creating a new electrum 3 wallet with this command: <strong>electrum create --segwit</strong></p>

<p>Then I tried to do an importpirvkey but it says that type of wallet doesnt support importing of addresses. How can I import my bc1 address into electrum as my only address?</p>

<address><private-key><electrum><segregated-witness>
Creating a new electrum 3 wallet file with an imported segwit private key
Patoshi パトシ
# Creating a new electrum 3 wallet file with an imported segwit private key

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

I have a segwit private key that I generated from another app. How can I create a new electrum wallet file with just this private key in there?

I tried creating a new electrum 3 wallet with this command: **electrum create --segwit**

Then I tried to do an importpirvkey but it says that type of wallet doesnt support importing of addresses. How can I import my bc1 address into electrum as my only address?

**Tags:** address, private-key, electrum, segregated-witness


---

## 1 answers

### Answer by username_1 on 2018-02-03. Score: 4

Use this python script:

```
from electrum import bitcoin

format,privkey,compressed=bitcoin.deserialize_privkey("<yourprivatekeyhere>")
print( bitcoin.serialize_privkey( privkey, compressed, "p2wpkh") )

```

Run the above in python 3 and then import the priv key it outputs into electrum as [per this guide](https://bitcoinelectrum.com/importing-your-private-keys-into-electrum/).

The reason you have to do this is because Electrum went its own way with the private key format. See the [release notes for 3.0](https://github.com/spesmilo/electrum/blob/master/RELEASE-NOTES#L94).


---

