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?
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.
- 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.
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.