Author

Topic: Electrum/Bitcoin Core Importing Keys (Read 195 times)

hero member
Activity: 630
Merit: 502
January 31, 2018, 09:28:08 PM
#4
Hello, stranger from the future.
How is Bitcoin Core 0.16?
I saw Bitcoin Core v0.16.0rc1 with full Segwit support was released so I compiled from source.

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

I strongly recommend simply sending the coins over to the core wallet in an on-chain transaction.

However if you want to convert the priv keys to a standard format then here is how you can do that:

On the console tab (view show > console if it doesn't appear) type this:

Code:
format,privkey,compressed=bitcoin.deserialize_privkey("")

Then to generate the key for importing into core do:

Code:
bitcoin.serialize_privkey( privkey, compressed, "p2pkh")

The above should output a key in the standard WIF. You may need to addwitnessaddress for this address in core's debug console.


Thanks for the info. Fees shouldn't be much of a problem now by send from a Segwit address to another Segwit address. Last thing I'm wondering about is Electrum still supports importing normal Bech32 private key format but after importing from Bitcoin Core, the public address gets converted into legacy format starting with "1".
legendary
Activity: 3682
Merit: 1580
January 31, 2018, 04:34:43 PM
#3
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

I strongly recommend simply sending the coins over to the core wallet in an on-chain transaction.

However if you want to convert the priv keys to a standard format then here is how you can do that:

On the console tab (view show > console if it doesn't appear) type this:

Code:
format,privkey,compressed=bitcoin.deserialize_privkey("")

Then to generate the key for importing into core do:

Code:
bitcoin.serialize_privkey( privkey, compressed, "p2pkh")

The above should output a key in the standard WIF. You may need to addwitnessaddress for this address in core's debug console.

sr. member
Activity: 322
Merit: 363
39twH4PSYgDSzU7sLnRoDfthR6gWYrrPoD
January 31, 2018, 01:15:10 PM
#2
Hello, stranger from the future.
How is Bitcoin Core 0.16?
hero member
Activity: 630
Merit: 502
January 31, 2018, 06:28:58 AM
#1
I created a new Electrum 3.0.5 Segwit wallet then exported its private keys but when trying to import those keys into Bitcoin Core 0.16, I get "Invalid private key encoding" error.
When I create a Bech32 address in Bitcoin Core then import that private key into Electrum, the public address gets converted into legacy format starting with "1".
Jump to: