<p>The ability to import and export keys is in the works, with several forks in the Github project trying out various methods. One of them will eventually be selected and make its way into the official client. Until then we're reliant on tools like <a href="https://github.com/jackjack-jj/pywallet" rel="nofollow noreferrer">pywallet</a> to import and export keys.</p>

<p>As for the directory concept, the wallet.dat file stores this information in a BerkeleyDB format, as well as a transactions list. I can see the potential benefits, though there are likely downsides that I've not considered and I'm certainly not qualified to speak to the mindset of the developers. Perhaps you'll get lucky though, at least <a href="https://bitcoin.stackexchange.com/users/53/gavinandresen">one</a> big name from the Bitcoin devs has been known to frequent these parts.</p>

CC BY-SA 3.0
2011-12-14T22:28:35.473Z
2011-12-14T22:28:35.473Z
2017-04-13T12:47:33.583Z
David Perry
<p>The problem is that the client software assumes it owns all of the accounts and doesn't care which accounts hold the actual funds. So, if you have 35 bitcoins, they may spread in 3 accounts that you know about and 4 internal "change" accounts. Or you may think of 10 bitcoins as being in one program account and 15 in another program account while all 35 bitcoins are actually in one bitcoin account.</p>

<p>In addition, if the same account were running on two different machines, they may submit conflicting transactions. This would be considered malicious by the recipients.</p>

CC BY-SA 3.0
2011-12-15T00:17:09.000Z
If you have the same wallet.dat open on 2 different machines connected to the network, does it cause any problems, or it is only when a double spend is attempted?
Highly Irregular
CC BY-SA 3.0
2011-12-15T02:07:54.010Z
So long as you don't spend anything at all, it won't cause any problems because neither one will know the other one is running and nothing will be changed. But as soon as you do any spend at all, things can become inconsistent across the two wallets, each thinking they have funds they do not actually have. (Some of this is fundamental, some of it is just bugs -- or more politely, 'missing features' -- in the client.
David Schwartz
CC BY-SA 3.0
2011-12-15T17:54:25.380Z
Double spending is a good point. It's clear that spending from different copies of the wallet within a timeframe of 10 minutes is problematic. It becomes even more problematic if we take into account that the user won't know which bitcoin from which address (s)he is spending.
Jan
CC BY-SA 3.0
2011-12-14T23:05:55.540Z
2011-12-14T23:05:55.540Z
David Schwartz
<p>The huge missing feature of pywallet is that you can't import many keys at once (which is strange since it can <em>export</em> many keys at once).</p>

CC BY-SA 3.0
2012-11-06T07:27:23.503Z
Are you sure this is an answer and not a comment on an answer?
ThePiachu
CC BY-SA 3.0
2012-03-27T04:58:04.167Z
2012-03-27T04:58:04.167Z
Pink Shoes
<p>It is a common question, how to <a href="https://bitcoin.stackexchange.com/questions/490/can-i-use-my-wallet-on-different-computers">sync a wallet across different devices</a>.</p>

<p>As far as I understand, a wallet is just a collection of private keys. Each private key can be uniquely identified using the bitcoin address associated with the key. Thus, why don't we think of wallet.dat as if it was a directory:</p>

<pre><code>Filename     File Content
=Address     =Private Key

1HB5XMLmzFV  8ALj6mfBsbifRo
...          ...
</code></pre>

<p>Now, syncing such a directory is trivial. If the filename (address) matches, the file is identical and does not need to be synced. If a filename is only present on one side, just copy the file, it's a new address.</p>

<p>Is something like this going to be implemented in a future client version? Or is my idea faulty?</p>

<wallet><bitcoin-core>
(Why) is it difficult to merge and split wallet.dat?
Jan
# (Why) is it difficult to merge and split wallet.dat?

(Asked by: username_0 on 2011-12-14)

It is a common question, how to [sync a wallet across different devices](https://bitcoin.stackexchange.com/questions/490/can-i-use-my-wallet-on-different-computers).

As far as I understand, a wallet is just a collection of private keys. Each private key can be uniquely identified using the bitcoin address associated with the key. Thus, why don't we think of wallet.dat as if it was a directory:

```
Filename     File Content
=Address     =Private Key

1HB5XMLmzFV  8ALj6mfBsbifRo
...          ...

```

Now, syncing such a directory is trivial. If the filename (address) matches, the file is identical and does not need to be synced. If a filename is only present on one side, just copy the file, it's a new address.

Is something like this going to be implemented in a future client version? Or is my idea faulty?

**Tags:** wallet, bitcoin-core


---

## 3 answers

### Answer by username_1 on 2011-12-14. Score: 1

The ability to import and export keys is in the works, with several forks in the Github project trying out various methods. One of them will eventually be selected and make its way into the official client. Until then we're reliant on tools like [pywallet](https://github.com/jackjack-jj/pywallet) to import and export keys.

As for the directory concept, the wallet.dat file stores this information in a BerkeleyDB format, as well as a transactions list. I can see the potential benefits, though there are likely downsides that I've not considered and I'm certainly not qualified to speak to the mindset of the developers. Perhaps you'll get lucky though, at least [one](https://bitcoin.stackexchange.com/users/53/gavinandresen) big name from the Bitcoin devs has been known to frequent these parts.


---

### Answer by username_2 on 2011-12-14. Score: 0

The problem is that the client software assumes it owns all of the accounts and doesn't care which accounts hold the actual funds. So, if you have 35 bitcoins, they may spread in 3 accounts that you know about and 4 internal "change" accounts. Or you may think of 10 bitcoins as being in one program account and 15 in another program account while all 35 bitcoins are actually in one bitcoin account.

In addition, if the same account were running on two different machines, they may submit conflicting transactions. This would be considered malicious by the recipients.

> **Comments:**
> **username_3**: If you have the same wallet.dat open on 2 different machines connected to the network, does it cause any problems, or it is only when a double spend is attempted?  
> **username_2**: So long as you don't spend anything at all, it won't cause any problems because neither one will know the other one is running and nothing will be changed. But as soon as you do any spend at all, things can become inconsistent across the two wallets, each thinking they have funds they do not actually have. (Some of this is fundamental, some of it is just bugs -- or more politely, 'missing features' -- in the client.  
> **username_0**: Double spending is a good point. It's clear that spending from different copies of the wallet within a timeframe of 10 minutes is problematic. It becomes even more problematic if we take into account that the user won't know which bitcoin from which address (s)he is spending.  

---

### Answer by username_4 on 2012-03-27. Score: -1

The huge missing feature of pywallet is that you can't import many keys at once (which is strange since it can *export* many keys at once).

> **Comments:**
> **username_5**: Are you sure this is an answer and not a comment on an answer?  

---

