<p>This is definitely a concern, and is the reason why Bitcoin users are encouraged to wait for several confirmations before accepting a transaction and delivering goods.</p>

<p>It's not quite as easy as you suggest, though.  When you made your transaction at the cafe, it was, as you say, broadcast across the network.  Barring connectivity problems, every node on the network gets a copy almost immediately.  (They don't need to wait for it to be included in a block.)  In particular, the gas station gets a copy.  So when you try to spend the same coin with them, they know it has already been spent and will reject your transaction.</p>

<p>To make this work, you have to ensure that the victim is not aware of the other transaction.  One approach is that the first transaction, rather than buying some other goods, simply sends the coin back to another address you control.  You don't broadcast it on the network; rather, you give it directly to a miner, with the understanding that they should include it in their next block, rather than the conflicting transaction that sends the coin to the gas station.  In a variant called a <a href="https://bitcoin.stackexchange.com/q/4942/1475">Finney attack</a>, the miner (possibly yourself) has already mined a block with the transaction that sends the coin to you, but they wait to submit it to the network until you have bought your gas.</p>

CC BY-SA 3.0
2014-04-26T16:35:13.277Z
2014-05-22T18:33:14.397Z
2017-04-13T12:47:36.707Z
Nate Eldredge
<p>I'm trying my best to understand how bitcoin works and while I've grasped the basics, there's a lingering question:</p>

<p><strong>What's to stop me from spending my bitcoin multiple times during a confirmation period?</strong></p>

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

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

<p>What am I missing?</p>

CC BY-SA 3.0
2014-04-26T16:08:56.727Z
Its called double spending. I dont know the details myself, but maybe the [wikipedia](https://en.bitcoin.it/wiki/Double-spending) page can shed some light on it for you
Mathias711
<blockchain><confirmations><doublespend><fraud>
How does BitCoin prevent fraud during confirmation period?
Chad Decker
# How does BitCoin prevent fraud during confirmation period?

(Asked by: username_0 on 2014-04-26)

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?

**Tags:** blockchain, confirmations, doublespend, fraud

> **Comments:**
> **username_1**: Its called double spending. I dont know the details myself, but maybe the [wikipedia](https://en.bitcoin.it/wiki/Double-spending) page can shed some light on it for you  

---

## 1 answers

### Answer by username_2 on 2014-04-26. Score: 10 | Accepted answer

This is definitely a concern, and is the reason why Bitcoin users are encouraged to wait for several confirmations before accepting a transaction and delivering goods.

It's not quite as easy as you suggest, though. When you made your transaction at the cafe, it was, as you say, broadcast across the network. Barring connectivity problems, every node on the network gets a copy almost immediately. (They don't need to wait for it to be included in a block.) In particular, the gas station gets a copy. So when you try to spend the same coin with them, they know it has already been spent and will reject your transaction.

To make this work, you have to ensure that the victim is not aware of the other transaction. One approach is that the first transaction, rather than buying some other goods, simply sends the coin back to another address you control. You don't broadcast it on the network; rather, you give it directly to a miner, with the understanding that they should include it in their next block, rather than the conflicting transaction that sends the coin to the gas station. In a variant called a [Finney attack](https://bitcoin.stackexchange.com/q/4942/1475), the miner (possibly yourself) has already mined a block with the transaction that sends the coin to you, but they wait to submit it to the network until you have bought your gas.


---

