Create a new wallet for your data directory

From Bisq Wiki
Revision as of 16:58, 17 November 2023 by SuddenWhipVapor (talk | contribs)
Jump to navigation Jump to search

When you just need a fresh new wallet, but want want to keep everything else (accounts, signing status, onion address, trade history, notifications app association, and other custom settings), it is easier and faster to only generate a new wallet for Bisq, rather than switching to a new data directory.

WORK IN PROGRESS

Why creating a new wallet?

Being a project built in Java, Bisq uses BitcoinJ, which is a Java library to manage a bitcoin wallet. This comes with some known limitations, among which is the heavy performance hit when the wallet is old, and contains many transactions, which is especially aggravating whenever a user needs to do a SPV resync, as it will take a significant amount of time during which the PC will suffer from high load, and to top it off, with old-time and/or most active traders, who have many past transactions built up in their wallet, this is even more at risk of happening, all the while causing a forced interruption in their trading, as SPV resync must be complete before the application can resume the trading operations.

Recreating a completely new Bisq wallet will eliminate the issue, at least for the near future (running your personal Bitcoin node also helps a lot with stability), at the same time preserving all the accrued reputation of your payment accounts, your full trading history, and your existing onion address, by which your past trading peers will be able to recognize you.

Preparations

Make sure the following checklist is observed:

  • no existing open offers (delete them -this will make you lose the fees- or wait until they are taken, and their respective trades are completed)
  • no existing open trades (wait until they are completed)
  • no existing disputes (wait until their resolution)
  • consistent wallet state (go to Funds > Send Funds, and for each btc address containing funds, verify its balance actually exists by searching the address on mempool.space, otherwise do a SPV resync and repeat)

Instructions

If the above requirements are met, and assuming you have BTC (and probably BSQ as well) in your old wallet, you can follow the procedure outlined below:

  1. close Bisq
  2. rename the data directory,for example to Bisq.old (this is equivalent to creating a backup copy, as the original contents are still on your disk)
  3. start Bisq
  4. a completely new data directory will be created (including a new wallet, which is the one we will be using soon to replace the old one)
  5. go to Account > Wallet seed and write down the seed of the new wallet, as precautionary measure
  6. go to Funds > Receive Funds and copy the first btc receive address, pasting it into a separate text file for later use (you could get multiple addresses if you want to split the original funds into multiple utxos on the receiving wallet)
  7. go to DAO > BSQ Wallet > Receive and copy the BSQ receive address of the new wallet, pasting it into your notes
  8. close Bisq
  9. rename the newly created data direcory, for example to Bisq.new, and rename the previous directory from Bisq.old to Bisq
  10. start Bisq
  11. go to DAO > BSQ Wallet > Send and send all your BSQ balance to the BSQ receive address of the new wallet (this needs to be done first! if you moved out all your BTC, there will be none left to pay for the mining fees to move the BSQ)
  12. go to Funds > Send Funds and move all your BTC balance to the BTC receive address(es) of the new wallet
  13. close Bisq
  14. within the data directory, navigate to the contents of btc_mainnet and rename the wallet folder to wallet.old
  15. copy the wallet folder from the same location in Bisq.new, into the btc_mainnet folder of the "old" data directory, so that now there will be wallet and wallet.old folders under btc_mainnet
  16. start Bisq, wait until wallet is synchronized with the blockchain, and verify that all your funds were correctly moved, checking the contents of Funds > Send Funds, and DAO > BSQ Wallet
  17. you can now operate normally with Bisq, knowing that the brand new wallet will be used instead of the old one


What if you simply want to create a new wallet, but there are no funds in the old wallet?

If for whatever reason you wish to switch to a brand new wallet, even if there are no funds (anymore) in the previous one, the procedure is much simpler:

  1. close Bisq
  2. navigate to your data directory and into the btc_mainnet folder
  3. rename the wallet folder to wallet.old
  4. start Bisq, notice a new wallet was created, write down the new seed

Disaster recovery

In case you made some mistakes along the way and things don't work as they should, and provided you never deleted anything, but rather renamed the folders as suggested above, you can go back to the starting point by simply making sure, after closing Bisq, that the data directory gets back to its original state, that is, Bisq.old is renamed to Bisq, and, if you got to that point, wallet.old to wallet.

Cleanup

Only after you are absolutely sure everything is in order, and if you need to free up as much disk space as possible, you can delete the Bisq.new and wallet.old folders.