<p>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.</p>

<p>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.</p>

<p>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.</p>

CC BY-SA 3.0
2017-06-06T19:11:53.100Z
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
CC BY-SA 3.0
2017-06-06T19:13:33.900Z
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
CC BY-SA 3.0
2017-12-08T12:22:15.397Z
What is an option with better privacy?
cja
CC BY-SA 3.0
2012-11-03T00:16:07.480Z
2017-08-12T21:10:48.277Z
2017-08-12T21:10:48.277Z
Pieter Wuille
<p>I've been reading about bitcoins and I've come across a few questions:</p>

<ol>
<li>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?</li>
<li>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?</li>
</ol>

<p>Cheers.</p>

CC BY-SA 3.0
2012-11-03T02:38:57.407Z
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
<transactions><wallet>
How does the wallet work, online and offline?
Gary
# How does the wallet work, online and offline?

(Asked by: username_0 on 2012-11-02)

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.

**Tags:** transactions, wallet

> **Comments:**
> **username_1**: 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.  

---

## 1 answers

### Answer by username_2 on 2012-11-03. Score: 14 | Accepted answer

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.

> **Comments:**
> **username_3**: 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?  
> **username_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.  
> **username_4**: What is an option with better privacy?  

---

