Author

Topic: Bitcoin Core generates wrong private key? (Read 240 times)

HCP
legendary
Activity: 2086
Merit: 4361
February 25, 2021, 03:45:35 PM
#10
If you have BIP38 encryption on your paper wallet with a passphrase, you'll have to go to Bitaddress or something similar for it to be decrypted into something starting with either 5, K or L. After which, you can import the private keys.

I recommending downloading the source code from here: https://github.com/pointbiz/bitaddress.org/releases. Choose the source code zip and extract it. You should see a html file and run it with your internet connection turned off.
If:
- you have an android device...
- AND your paper wallet is BIP38 encrypted...
- AND your paper wallet has a QRCodes...

Then, you can use Mycelium to easily scan the (encrypted) private key QRCode and it has BIP38 decryption built in... it will even "auto scan" the blockchain to determine if the paper wallet actually holds any funds.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
February 18, 2021, 06:32:18 AM
#9
Hi, i am sorry to side rail this but i think this is part of the solution to my problem. I have been have problems with Blockchain,com verification emails. I have some cold storage paper wallets that i was looking to import there but with all the problems i am leary about this. I have a new computer so am just downloading the newest bitcoin QT however need help please to import my private keys from the paper wallet one the core has fully loaded . Is this possible?
I see all your instructions above but am really not very tech savy , could you give me a little more detail to this please. thanks
If you have BIP38 encryption on your paper wallet with a passphrase, you'll have to go to Bitaddress or something similar for it to be decrypted into something starting with either 5, K or L. After which, you can import the private keys.

I recommending downloading the source code from here: https://github.com/pointbiz/bitaddress.org/releases. Choose the source code zip and extract it. You should see a html file and run it with your internet connection turned off.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
February 18, 2021, 06:22:48 AM
#8
import my private keys from the paper wallet one the core has fully loaded . Is this possible?
That's possible: click Help > Debug window > type "importprivkey" followed by your private key.
Rescanning takes quite a while.

Quote
I see all your instructions above but am really not very tech savy
For paper wallets with QR-code, a mobile wallet such as Mycelium on Android is much easier.

However:
Quote
cold storage paper wallets
You're talking about cold storage. Depending on the value (and how much money you're risking) you may want to keep the private keys offline, which means none of the above, because all of it could put your funds at risk for malware.
Cold storage with offline signing isn't a non-tech-savy approach though.

After moving your Bitcoins, and only if your paper wallets are old enough, you may still have some Forkcoin value left on them. Don't throw them out yet.
newbie
Activity: 4
Merit: 2
February 18, 2021, 05:43:53 AM
#7
4. Open console and dump priv key for that address

How are you exporting the private key? Did you run dumpprivkey YOUR_ADDRESS?

Can you try creating a new Bitcoin Core wallet, and then importing that private key into the new wallet using importprivkey, and see if the new wallet shows a different address?

Alternatively it's possible that in Electrum you pasted the private key without putting p2wpkh: in front of it. If you don't do that then you might generate an address starting with a "1" or "3" instead of native segwit's bc1.

Hi, i am sorry to side rail this but i think this is part of the solution to my problem. I have been have problems with Blockchain,com verification emails. I have some cold storage paper wallets that i was looking to import there but with all the problems i am leary about this. I have a new computer so am just downloading the newest bitcoin QT however need help please to import my private keys from the paper wallet one the core has fully loaded . Is this possible?
I see all your instructions above but am really not very tech savy , could you give me a little more detail to this please. thanks
HCP
legendary
Activity: 2086
Merit: 4361
February 17, 2021, 04:16:19 PM
#6
For example
Code:
p2wpkh-p2sh:5BitcoinPrivateKey
This should generate the corresponding p2wpkh-p2sh bitcoin address.

For example
Code:
p2wpkh:5PrivateKey
This should generate the corresponding Bech32 address
Just a quick note... you should NOT be using WIF keys that start with a "5" for generating SegWit addresses... these are for "uncompressed" keys... and can cause a great deal of grief! Shocked

