<p>A patch for the bitcoin client for this:
 - <a href="http://github.com/bitcoin/bitcoin/pull/220">http://github.com/bitcoin/bitcoin/pull/220</a></p>

CC BY-SA 3.0
2011-09-02T16:47:18.237Z
2011-09-02T16:47:18.237Z
Stephen Gornick
<p><a href="https://bitcointalk.org/index.php?topic=34028.0" rel="nofollow">Pywallet</a> is a python script that (among a number of other things) can export and import key pairs. It's not as complicated to use as it might sound, some python stuff has to be installed but that's almost automatic and once it is done the tasks can be performed using a web interface. From the linked forum post (updated 8/23/11):</p>

<blockquote>
  <p>Currently you can:</p>
  
  <ul>
  <li>Dump your wallet, see your pubkeys, privkeys, their labels, etc</li>
  <li>Dump your transactions to a json file</li>
  <li>Import a key/address into your wallet, with a label, or as a
  reserve key</li>
  <li>Import a transaction into your wallet</li>
  <li>Import transactions from a json file</li>
  <li>Delete addresses from your wallet</li>
  <li>Delete transactions from your wallet</li>
  <li>Get info about a privkey, i.e. see address, base58 privkey,
  hexprivkey, pubkey and hash160, using the network you want</li>
  <li>Sign and verify string, files, and binary string</li>
  <li>Read a device to find deleted keys (CLI only)</li>
  <li>Print the balance of a bitcoin address, read from blockexplorer</li>
  </ul>
</blockquote>

CC BY-SA 3.0
2011-09-02T23:39:05.353Z
Merging 2 wallets using Pywallet would require to dump one wallet and then import manually each private key? Sounds like a lot of work.
Jader Dias
CC BY-SA 3.0
2011-11-07T03:08:13.063Z
Note that Pywallet does not work with encrypted wallets yet.
nmat
CC BY-SA 3.0
2011-11-13T20:39:08.103Z
Pywallet does not run on Mac OS except with a lot of hacking to make this relatively small program work. I had issues installing macports and I don't want to go there again. I am so wondering why anyone should have to go through all this trouble. If wallet.dat were a text file, then none of this would be necessary.
shoeless joe
CC BY-SA 3.0
2011-09-02T16:15:34.467Z
2011-09-02T16:39:40.807Z
2011-09-02T16:39:40.807Z
D.H.
<p>I've got one wallet.dat from my laptop and another on my desktop, each containing various (different) receiving addresses that I use pretty often. I'd like to merge them into a single wallet.dat so I can see all my balances in one place.</p>

<p>If there isn't some piece of software that can truly "merge" the two, is there some way to at least export an address/keypair from one wallet and then import it into the other?</p>

CC BY-SA 3.0
2011-09-02T16:08:39.220Z
This functionality is eventually planned for the main client, btw.  But good question.
eMansipater
CC BY-SA 3.0
2011-09-02T17:19:44.813Z
I chose D.H.'s answer over Stephen's only because a solution separate from the client, which can be run on a separate (offline) machine where I can be 100% sure nothing malicious is happening with my wallet.dat seems superior to patching my client, which by nature must manipulate my wallet.dat file and generate internet traffic. Also I speak Python so I can verify/tweak the code myself if necessary. Both are valid solutions, though and I wish I could check two answers.
David Perry
<transactions><wallet>
Is there some way to merge two wallets or to import/export addresses?
David Perry
# Is there some way to merge two wallets or to import/export addresses?

(Asked by: username_0 on 2011-09-02)

I've got one wallet.dat from my laptop and another on my desktop, each containing various (different) receiving addresses that I use pretty often. I'd like to merge them into a single wallet.dat so I can see all my balances in one place.

If there isn't some piece of software that can truly "merge" the two, is there some way to at least export an address/keypair from one wallet and then import it into the other?

**Tags:** transactions, wallet

> **Comments:**
> **username_1**: This functionality is eventually planned for the main client, btw.  But good question.  
> **username_0**: I chose D.H.'s answer over username_2's only because a solution separate from the client, which can be run on a separate (offline) machine where I can be 100% sure nothing malicious is happening with my wallet.dat seems superior to patching my client, which by nature must manipulate my wallet.dat file and generate internet traffic. Also I speak Python so I can verify/tweak the code myself if necessary. Both are valid solutions, though and I wish I could check two answers.  

---

## 2 answers

### Answer by username_3 on 2011-09-02. Score: 8 | Accepted answer

[Pywallet](https://bitcointalk.org/index.php?topic=34028.0) is a python script that (among a number of other things) can export and import key pairs. It's not as complicated to use as it might sound, some python stuff has to be installed but that's almost automatic and once it is done the tasks can be performed using a web interface. From the linked forum post (updated 8/23/11):

> Currently you can:
>
> * Dump your wallet, see your pubkeys, privkeys, their labels, etc
> * Dump your transactions to a json file
> * Import a key/address into your wallet, with a label, or as a
>   reserve key
> * Import a transaction into your wallet
> * Import transactions from a json file
> * Delete addresses from your wallet
> * Delete transactions from your wallet
> * Get info about a privkey, i.e. see address, base58 privkey,
>   hexprivkey, pubkey and hash160, using the network you want
> * Sign and verify string, files, and binary string
> * Read a device to find deleted keys (CLI only)
> * Print the balance of a bitcoin address, read from blockexplorer

> **Comments:**
> **username_4**: Merging 2 wallets using Pywallet would require to dump one wallet and then import manually each private key? Sounds like a lot of work.  
> **username_5**: Note that Pywallet does not work with encrypted wallets yet.  
> **username_6**: Pywallet does not run on Mac OS except with a lot of hacking to make this relatively small program work. I had issues installing macports and I don't want to go there again. I am so wondering why anyone should have to go through all this trouble. If wallet.dat were a text file, then none of this would be necessary.  

---

### Answer by username_2 on 2011-09-02. Score: 8

A patch for the bitcoin client for this:
- <http://github.com/bitcoin/bitcoin/pull/220>


---

