Bitcoin Forum
December 14, 2024, 05:30:12 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Imported private key for Vanity address, now in two different wallet.dat files?  (Read 160 times)
random_australian (OP)
Jr. Member
*
Offline Offline

Activity: 34
Merit: 4


View Profile
May 12, 2020, 04:43:46 AM
 #1

I generated a vanity address using reputable open source software on my home PC, taking precautions like not being connected to the internet etc. Everything went well, so instead of risking my actual wallet.dat file, I opened bitcoin core with no wallet.dat, so it generated a new, empty one, with no bitcoin or transactions. I used the importprivkey command to import the private key of my vanity wallet, everything went well.

Then i closed bitcoin core, backed that new walled.dat file up, and fired bitcoin core back up with my everyday wallet.dat that has my bitcoin. I sent a small amount to my vanity address as a test, but bitcoin core showed I sent the bitcoin to myself, and when i had a look, I had the vanity address in this wallet.dat, as well as the empty wallet. I am unsure why this happened? Shouldn't importing a private key only be linked to the wallet.dat file it was imported into? How does one wallet.dat know what happened it a separate wallet.dat.

Does bitcoin core store the private keys somewhere other than wallet.dat, or when a new wallet.dat is created on the same computer, is it deterministically linked to previous wallet.dat's created on that computer?

In short, how did my existing wallet.dat get the private key I imported when running a different, brand new, never before used wallet.dat?
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4363

<insert witty quote here>


View Profile
May 12, 2020, 05:19:56 AM
 #2

I opened bitcoin core with no wallet.dat, so it generated a new, empty one, with no bitcoin or transactions.
How exactly did you do this? Did you shutdown Bitcoin Core, move (not copy) the original wallet.dat file, and then start Bitcoin Core?


Quote
Does bitcoin core store the private keys somewhere other than wallet.dat, or when a new wallet.dat is created on the same computer, is it deterministically linked to previous wallet.dat's created on that computer?
No... they're not saved anywhere... and No, a newly created wallet.dat should contain a completely different and random seed (and different addresses etc).


Quote
In short, how did my existing wallet.dat get the private key I imported when running a different, brand new, never before used wallet.dat?
It would appear that you've either imported that private key before (have you previously used vanitygen?)... or you hadn't actually opened Bitcoin Core with a "new" wallet.dat and you actually imported the private key into your "original" wallet.dat

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


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
random_australian (OP)
Jr. Member
*
Offline Offline

Activity: 34
Merit: 4


View Profile
May 12, 2020, 05:36:47 AM
 #3

Quote
How exactly did you do this? Did you shutdown Bitcoin Core, move (not copy) the original wallet.dat file, and then start Bitcoin Core?

Before opening Bitcoin Core, I backed up my everyday wallet. I then deleted the copy of wallet.dat in the Bitcoin folder.
I then opened Bitcoin Core, it behaved as expected, it had a brand new looking wallet, with no bitcoin and no transaction history.
I then used importprivkey ############### "MyVanityNickname" in console. It took like 30 min to rescan.
I could not see any address in the address book, which I thought was weird, but as it had no bitcoin and no transactions, I thought maybe it might just not show up
So I shut down Bitcoin Core. I backed up this new Wallet.dat file, then I copied over my existing wallet.dat file to the Bitcoin folder. Computer says " Do you want to replace the existing wallet.dat" and I say yes.
I fire up Bitcoin Core. It is my old existing wallet as expected, with my bitcoin, and my transactions. To test that the import happened correctly, i send a tiny amount of bitcoin to the Vanity public address.
Transaction history now shows I sent a transaction to myself, and "MyVanityNickname" is in my address book. This I found very weird.
I shut down, backed up again, moved the new wallet.dat back into bitcoin folder (ie the empty one I imported priv key into), fire it up.
New wallet.dat shows the tiny balance I just sent it, but nothing else.
I power it down, swap wallet.dat files again, fire up my old wallet. It shows the tiny amount being sent to myself. To test I then select input coin control, to see if I can send tiny amount to my mobile wallet. ( ie see if my old wallet does actually have the private key to that address)
Bitcoin are sent to my mobile successfully.

Quote
It would appear that you've either imported that private key before (have you previously used vanitygen?)... or you hadn't actually opened Bitcoin Core with a "new" wallet.dat and you actually imported the private key into your "original" wallet.dat

Nope neither of those things I don't think. Definitely had not imported it before. The new wallet was generated because their was no wallet.dat in the bitcoin folder. Which is why I was wondering if when bitcoin core generates a new wallet.dat file, if it is deterministically linked each time.


random_australian (OP)
Jr. Member
*
Offline Offline

Activity: 34
Merit: 4


View Profile
May 12, 2020, 05:54:16 AM
 #4

I copied some public addresses from my everyday wallet, and checked in the new wallet if it owned those same addresses, it came back false.

But when i do the same for the vanity address, both wallets come back true. I must have screwed up somewhere, I just can't for life of me work out where. It's not like I will ever use the vanity address for anything valuable, so it doesn't really matter, the mystery is just weirding me out.
nc50lc
Legendary
*
Offline Offline

Activity: 2632
Merit: 6512


Self-proclaimed Genius


View Profile
May 12, 2020, 06:08:49 AM
 #5

So I shut down Bitcoin Core. I backed up this new Wallet.dat file, then I copied over my existing wallet.dat file to the Bitcoin folder. Computer says " Do you want to replace the existing wallet.dat" and I say yes.
Did you do all of these within a minute?
Because Bitcoin Core will take a few seconds to shutdown before it fully shuts down.
During that time, it may have "redone" what you've done in the copied-over wallet.dat to the "everyday wallet" because "releasing wallet.dat" is in the last part of the shutdown process.

I can only guess since what happened was bizarre if there's no human error involved.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
random_australian (OP)
Jr. Member
*
Offline Offline

Activity: 34
Merit: 4


View Profile
May 12, 2020, 06:12:40 AM
 #6

So I shut down Bitcoin Core. I backed up this new Wallet.dat file, then I copied over my existing wallet.dat file to the Bitcoin folder. Computer says " Do you want to replace the existing wallet.dat" and I say yes.
Did you do all of these within a minute?
Because Bitcoin Core will take a few seconds to shutdown before it fully shuts down.
During that time, it may have "redone" what you've done in the copied-over wallet.dat to the "everyday wallet" because "releasing wallet.dat" is in the last part of the shutdown process.

I can only guess since what happened was bizarre if there's no human error involved.

I always make sure of that, at least I think I do. And the fact that only the Vanity address is shared is weird.
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!