Bitcoin Forum

Bitcoin => Electrum => Topic started by: vshogg on April 23, 2018, 08:05:19 PM



Title: Electrum doesn't restore right wallet address
Post by: vshogg on April 23, 2018, 08:05:19 PM
Hi guys,

I created new wallet using bitcoin core but I don't want to wait for full sync. I'm trying to move my bitcoin address to the Electrum I used 'dumpprivkey' and tried to restore it using electrum but unfortunately it restores it with wrong address. If I put my btc address in electrum I can see my bitcoins but can't use them.

See screenshot: http://prntscr.com/j94wmu

Tool 'importprivkey' in bitcoin core restores right address.
I also can't import right address on blockchain.info using given private key.

The https://www.bitaddress.org/ 'wallet details' shows that 'wrong' address as 'Bitcoin Address Compressed'.

Bitcoin core v 0.16

can anyone help me?


Title: Re: Electrum doesn't restore right wallet address
Post by: achow101 on April 23, 2018, 08:20:28 PM
Your address for Bitcoin Core is a segwit address. However there is currently no standard way for exported private keys to indicate that the address to create is a segwit address. When you import that into any wallet, it will assume that the private key is for the non-segwit address, and thus you get the non-segwit address in Electrum.

AFAIK there is currently no way to import private keys for segwit addresses from Bitcoin Core to Electrum.


Title: Re: Electrum doesn't restore right wallet address
Post by: LoyceV on April 23, 2018, 08:45:17 PM
AFAIK there is currently no way to import private keys for segwit addresses from Bitcoin Core to Electrum.
I read (and bookmarked) this 2 days ago:
In the field where you enter the private key, enter p2wpkh-p2sh: in front of the private key.
For example, do this:
Code:
p2wpkh-p2sh:5BlahBlah
Replace "5blahblah" with your private key.
It should import the correct address

I haven't tested it yet, but if it works, I want to merit him.


Title: Re: Electrum doesn't restore right wallet address
Post by: vshogg on April 23, 2018, 09:03:59 PM
Yay! Bingo! It works in Electrum

You saved my ass from weeks of waiting :D

Thanks guys


Title: Re: Electrum doesn't restore right wallet address
Post by: HCP on April 23, 2018, 11:21:01 PM
I read (and bookmarked) this 2 days ago:
In the field where you enter the private key, enter p2wpkh-p2sh: in front of the private key.
For example, do this:
Code:
p2wpkh-p2sh:5BlahBlah
Replace "5blahblah" with your private key.
It should import the correct address

I haven't tested it yet, but if it works, I want to merit him.
I have tested this method... and can confirm that it indeed works perfectly. You just need to use the "p2wpkh-p2sh:" prefix on your private key and Electrum will generate the p2wpkh-p2sh SegWit address. :)


Title: Re: Electrum doesn't restore right wallet address
Post by: BitMaxz on April 23, 2018, 11:26:37 PM
AFAIK there is currently no way to import private keys for segwit addresses from Bitcoin Core to Electrum.
I read (and bookmarked) this 2 days ago:
In the field where you enter the private key, enter p2wpkh-p2sh: in front of the private key.
For example, do this:
Code:
p2wpkh-p2sh:5BlahBlah
Replace "5blahblah" with your private key.
It should import the correct address

I haven't tested it yet, but if it works, I want to merit him.

The only thing that I know to get your bitcoin out from bitcoin core segwit wallet is via sweeping, but it needs a 3rd party tool

You can find the tool from this site https://segwitaddress.org/

However, I don't know if it's safe or not, but this site already been discussed here https://bitcointalk.org/index.php?topic=2767422.25

Yay! Bingo! It works in Electrum

You saved my ass from weeks of waiting :D

Thanks guys
How? can you share it with us if how did you import the private key from bitcoin  core segwit to electrum?



Title: Re: Electrum doesn't restore right wallet address
Post by: Xynerise on April 23, 2018, 11:30:20 PM
How? can you share it with us if how did you import the private key from bitcoin  core segwit to electrum?
It's in my post that LoyceV quoted above:
In the field where you enter the private key, enter p2wpkh-p2sh: in front of the private key.
For example, do this:
Code:
p2wpkh-p2sh:5BlahBlah
Replace "5blahblah" with your private key.
It should import the correct address
PS
If it's a Bech32 address then just add p2wpkh: in front of the private key.
Eg p2wpkh:KPrivateKey


Title: Re: Electrum doesn't restore right wallet address
Post by: LoyceMobile on April 24, 2018, 04:54:04 AM
If it's a Bech32 address then just add p2wpkh: in front of the private key.
Eg p2wpkh:KPrivateKey
Can you make a topic for this on this board? Many people will need this.
Google couldn't tell me this, and it's great information for segwit adoption.

I'd make the topic myself, but I don't want to steal your thunder.


Title: Re: Electrum doesn't restore right wallet address
Post by: TryNinja on April 24, 2018, 08:33:18 PM
If it's a Bech32 address then just add p2wpkh: in front of the private key.
Eg p2wpkh:KPrivateKey
Can you make a topic for this on this board? Many people will need this.
Google couldn't tell me this, and it's great information for segwit adoption.

I'd make the topic myself, but I don't want to steal your thunder.
And he did... Here it is for anyone who cares:

[GUIDE] Importing Electrum Segwit Private Key Into Bitcoin Core (And Vice Versa) (https://bitcointalk.org/index.php?topic=3383265)

Edit: just noticed that you are Loyce and already merited his thread. lol


Title: Re: Electrum doesn't restore right wallet address
Post by: LoyceV on April 25, 2018, 05:40:22 AM
And he did...
It makes sense to be on the Electrum board, but I've seen most questions about using a SegWit address from Bitcoin core (without syncing) on this board.
It's in my bookmarks to refer to now. Electrum should work on telling Google about this feature, I couldn't find it.