2

I have my old wallet which private key is compromised. So my reasonable way is to open new wallet and move all bitcoins from compromised wallet to new wallet.

I use Bitcoin Core. I do not trust any online wallets because private key stored into remote store. So how can i open new wallet and move all bitcoin to it using Bitcoin Core only?

1
  • the best way is 1. close bitcoin-core 2.rename wallet.dat file to wallet-old.dat 3.start bitcoin-core (it creates new wallet and new wallet.dat file) 4. user bitecoin-core --wallet parameter to switch between new and old wallets Nov 27, 2017 at 4:37

1 Answer 1

2

the funds are linked to your "compromised" keys. They are not in your wallet. So you can generate a new set of keys (as you mentioned, by creating a new wallet), and then transfer from old address to new address. Before you start anything, think of backups! Procedure might be like this (attention: wallet dirs on Windows, Unix and OSX locations differ, depending on your OS, you may want to adopt):

0.) stop bitcoind or UI
1.) backup of old (compromised) wallet to USB stick
2.) rename bitcoin wallet directory to s.th. like "OLD_bitcoin_dir"
3.) start bitcoin (it will create new wallet and keys, get one of the public keys via MENU->FILE->RECEIVE ADDRESSES, cut&paste or write it down)
4.) stop bitcoind or UI
5.) rename wallet directory to s.th. like "NEW_bitcoin_dir"
6.) rename wallet directory "OLD_bitcoin_dir" to your original name
7.) start bitcoin
8.) transfer your funds to your new address from step 3
9.) wait until you "see" in a block explorer your funds on the new address
10.) stop bitcoin
11.) delete wallet dir
12.) rename wallet directory "NEW_bitcoin_dir" to your original name 
13.) check if funds are all there
14.) don't forget to backup again :-)

Hope this is the way to go, if there is an easier way within Bitcoin Core, I'd be happy to hear from the experts...

3
  • Note: you can also use the -wallet command line parameter when you start bitcoin to specify which wallet to load rather than having to rename them each time :) Nov 1, 2017 at 18:41
  • I use Windows OS. What is the "bitcoin wallet directory" on Windows and where can i find it? i have "bitcoin-data" directory on separate hard drive and few subfolders inside it ("blocks", "chainstate", "testnet3"). And wallet.dat file inside "bitcoin-data". Nov 2, 2017 at 9:59
  • ugh, Windows, I don't know. Usually, the "bitcoin wallet directory" is were your wallet.dat file is. Look at the comment from MeshCollider. You may want to go into the help menu, and choose "commandline options", and search for -wallet. This tells you how to provide a parameter to your folders or subfolders, where the file "wallet.dat" resides. Have a backup already? :-) Nov 2, 2017 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.