How to move an address to a new wallet? I have a wallet with several addresses. I would like to isolate one of the addresses in its own wallet, but I don't know how to do it. I've been trying with pywallet.py, but I've been unable to do it.

Can you help me, please?

EDIT: I've made some progress:


I dumped my wallet with pywallet.py --dumpwallet &gt;wallet.json, and searched for the key I wanted to isolate, and wrote down the field named sec.
Then moved wallet.dat to another folder, and started bitcoin-qt, so it generated a new wallet.
Opened Help -&gt; Debug window -&gt; console and run importprivkey  XXXXXXXX mykeylabel. It took about 4 minutes to import the key.


Now I still need to:


remove this address from the old wallet.
remove the default address in the new wallet, so it contains just the imported address.
You can do that via the default bitcoind API.

I suppose you are used to use Bitcoin-Qt? Then most probably the bitcoind daemon is also installed on your computer.

You can move an address from one wallet to another using the setaccount command. It works as follows.

setaccount &lt;bitcoinaddress&gt; &lt;account&gt;

So, when you have an address, let's say 1HDPmDGcgXkRTBbACYXNQ1SNeoCQEPvN3v, that you want to move from wallet1 to wallet2, then you can do the following command.

setaccount 1HDPmDGcgXkRTBbACYXNQ1SNeoCQEPvN3v wallet2

You can perform these commands most easily from a command line interface. In Unix systems where bitcoind is installed, you can do the following:


Make sure Bitcoin-Qt is closed.
Launch bitcoind as a daemon:


bitcoind -daemon


Do the command I mentioned above: (It's possible that you get an error that the Bitcoin server is not yet running, just wait a little.)


bitcoind setaccount 1HDPmDGcgXkRTBbACYXNQ1SNeoCQEPvN3v wallet2