Bitcoin Forum
May 14, 2024, 07:10:57 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin Core generates wrong private key?  (Read 206 times)
Questfor (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 5


View Profile
February 16, 2021, 04:14:14 PM
Merited by LoyceV (2), o_e_l_e_o (2), ABCbits (1)
 #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?
1715670657
Hero Member
*
Offline Offline

Posts: 1715670657

View Profile Personal Message (Offline)

Ignore
1715670657
Reply with quote  #2

1715670657
Report to moderator
1715670657
Hero Member
*
Offline Offline

Posts: 1715670657

View Profile Personal Message (Offline)

Ignore
1715670657
Reply with quote  #2

1715670657
Report to moderator
1715670657
Hero Member
*
Offline Offline

Posts: 1715670657

View Profile Personal Message (Offline)

Ignore
1715670657
Reply with quote  #2

1715670657
Report to moderator
"Bitcoin: the cutting edge of begging technology." -- Giraffe.BTC
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
NotATether
Legendary
*
Offline Offline

Activity: 1596
Merit: 6740


bitcoincleanup.com / bitmixlist.org


View Profile WWW
February 16, 2021, 04:21:16 PM
Merited by LoyceV (2), o_e_l_e_o (2), ABCbits (1)
 #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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Questfor (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 5


View Profile
February 16, 2021, 05: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.
LoyceV
Legendary
*
Online Online

Activity: 3304
Merit: 16655


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
February 16, 2021, 05: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?

Questfor (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 5


View Profile
February 16, 2021, 05: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
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
February 17, 2021, 09:16:19 PM
Merited by LoyceV (4), malevolent (2)
 #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")

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
daniela1968
Newbie
*
Offline Offline

Activity: 4
Merit: 2


View Profile
February 18, 2021, 10:43:53 AM
Merited by LoyceV (2)
 #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
LoyceV
Legendary
*
Online Online

Activity: 3304
Merit: 16655


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
February 18, 2021, 11: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.

ranochigo
Legendary
*
Offline Offline

Activity: 2968
Merit: 4186



View Profile
February 18, 2021, 11: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.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
February 25, 2021, 08: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.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!