Post
Topic
Board Bitcoin Technical Support
Topic OP
Imported private key for Vanity address, now in two different wallet.dat files?
by
random_australian
on 12/05/2020, 04:43:46 UTC
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?