What happens to my bitcoins when I die? Are they lost in the network?
This depends a lot on how you handle your wallet. If you are careful about it and make sure you have an off-site backup of your wallet (or use a deterministic or paper wallet, etc) then you can easily pass your wallet and all the coins it contains to anyone you choose in the same ways that you can pass on other property.
Of course if you're the only person with access to the wallet and have not planned anything then yes, your bitcoins will be "lost in the network."
You may just store your bitcoins with the method also used by https://www.casascius.com/ ... so it will be like paper-money stored in a sock under your bed.
You can set up a transaction/contract that would express your will to transfer specific bitcoins to another person:
Scripts are, by design, pure functions. They cannot poll external servers or import any state that may change as it would allow an attacker to outrun the block chain. But we can make transactions connected to the world in other ways.
Consider the example of an old man who wishes to give an inheritance to his grandson, either on the grandson's 18th birthday or when the man dies, whichever comes first.
To solve this, the man first sends the amount of the inheritance to himself so there is a single output of the right amount. Then he creates a transaction with a lock time of the grandson's 18th birthday that pays the coins to another key owned by the grandson, signs it, and gives it to him - but does not broadcast it. This takes care of the 18th birthday condition. If the date passes, the grandson broadcasts the transaction and claims the coins. He could do it before then, but it doesn't let him get the coins any earlier, and some nodes may choose to drop transactions in the memory pool with lock times far in the future.
The death condition is harder. As Bitcoin nodes cannot measure arbitrary conditions, we must rely on an oracle. An oracle is a server that has a keypair, and signs transactions on request when a user-provided expression evaluates to true.
I'm not sure whether this mechanism is flexible enough to be used if you are not certain which amount should be transferred or from which address (because you may want to perform some operations with the bitcoins after you have set up the "inheritance transaction"; perhaps, you can simply generate and store such a transaction every time the amount or the address changes).
It's up to you what you want to happen with your bitcoins when you die. The bitcoins are in the possession of whomever has the wallet and the passphrase needed for it. If you want someone else to inherit your bitcoins, you need to arrange for a way for them to obtain the wallet and passphrase. Perhaps a safety deposit box containing the password or a memory stick containing the wallet.
Bear in mind though that a backup of the wallet will only contain 100 future addresses. If you perform more transactions than that since the backup was taken, they won't be stored on the memory stick unless you ensure you send your bitcoins only to addresses that will have existed when the wallet was backed up.
Most of us will probably want our bitcoins to go on to our family members when we die.
If you're the only one with access to your private key, however, that is unfortunately impossible.
The best solution to this is to "shard" your private key into shares and distribute those shares to various members of your family. With Shamir's Secret Sharing Scheme, you can require that M shares of the N total shares created be required to reconstruct the private key.
Here is a very straightforward, easy to read python implementation of Shamir's Secret Sharing: https://github.com/rxl/secret-sharing.
All you need to do to shard your private key is the following:
>>> from secretsharing import BitcoinToB32SecretSharer >>> shares = BitcoinToB32SecretSharer.split_secret("5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS", 3, 5) ['B-RJ6Y56OSUWDY5VAAGC6XLSTM64CAJ2LPBNB7NKATJCWC7VSHIP5DQIVMR6OGJ4GB', 'C-CT5R24XAR5B732JWYQKSYOYBSF5VHI73HLY24QCFRJR5XUW64C4JWYN6SRGWVCUG', 'D-T54KX27OPEAGZ7TNK5WOFK4WFPZKEXUHNKPWLWDXZQNYPT3WPV3P5IGQTD7HAJDG']
In this case, 3 out of 5 of your family members would have to come forth upon your death and combine their shares in order for your private key (and your bitcoins) to be recovered.
The process for recovering private keys would be as follows:
>>> BitcoinToB32SecretSharer.recover_secret(shares[0:3]) '5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS'
I am using a website called www.planneddeparture.com. It is a Digital Legacy platform that keep all my social media accounts, pics, contacts, docs as well as bitcoins safe. Pretty much like dropbox but with the difference that I can assign beneficiaries and leave them instructions of what to do with my digital belongings when I am gone. I have used it for 2 months now and have assigned beneficiaries to almost all my belongings including my bitcoins. I have read some of the comments and must say that some solutions are quite old fashioned and risky. There are plenty if platform on the web that deal with your digital assets. Have a look and decide for yourself. I happen to use PlannedDeparture and I am feeling quite secure about my bitcoins and other data.