Only use WIF keys that start with a "K" or an "L" for SegWit. I would hope that any decent wallet would spit out an error and/or warning when trying to use "uncompressed" keys.


Quote
Bitaddress doesn't support Segwit, right?
No, it doesn't... you'd need to use https://segwitaddress.org/ (for Nested Segwit aka "3" type) and https://segwitaddress.org/bech32/ (for native segwit aka "bc1")
newbie
Activity: 3
Merit: 5
February 16, 2021, 12:11:34 PM
#5
Quote
For P2WPKH addresses (Bech32, starting with 'bc1')
This time we'll add p2wpkh: in front of the private key.
For example
Code:
p2wpkh:5PrivateKey

This actually worked. Thanks  Shocked I think I used p2wpkh-p2sh prefix previously. Still is very confusing for me but at least now I have confirmed that private key generated in offline and unsynced bitcoin core wallet can be imported to electrum
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
February 16, 2021, 12:02:00 PM
#4
Alternatively it's possible that in Electrum you pasted the private key without putting p2wpkh: in front of it. If you don't do that then you might generate an address starting with a "1" or "3" instead of native segwit's bc1.
Correct. Full version:
For P2SH-P2WPKH addresses (Addresses starting with "3")
Just add p2wpkh-p2sh: directly in front of your  private key.
For example
Code:
p2wpkh-p2sh:5BitcoinPrivateKey
This should generate the corresponding p2wpkh-p2sh bitcoin address.

For P2WPKH addresses (Bech32, starting with 'bc1')
This time we'll add p2wpkh: in front of the private key.
For example
Code:
p2wpkh:5PrivateKey
This should generate the corresponding Bech32 address

It's about time Electrum checks all possible address formats on it's own. I can never remember what to type.

6. When you enter that private key into bitadress.org it shows completely different public address and does not show the one you generated in bitcoin core (bc1***)
Bitaddress doesn't support Segwit, right?
newbie
Activity: 3
Merit: 5
February 16, 2021, 12:00:47 PM
#3
I used command
dumpprivkey bc1(recieve address I just generated)

I tried importing into electrum with prefix but no luck either. Just like I explained in point 6 when you paste that private key into bitaddress.org (offline version from github) you get many addresses but none even looks like recieve address generated in bitcoin core (bc1.....)
Same situation happens when you generate address with native segwit Bech32 unchecked.

Quote
Can you try creating a new Bitcoin Core wallet, and then importing that private key into the new wallet using importprivkey, and see if the new wallet shows a different address?
Just did that on fresh linux virtual machine.

Code:
importprivkey (...)
null

And nothing else happened.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
February 16, 2021, 11:21:16 AM
#2
4. Open console and dump priv key for that address

How are you exporting the private key? Did you run dumpprivkey YOUR_ADDRESS?

Can you try creating a new Bitcoin Core wallet, and then importing that private key into the new wallet using importprivkey, and see if the new wallet shows a different address?

Alternatively it's possible that in Electrum you pasted the private key without putting p2wpkh: in front of it. If you don't do that then you might generate an address starting with a "1" or "3" instead of native segwit's bc1.
newbie
Activity: 3
Merit: 5
February 16, 2021, 11:14:14 AM
#1
I try to make this short, has anyone enounterd a problem where private key from bitcoin core gives different address with 0 balance when imported info electrum?

Steps to reproduce.
1. Install bitcoin core 0.21.0 on windows or linux
2. Cant sync because machine is offline
3. Create wallet and generate native segwit address to recieve coins (it starts with bc1***)
You can send some coins on that address and it can be searched on blockchain explorer
4. Open console and dump priv key for that address
5. When you try to import that key into Electrum the balance shows 0
6. When you enter that private key into bitadress.org it shows completely different public address and does not show the one you generated in bitcoin core (bc1***)

My question is, is it really a bug in 0.21.0 version, or maybe its not possible to move wallets like that?
Jump to: