Bitcoin Forum

Other => Beginners & Help => Topic started by: anu on July 09, 2011, 12:10:10 PM



Title: Sharing Wallets
Post by: anu on July 09, 2011, 12:10:10 PM
Hi,

as I understand, a wallet is not really a wallet, but a key. This suggests it can be shared between computers. Meaning if I have my wallet.dat copied from box A to box B and both boxes run the bitcoin app, box A should pick up the transactions from B and vice versa so both always show the same balance (not counting network latency). Is this correct?

A somewhat related question: Is it possible to share the wallet.dat using a typical NFS $HOME setup? Like there are N instances of bitcoin, accessing a single ~/.bitcoin directory?

This is of course easy to try out and I expect it to work - but maybe I am in for some nasty side effects / races that only show after some time?

TIA
Anu


Title: Re: Sharing Wallets
Post by: hashmaker on July 09, 2011, 02:22:15 PM
as I understand, a wallet is not really a wallet, but a key. This suggests it can be shared between computers. Meaning if I have my wallet.dat copied from box A to box B and both boxes run the bitcoin app, box A should pick up the transactions from B and vice versa so both always show the same balance (not counting network latency). Is this correct?

If I understand BTC correctly that would be correct. It is essentially running your backup on another computer. This would go fine and dandy until you started generating new BTC addresses to receive with. Both wallets would start generating different addresses so coins received in wallet A would not show up in wallet B unless you made all the addresses in wallet A then mirrored it to wallet B.

Long story short, it's the same until you start generating addresses. This is why it is also important to back up your file periodically. If you generate a bunch of addresses, start receiving BTC from them, lose the wallet.dat, restore an old backup missing the new addresses, those coins sent to the new generated addresses that are not on the backup are lost to the void, never to be seen again.


Title: Re: Sharing Wallets
Post by: blackgold on July 09, 2011, 03:31:24 PM
I would deter you from trying to have many computers writing to one file. I would assume you would easily corrupt your wallet doing this. Have multiple wallets for many machines and have one master wallet that you keep very safe. A wallet is full of from what i understand private keys for the public bitcoin key. If you loose these private keys... you have lost the coin for good. Keep your wallet safe.


Title: Re: Sharing Wallets
Post by: naturallaw on July 09, 2011, 03:42:42 PM
I would echo what blackgold said. As long as you keep the wallet.dat synchronized between two computers, you shouldn't have to worry about having keys on one computer, but not another. However, you should not be allowing more than one instance of bitcoin accessing the same wallet at the same time. That is just asking for trouble. And always, always backup!


Title: Re: Sharing Wallets
Post by: anu on July 09, 2011, 04:38:48 PM
I would echo what blackgold said. As long as you keep the wallet.dat synchronized between two computers, you shouldn't have to worry about having keys on one computer, but not another. However, you should not be allowing more than one instance of bitcoin accessing the same wallet at the same time. That is just asking for trouble. And always, always backup!

The source says:
    if (!lock.try_lock())
    {
        wxMessageBox(strprintf(_("Cannot obtain a lock on data directory %s.  Bitcoin is probably already running."),
              GetDataDir().c_str()), "Bitcoin");
        return false;
    }


so it obtains a lock on ".lock". This part was really stupid of me to ask. It would require adding more fine grained locking, but the Berkeley format supports this.

-Anu