8

It is a common question, how to sync a wallet across different devices.

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?

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 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 big name from the Bitcoin devs has been known to frequent these parts.

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.

  • 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 Dec 15 '11 at 0:17
  • 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 Dec 15 '11 at 2:07
  • 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 Dec 15 '11 at 17:54
-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).

  • Are you sure this is an answer and not a comment on an answer? – ThePiachu Nov 6 '12 at 7:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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