Bitcoin Forum

Bitcoin => Electrum => Topic started by: yuyo123 on July 27, 2018, 05:25:08 PM



Title: Not able to private keys into Electrum
Post by: yuyo123 on July 27, 2018, 05:25:08 PM
I'm trying to import the private keys from my Armory wallet into Electrum but when I select the "import bitcoin adresses or private keys" option and enter my private key the "next" button doesn't work. It stays grey and is can't be clicked. I already tried deleting and redownloading Electrum. Is there anything I could do?


Title: Re: Not able to private keys into Electrum
Post by: Abdussamad on July 27, 2018, 05:46:49 PM
the private keys have to be in wallet import format (WIF) or in mini key format. WIF private keys start with 5, L or K. mini private keys start with S. Examples are given below:

https://en.bitcoin.it/wiki/Private_key#Base58_Wallet_Import_format

Armory probably exports the private keys in WIF or plain hex format. I also believe it inserts spaces between the characters. If that's the case then remove the spaces before you import them.

If the priv keys are hexadecimal and not in WIF you can convert them using a python script or the electrum python console. I suggest creating a standard electrum wallet making sure to note down the seed then going to view menu > show console, switch to console tab and typing this in there:

Code:
hexpriv="<yourprivatekeyinhex>"
bitcoin.serialize_privkey(bytes.fromhex(hexpriv), True, "p2pkh")

It'll then spit out your priv key in WIF which you can sweep via wallet menu > private key > sweep or import into a new wallet if you prefer.

When you're done be sure to clear the console history or your private keys will be saved in plain text to disk:

Code:
window.console.history = []


edit2: Thanks to SombreNight (https://github.com/SomberNight) for help with that last command which clears the console history!


Title: Re: Not able to private keys into Electrum
Post by: elreymon on September 14, 2021, 03:17:05 PM
Not being able to impor private key. Do you know if Electrum ONLY accepts MASTER private keys (instead of only private keys) right now?


Title: Re: Not able to private keys into Electrum
Post by: OmegaStarScream on September 14, 2021, 03:41:49 PM
Not being able to impor private key. Do you know if Electrum ONLY accepts MASTER private keys (instead of only private keys) right now?

No, that's not the case. It should work fine as long as the private key is valid. Here, take a look at this topic: https://bitcointalk.org/index.php?topic=4746784.msg43255691#msg43255691

It's a step-by-step guide showing you how to export private keys from armory and sweep them into electrum.


Title: Re: Not able to private keys into Electrum
Post by: BitMaxz on September 14, 2021, 05:26:58 PM
Not being able to impor private key. Do you know if Electrum ONLY accepts MASTER private keys (instead of only private keys) right now?

Just adding this on OmegaStarScream suggestion above.

When importing to Electrum check the button info you will see this
https://i.imgur.com/VgFryZG.png

Choose any script type depending on what address type if it's legacy it should be p2pkh: or if its segwit then it should be p2wpkh:

Sample:
Code:
p2pkh:yourprivatekeyhere
p2wpkh-p2sh:yourprivatekeyhere
p2wpkh:yourprivatekeyhere

Now it should be work after you import if it's still not then you maybe got the wrong key just follow the guide posted above by OmegaStarScreem on how to export the private key from Armory.


Title: Re: Not able to private keys into Electrum
Post by: nc50lc on September 15, 2021, 02:57:31 AM
-snip- Do you know if Electrum ONLY accepts MASTER private keys (instead of only private keys) right now?
It depends on the type of Electrum wallet where you're importing private keys.
If you're importing to an existing wallet, you'll only be able to import to an "[Imported]" wallet, any other wallet will only have "sweep".

If into a new wallet, the "import bitcoin addresses or private keys" option in the new wallet wizard should work for private keys.