<p>It's actually quite simple. Your wallet is a collection of private keys, each identified by an ID. When someone sends you bitcoins, those are just assigned to one of those private keys. </p>

<p>The information about which key has how many bitcoins is stored in the bitcoin network itself, ie in the database each client has.</p>

<p>Now if you want to use the bitcoins which belong to one specific key, you need this key to sign the transaction.</p>

<p>So no, you don't need to be online to receive a transaction. You can also restore an older backup, as long as you haven't created any new keys in the meantime. If you have created new keys, it all depends on your luck - was the transaction sent to a new or an old key?</p>

<p>And if it gets corrupted before you make a backup you are SOL - nobody has the correct private key then.</p>

CC BY-SA 3.0
2011-09-10T02:34:11.873Z
It's actually a collection of key pairs (private and public).
André Paramés
CC BY-SA 3.0
2011-09-10T02:34:27.880Z
@lemonginger: Wikipedia has a great explanation: [Public-key cryptography](http://en.wikipedia.org/wiki/Public-key_cryptography).
André Paramés
CC BY-SA 3.0
2011-10-07T21:33:37.453Z
"If you have created new keys, it all depends on your luck - was the transaction sent to a new or an old key?" It's not really luck as you provide the address for the bitcoins to be sent to. Secondly, the client actually stores around 100 keys in advance of them being used, so the chance of losing coins is low unless you have used them all (by either sending coins or creating new receiving addresses). The downside of having keys created in advance is that if your wallet was stolen 2 weeks ago, you could lose coins sent to an address you created today.
Highly Irregular
CC BY-SA 3.0
2011-08-30T23:47:11.590Z
Can you expand this answer a bit to explain what a private key is?
lemonginger
CC BY-SA 3.0
2011-08-30T21:20:58.183Z
2011-08-30T21:20:58.183Z
Mononofu
<ul>
<li>Your computer does not need to be running Bitcoin to receive coins. When someone sends coins to you, it just creates a transaction that eventually gets included in the block chain (that gets downloaded by everyone running Bitcoin) ; in other words, the whole network grants you the ability to spend those coins. So you don't need to be online for this to happen.</li>
<li>If your wallet corrupts and you have no backup, your coins are permanently lost.</li>
<li>If you have a recent backup, you can reuse it safely (the wallet contains a pool of new addresses, so even if you made a few transactions it will work). However, if you made lots of transactions (more than a few dozens) since your last backup, you will lose some of your coins.</li>
</ul>

CC BY-SA 3.0
2011-08-30T21:22:42.307Z
2011-08-30T21:22:42.307Z
Artefact2
<p>You should try to keep your bitcoin client online.  This allows the client to keep up with the latest transactions.  However, You can receive money while bitcoin is offline, the transaction is logged to the network and once you reconnect and catchup with all transactions your account will show the money you received.</p>

<p>You should keep your wallet file protected. This includes not posting it online or sharing it with anyone. You should also limit access to your computer with the wallet file.  Consider encrypting any backups of the file.  If anyone gains access to your wallet file they will always be able to spend money from it at any point if the future.  If you suspect your wallet file has been compromised create a new wallet file and transfer all of your bitcoins to the new file.</p>

<p>If your wallet file gets corrupted you can restore it from backup and tell the bitcoin client to "rescan" on launch ("bitcoin -rescan" from the command line).  This will re-parse the wallet.dat file and restore your coins.</p>

<p>The one exception is if you have done more then 100 transactions on new addresses since your backup.  The backup wallet file holds up to 100 addresses after you use them up bitcoin will generate new addresses.  If money is sent to those addresses, and you then restore an old wallet.dat, that old wallet will not have access to those funds.</p>

<p>If your wallet file is destroyed without a backup all the bitcoins it contains are lost forever, like lighting a dollar bill on fire.</p>

CC BY-SA 3.0
2011-09-11T16:22:59.600Z
The -rescan option has been automatic since Bitcoin v0.3.21. Except when you're upgrading from an older version at the same time, there is almost never a reason to specify it manually (though it won't hurt, just slow down the startup process).
Pieter Wuille
CC BY-SA 3.0
2011-08-30T21:34:25.540Z
2011-08-30T21:34:25.540Z
Joshua Kolden
<p>I didn't get it. Should my wallet be online? What if it becomes corrupted before I make a backup? Can I use my backup wallet that was backed up few days ago?</p>

