<blockquote>
  <p>Suppose Alice sent 2 bitcoins to Bob, Bob ships the product to Alice, then Alice sends 2 bitcoins to herself. Why is this a problem?</p>
</blockquote>

<p>If Alice only had 2 bitcoins to start, then she will not be able to spend them twice. After the first spend (paying Bob) is confirmed, the network will not accept a second payment that spends those same coins again. From the network's point of view, those 2 coins are now locked to an address that Bob controls, not Alice.</p>

<p>Just imagine you had a $10 bill in your pocket, and you went to a food court and used it to buy $10 worth of pizza. After eating the pizza, you decide you need a drink, but you don't have any more money. Would you be able to buy the drink by somehow 'doublespending' the $10 bill you had earlier? Of course not, it is obvious you don't own that $10 bill anymore! The same reasoning applies to bitcoin double spends: you simply don't have any more coins left to spend.</p>

<blockquote>
  <p>If both the transactions are approved then also Bob gets his 2 bitcoins (irrespective of the order of both the transactions). If Alice has no bitcoins left after sending them to Bob, then also no harm is done.</p>
</blockquote>

<p>You say 'no harm is done' by allowing Alice to invent bitcoins out of thin air, but that is far from true! If Alice could create endless coins, then all other coins would slowly (or maybe not so slowly) become worthless. Why would anyone pay for something, that any person (Alice) can just create without cost?</p>

CC BY-SA 4.0
2020-01-28T17:43:19.070Z
Why both the transactions contain the same 2 bitcoins? I mean, when is it decided which unspent outputs will be used in a transaction?
anand
CC BY-SA 4.0
2020-01-28T19:29:29.773Z
You said ‘Alice has no btc left after sending to Bob, and the question is titled ‘double spending...’, so I assumed that was the case. If the two transactions spend different coins, then it’d be no problem. Coin selection is usually done automatically by the wallet, but sometimes can be specified by the user, it depends on the software.
chytrik
CC BY-SA 4.0
2020-01-26T22:49:51.510Z
2020-01-26T22:49:51.510Z
chytrik
<blockquote>
  <p>If Alice has no bitcoins left after sending them to Bob, then also no harm is done.</p>
</blockquote>

<p>You're essentially saying here that if the double-spend problem is solved, then no harm is done. Obviously.</p>

<p>The point is that without a solution to the double-spend problem, Alice could send her 2 BTC to Bob AND also have 2 BTC left herself. This would obviously make Bitcoin useless, as it'd allow people to print money out of nowhere, devaluing everyone else's coins.</p>

CC BY-SA 4.0
2020-01-28T17:43:11.853Z
Why both the transactions contain the same 2 bitcoins? I mean, when is it decided which unspent outputs will be used in a transaction?
anand
CC BY-SA 4.0
2020-01-28T17:44:41.937Z
The sender software determines which coins to use, and it of course will never pick the same ones twice. But with modified software you can construct conflicting transactions that spend the same coins - and the network needs a way to prevent that.
Pieter Wuille
CC BY-SA 4.0
2020-01-26T23:11:35.597Z
2020-01-26T23:11:35.597Z
Pieter Wuille
<p>Suppose Alice sent 2 bitcoins to Bob, Bob ships the product to Alice, then Alice sends 2 bitcoins to herself. Why is this a problem ? If both the transactions are approved then also Bob gets his 2 bitcoins (irrespective of the order of both the transactions). If Alice has no bitcoins left after sending them to Bob, then also no harm is done.</p>

CC BY-SA 4.0
2020-01-26T22:49:01.670Z
Possible duplicate of https://bitcoin.stackexchange.com/q/70366/5406
Murch
<doublespend>
Double spending problem in Bitcoin
anand
# Double spending problem in Bitcoin

(Asked by: username_0 on 2020-01-26)

Suppose Alice sent 2 bitcoins to Bob, Bob ships the product to Alice, then Alice sends 2 bitcoins to herself. Why is this a problem ? If both the transactions are approved then also Bob gets his 2 bitcoins (irrespective of the order of both the transactions). If Alice has no bitcoins left after sending them to Bob, then also no harm is done.

**Tags:** doublespend

> **Comments:**
> **username_1**: Possible duplicate of https://bitcoin.stackexchange.com/q/70366/5406  

---

## 2 answers

### Answer by username_2 on 2020-01-26. Score: 0

> Suppose Alice sent 2 bitcoins to Bob, Bob ships the product to Alice, then Alice sends 2 bitcoins to herself. Why is this a problem?

If Alice only had 2 bitcoins to start, then she will not be able to spend them twice. After the first spend (paying Bob) is confirmed, the network will not accept a second payment that spends those same coins again. From the network's point of view, those 2 coins are now locked to an address that Bob controls, not Alice.

Just imagine you had a $10 bill in your pocket, and you went to a food court and used it to buy $10 worth of pizza. After eating the pizza, you decide you need a drink, but you don't have any more money. Would you be able to buy the drink by somehow 'doublespending' the $10 bill you had earlier? Of course not, it is obvious you don't own that $10 bill anymore! The same reasoning applies to bitcoin double spends: you simply don't have any more coins left to spend.

> If both the transactions are approved then also Bob gets his 2 bitcoins (irrespective of the order of both the transactions). If Alice has no bitcoins left after sending them to Bob, then also no harm is done.

You say 'no harm is done' by allowing Alice to invent bitcoins out of thin air, but that is far from true! If Alice could create endless coins, then all other coins would slowly (or maybe not so slowly) become worthless. Why would anyone pay for something, that any person (Alice) can just create without cost?

> **Comments:**
> **username_0**: Why both the transactions contain the same 2 bitcoins? I mean, when is it decided which unspent outputs will be used in a transaction?  
> **username_2**: You said ‘Alice has no btc left after sending to Bob, and the question is titled ‘double spending...’, so I assumed that was the case. If the two transactions spend different coins, then it’d be no problem. Coin selection is usually done automatically by the wallet, but sometimes can be specified by the user, it depends on the software.  

---

### Answer by username_3 on 2020-01-26. Score: 0

> If Alice has no bitcoins left after sending them to Bob, then also no harm is done.

You're essentially saying here that if the double-spend problem is solved, then no harm is done. Obviously.

The point is that without a solution to the double-spend problem, Alice could send her 2 BTC to Bob AND also have 2 BTC left herself. This would obviously make Bitcoin useless, as it'd allow people to print money out of nowhere, devaluing everyone else's coins.

> **Comments:**
> **username_0**: Why both the transactions contain the same 2 bitcoins? I mean, when is it decided which unspent outputs will be used in a transaction?  
> **username_3**: The sender software determines which coins to use, and it of course will never pick the same ones twice. But with modified software you can construct conflicting transactions that spend the same coins - and the network needs a way to prevent that.  

---

