13

I've been reading about bitcoins and I've come across a few questions:

  1. How does the wallet actually work? From what I can gather, I use the wallet as a centralized service to store recieved coins, and to send coins. If recieved coins are stored physically in the .dat file, what are the safeguards that prevent users from duplicating the .dat file and getting more coins?
  2. Do I need to have the wallet client on to receive transactions? In other words, if i don't leave the wallet client active on my computer, will i be able to receive transactions the next time i open the wallet?

Cheers.

  • 4
    Short, and somewhat oversimplified, answer: Your wallet contains the credentials you need to spend received coins. It is not involved at all in the process of receiving coins nor would duplicates allow the same coins to be spent more than once. – David Schwartz Nov 3 '12 at 2:38
14

Although wallets indeed contain your "coins", the ability to spend them is tracked by the network. Every fully validating node keeps a list of available coins on the network. They do not know who has which, only which (Bitcoin, not IP) address (or addresses) they are associated to. In case you try to spend the same coin twice - for example because you copied your wallet to another computer, and then tried to send a transaction from each - you may temporarily confuse the network. Some nodes may first see the one transactions and some others will see the others first. However, the strength of the system is that this disagreement cannot exist for long and only one of them will be accepted after some time.

The essential thing in your wallet is not the transactions, but the keys. Each address has an associated public and private key. These private keys never leave your wallet file and are necessary to spend the coins assigned to your addresses.

Because the transactions are tracked by the network, you indeed don't need to be online to receive transactions. The next time you connect, your client will ask the network for up-to-date information. During the synchronization that follows, your incoming transaction will be fetched, and the client will detect this as an incoming payment.

  • 1
    How is a bitcoin wallet - not a full node - able to "listen" to only those transactions that are relevant to it (i.e. Bitcoin addresses that this wallet 'owns')? Given that, there is no central system here, how are transactions filtered by what a particular wallet needs? – cogitoergosum Jun 6 '17 at 19:11
  • 2
    Either by using an indexing service for your wallet (e.g. Electrum) which is a full node, or by using BIP37 bloom filtering (e.g. Bitcoin Wallet for Android). Both options have terrible privacy. – Pieter Wuille Jun 6 '17 at 19:13
  • What is an option with better privacy? – cja Dec 8 '17 at 12:22

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.