Bitcoin Forum
May 07, 2024, 03:34:16 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Problems importing private key from paper wallet to bitcoin-qt  (Read 751 times)
kbdwarrior (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 9


View Profile
September 23, 2017, 09:47:58 PM
Merited by ABCbits (1)
 #1

For testing purposes I sent some BTC to a paper wallet from my bitcoin-qt client and later, after ~50 confirmations I imported the private key from the paper wallet back into bitcoin-qt with the command

Code:
importprivkey $key $label rescan

and after finishing the rescan it doesn't show anything. Well, almost nothing, it renamed the paperwallet address I sent to in the first place to "$label" in the outgoing transaction, but no other sign of the imported private key, especially the balance didn't change. The Blockchain explorer shows that the funds are still under the associated paper wallet address.

Can anybody explain why the funds don't show up under balance, what I did wrong, and how importing a private key into bitcoin-qt is done correctly?

Thanks!
"Governments are good at cutting off the heads of a centrally controlled networks like Napster, but pure P2P networks like Gnutella and Tor seem to be holding their own." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715052856
Hero Member
*
Offline Offline

Posts: 1715052856

View Profile Personal Message (Offline)

Ignore
1715052856
Reply with quote  #2

1715052856
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6587


Just writing some code


View Profile WWW
September 23, 2017, 11:45:32 PM
Merited by ABCbits (1)
 #2

What are you using to run this command?

Are you sure that $key refers to the actual private key string? Does the private key begin with a '5', 'K', or 'L'?

Is Bitcoin Core fully synced?

HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
September 24, 2017, 03:51:35 AM
Last edit: November 15, 2023, 08:39:01 AM by HCP
 #3

Since that address is now part of your wallet after the import... Could it be that Bitcoin Core is now treating it as though you just sent the funds to yourself??

Does the "outgoing" transaction now show in the transaction list as type "Payment to yourself" with a net value of just the transaction fee? Something like this:




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


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
kbdwarrior (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 9


View Profile
September 24, 2017, 11:22:26 AM
 #4

I used the debug window -> console to run the commands. The $key was fine and beginning with a 5 and the node was fully synced.

After a good nights sleep I opened my bitcoin-qt again and the display had changed.

Ok, originally I did the following:

Sent from my bitstamp account to bitcoin-qt:
0.29498000
received in bitcoin-qt:
0.29498000
where's the fee gone here? Why does this tx not show any fee?

Then sent to my paperwallet:
0.20000000
what cost me a fee of
0.00032399
this tx showing up in my bitcoin-qt as, well I don't remember exactly, I should have taken a screenshot
Anyway, there ended up on my paper wallet address
0.01967601
then I imported the private key as written in my OP and all that changed was the display of the paper wallet address as $label that I assigned when doing the import

Today, after ~12 hours I restarted the bitcoin-qt and now it shows the fee of the tx to the paper wallet as a payment to myself
-0.00032399
and the balance of my wallet is now
0.29465601

So everything adds up as it should. Why didn't the bitcoin-qt show that immediately after the rescan?

When I look at the tx of the "payment to myself" with "gettransaction" in the console, I see the fee, the amount on the paper wallet once as "spend" and once as "receive" and the address of the paper wallet.

So obviously everything is ok, I'm only confused, partially by my lack of understanding of bitcoin transactions, partially by the weird interface of bitcoin-qt.

Thanks for your help.

Edit:

Now I spent everything in my bitcoin-qt wallet to a new address making another payment to myself, just to be sure that bitcoin-qt really controls the paper wallet key, and the balance of the paper wallet is now zero on the blockchain explorer, and everything is moved to the new address (minus fee). So everything works as expected, except the bitcoin-qt UI, that's a bit weird.
LoyceV
Legendary
*
Offline Offline

Activity: 3304
Merit: 16609


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
September 25, 2017, 09:00:50 AM
Merited by ABCbits (1)
 #5

Why didn't the bitcoin-qt show that immediately after the rescan?
All I can think of is that somehow your Bitcoin Core wasn't synced completely. I've done this same procedure before, and it always worked out just fine.

I do have two recommendations for the future:
1. Use smaller amounts to get familiar with paper wallets. Instead of testing things with $800, use $2.
2. Before funding a paper wallet, import the address (not the private key!) into Bitcoin Core:
    importaddress 1addy PaperWallet1addy false
    The "false" prevents a rescan. If you fund the paper wallet after this, it shows up as Watch-only and the balance is nicely updated. Since Bitcoin Core now knows your balance, you can later import the private key without a rescan.

kbdwarrior (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 9


View Profile
September 25, 2017, 11:41:30 AM
 #6

Thanks for the tip, will try this!
kbdwarrior (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 9


View Profile
September 25, 2017, 03:03:38 PM
 #7

More questions to this:

2. Before funding a paper wallet, import the address (not the private key!) into Bitcoin Core:
    importaddress 1addy PaperWallet1addy false
    The "false" prevents a rescan. If you fund the paper wallet after this, it shows up as Watch-only and the balance is nicely updated. Since Bitcoin Core now knows your balance, you can later import the private key without a rescan.

You emphasize the before, importing an address cannot be done after funding the paper wallet?

And if I hold private keys with some UTXOs at the corresponding address in the bitcoin-qt wallet and one or several watch-only addresses as well and this is all intermingled together to a single balance, how can I differentiate what values are spendable from the bitcoin-qt wallet and what belongs to the paper wallets?

Thx!
LoyceV
Legendary
*
Offline Offline

Activity: 3304
Merit: 16609


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
September 25, 2017, 03:33:29 PM
Merited by ABCbits (1)
 #8

You emphasize the before, importing an address cannot be done after funding the paper wallet?
Of course you can always import any watch-only address. The only benefit from doing it before funding it, is that you don't need a rescan.
If the address is funded already, any import requires a rescan to show an accurate balance. Importing unfunded watch-only addresses saves time, that's all.

Quote
And if I hold private keys with some UTXOs at the corresponding address in the bitcoin-qt wallet and one or several watch-only addresses as well and this is all intermingled together to a single balance, how can I differentiate what values are spendable from the bitcoin-qt wallet and what belongs to the paper wallets?
Bitcoin Core adds a new column "Watch-only", like this:

kbdwarrior (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 9


View Profile
September 25, 2017, 04:00:34 PM
 #9

Thanks, you're the man! Very helpful!
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!