2

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?

3

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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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