9

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 >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 -> Debug window -> 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.
5
  • Which client are you using?
    – o0'.
    Commented May 1, 2013 at 18:51
  • Bitcoin-qt but I'm thinking about trying Armory Commented May 1, 2013 at 18:59
  • What is the reason that you want to do this? In most cases, the easiest and safest thing to do is just send bitcoins from one wallet to another.
    – Eyal
    Commented May 2, 2013 at 7:34
  • 1
    While this is true, he might need to preserve that key if he publicized widely that address.
    – o0'.
    Commented May 2, 2013 at 10:25
  • 2
    Right. I don't want to loose that address. I also don't want to mix balances with other addresses. Bitcoin-qt creates hidden change addresses with almost every transaction, so after a while, I can't be sure of the exact balance of an address (account?). I prefer to isolate this address and all its future related change addreses in its own wallet. Commented May 2, 2013 at 13:58

4 Answers 4

4

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 <bitcoinaddress> <account>

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

3
  • Hi, thanks for pointing out bitcoind, I find it very interesting. I tried setaccount but it doesn't generate a new wallet (wallet.dat file I can move to another computer), just a new "account" which is of no real use to me. In fact, the account which holds address I want to move to a new wallet, show a balance of several bitcoins when it should be zero, and another unnamed ("") account shows a negative balance, so it seems you can't use "accounts" to know neat balance of an address. Commented May 6, 2013 at 2:26
  • @FranciscoR en.bitcoin.it/wiki/… will explain the "" unnamed account and negative balance.
    – Chris
    Commented Jun 28, 2013 at 1:46
  • 2
    An account in bitcoin is not a wallet. As explained here (en.bitcoin.it/wiki/Accounts_explained), account is a way to categories the different addresses into groups within a wallet. Having said that, the setaccount method is not to transfer an address from wallet to another. Commented Dec 9, 2013 at 14:21
3

Open Bitcoin-Qt with old wallet (Menu: Help / Debug window / Console):

walletpassphrase "OLDWALLETPASSPHRASE" 600
dumpprivkey "BITCOINADDRESS"
walletlock

...write down private key and close program. Next open Bitcoin-Qt with new wallet and import private key:

walletpassphrase "NEWWALLETPASSPHRASE" 600
importprivkey "BITCOINPRIVKEYFROMOLDWALLET" "SOMELABEL"
walletlock

...wait for rescan and lock wallet. That is all without other programs etc.

2

The Bitcoin-Qt client currently does not provide any method to delete addresses. You can create a new wallet and import a subset of the private keys from the old wallet to create a wallet that doesn't have certain private keys/addresses.

1
  • 1
    Do you know how can I create a new empty wallet, with 0 addresses in it? I tried renaming wallet.dat, and Bitcoin-qt creates a new wallet, but there is always an address in it. Commented May 6, 2013 at 2:29
0

The Bitcoin-Qt client currently does not provide any method to delete addresses. You can create a new wallet and import a subset of the private keys from the old wallet to create a wallet that doesn't have certain private keys/addresses.

Your Answer

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

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