I'm trying my best to understand how bitcoin works and while I've grasped the basics, there's a lingering question:
What's to stop me from spending my bitcoin multiple times during a confirmation period?
Let's say I have a single address that owns 1 BTC. I go to a cafe and use the coin (assume the whole coin for simplicity) to buy a cup of coffee. The transaction is broadcast across the network. The miners then compete with one another to include my transaction in a verified multi-transaction block that will be submitted to the block chain. That process takes around ten minutes. During that ten minute period, I walk to the gas station and reuse my 1 BTC to buy some gas. How could the gas station know that I had already used my 1 BTC to buy coffee a few minutes earlier and my actual balance is zero, since the coffee transaction isn't yet part of the official block chain?
In the end, one of these two transactions will most certainly get rejected by the Bitcoin network but either the cafe or the gas station will get stiffed, correct? It seems the only solution would be for the cafe to wait ten minutes for the confirmation prior to giving me my coffee -- but that's obviously not a practical approach.
What am I missing?