It took me entirely too long to find instructions on exactly how to do this, so I'm writing a concise guide here.
Scenario:
You have a non-HD wallet, and you want to convert to an HD wallet. Or, you have a specific receiving address, and you want to give all the coins received by that address to another person. You want to transfer these coins without a transaction fee.
Requirements
You need to have a non-pruned full node in order to do this.
How to:
- Load up the wallet.dat file(s) which contains the coins and address(es) which you need to transfer to the new wallet.
- Go into receiving addresses and copy all of the addresses which have recieved coins in this wallet into a notepad or similar tool.
- Open the debug console
- If the wallet is encrypted, type in walletpassword "<your wallet password>" 600 this will give you 10 minutes to fiddle with addresses before having to unlock the wallet again. You can type walletlock to re-lock the wallet at any time. Do not include the <> in your password.
- dumpprivkey "<receiving address>" Repeat this command for each receiving address you have. Do not include the <>. Copy-paste the private key into the notepad beneath the key you got it from, it will be longer than the receiving address.
- Close down your wallet.
- Swap your wallet files around such that the new wallet (the one you want the coins in) is wallet.dat
- Start up the wallet
- Open the debug console
- If the wallet is encrypted, you'll need to use walletpassword.
- importprivkey "<priv key>" "<recieving_addr_label>" false If you are entering more than one private key, use the 'false' keyword at the end. However, remove 'false' for the last key you are adding.
- Wait 10-30 minutes while your client rescans the entire blockchain, single-threaded (FOR SOME REASON!?! OMG SOMEONE MAKE THIS SHIT PARALLEL!), for transactions that used those keys.
- When the rescan finishes, you should see all the coins received by that address in your wallet.
submitted by /u/Kingdud
[link] [comments]