<transactions><wallet><backup><receiving>
What happens when someone sends bitcoin to my wallet?
ilhan
# What happens when someone sends bitcoin to my wallet?

(Asked by: username_0 on 2011-08-30)

I didn't get it. Should my wallet be online? What if it becomes corrupted before I make a backup? Can I use my backup wallet that was backed up few days ago?

**Tags:** transactions, wallet, backup, receiving


---

## 3 answers

### Answer by username_1 on 2011-08-30. Score: 12

It's actually quite simple. Your wallet is a collection of private keys, each identified by an ID. When someone sends you bitcoins, those are just assigned to one of those private keys.

The information about which key has how many bitcoins is stored in the bitcoin network itself, ie in the database each client has.

Now if you want to use the bitcoins which belong to one specific key, you need this key to sign the transaction.

So no, you don't need to be online to receive a transaction. You can also restore an older backup, as long as you haven't created any new keys in the meantime. If you have created new keys, it all depends on your luck - was the transaction sent to a new or an old key?

And if it gets corrupted before you make a backup you are SOL - nobody has the correct private key then.

> **Comments:**
> **username_4**: Can you expand this answer a bit to explain what a private key is?  
> **username_2**: It's actually a collection of key pairs (private and public).  
> **username_2**: @username_4: Wikipedia has a great explanation: [Public-key cryptography](http://en.wikipedia.org/wiki/Public-key_cryptography).  
> **username_3**: "If you have created new keys, it all depends on your luck - was the transaction sent to a new or an old key?" It's not really luck as you provide the address for the bitcoins to be sent to. Secondly, the client actually stores around 100 keys in advance of them being used, so the chance of losing coins is low unless you have used them all (by either sending coins or creating new receiving addresses). The downside of having keys created in advance is that if your wallet was stolen 2 weeks ago, you could lose coins sent to an address you created today.  

---

### Answer by username_5 on 2011-08-30. Score: 4

* Your computer does not need to be running Bitcoin to receive coins. When someone sends coins to you, it just creates a transaction that eventually gets included in the block chain (that gets downloaded by everyone running Bitcoin) ; in other words, the whole network grants you the ability to spend those coins. So you don't need to be online for this to happen.
* If your wallet corrupts and you have no backup, your coins are permanently lost.
* If you have a recent backup, you can reuse it safely (the wallet contains a pool of new addresses, so even if you made a few transactions it will work). However, if you made lots of transactions (more than a few dozens) since your last backup, you will lose some of your coins.


---

### Answer by username_6 on 2011-08-30. Score: 3

You should try to keep your bitcoin client online. This allows the client to keep up with the latest transactions. However, You can receive money while bitcoin is offline, the transaction is logged to the network and once you reconnect and catchup with all transactions your account will show the money you received.

You should keep your wallet file protected. This includes not posting it online or sharing it with anyone. You should also limit access to your computer with the wallet file. Consider encrypting any backups of the file. If anyone gains access to your wallet file they will always be able to spend money from it at any point if the future. If you suspect your wallet file has been compromised create a new wallet file and transfer all of your bitcoins to the new file.

If your wallet file gets corrupted you can restore it from backup and tell the bitcoin client to "rescan" on launch ("bitcoin -rescan" from the command line). This will re-parse the wallet.dat file and restore your coins.

The one exception is if you have done more then 100 transactions on new addresses since your backup. The backup wallet file holds up to 100 addresses after you use them up bitcoin will generate new addresses. If money is sent to those addresses, and you then restore an old wallet.dat, that old wallet will not have access to those funds.

If your wallet file is destroyed without a backup all the bitcoins it contains are lost forever, like lighting a dollar bill on fire.

> **Comments:**
> **username_7**: The -rescan option has been automatic since Bitcoin v0.3.21. Except when you're upgrading from an older version at the same time, there is almost never a reason to specify it manually (though it won't hurt, just slow down the startup process).  

---

