<p>Transactions create Unspent Transaction Outputs <a href="/questions/tagged/utxo" class="post-tag" title="show questions tagged &#39;utxo&#39;" rel="tag">utxo</a>. <a href="https://bitcoin.stackexchange.com/a/21459/5406">UTXO are uniquely identifiable.</a> UTXO are indivisible, they are destroyed completely, when money is spent from them. (<a href="https://bitcoin.stackexchange.com/q/736/5406">Which is why you need to send change back to yourself.</a>) 
Naturally, this also means that you cannot chose what address you send money from, in fact the "sending address" only exists implicitly by being the address that received the funding payment.</p>

<p>So, putting all this together, whenever someone tries to spend money, the network's nodes check if the corresponding UTXO are available to be spent, i.e. listed in the set of UTXO. </p>

<p>If somebody tried to spend money twice, the UTXO would have been consumed by the first transaction already, and would therefore no longer be listed in the set of UTXO.</p>

CC BY-SA 3.0
2015-05-13T08:21:24.327Z
2015-05-13T08:27:04.313Z
2017-04-13T12:47:33.610Z
Murch
<p>I know, that a user cannot create a fork in the chain. </p>

<p>Also, it is said, that since every transaction is publicly announced, any attempt of double-spend on the same chain would be rejected as the network would know that these bitcoins have been spent previously in the chain. But how would the network determine, that these bitcoins have been spent previously because, the identity of payer and payee is not known? Only the newly created addresses are known at time of spending which can be later changed during double-spend. </p>

<p>For example, if Alice sends 10 BTC to Bob using 0000ab578c4 as her address and this forms part of 50th block in block chain. Now again she spents 10 BTC to Bob using another address 004325bda in the 67th block of same chain, how would the network determine that this is a double spend? (No one knows to whom 004325bda belongs).</p>

CC BY-SA 3.0
2015-05-13T05:50:51.777Z
If she has 10 BTC in two separate addresses than she has 20 BTC in total and therefore can send 10 BTC twice to Bob.
Luca Matteis
<doublespend>
How would this double spend attack be prevented?
Anshul Mittal
# How would this double spend attack be prevented?

(Asked by: username_0 on 2015-05-13)

I know, that a user cannot create a fork in the chain.

Also, it is said, that since every transaction is publicly announced, any attempt of double-spend on the same chain would be rejected as the network would know that these bitcoins have been spent previously in the chain. But how would the network determine, that these bitcoins have been spent previously because, the identity of payer and payee is not known? Only the newly created addresses are known at time of spending which can be later changed during double-spend.

For example, if Alice sends 10 BTC to Bob using 0000ab578c4 as her address and this forms part of 50th block in block chain. Now again she spents 10 BTC to Bob using another address 004325bda in the 67th block of same chain, how would the network determine that this is a double spend? (No one knows to whom 004325bda belongs).

**Tags:** doublespend

> **Comments:**
> **username_1**: If she has 10 BTC in two separate addresses than she has 20 BTC in total and therefore can send 10 BTC twice to Bob.  

---

## 1 answers

### Answer by username_2 on 2015-05-13. Score: 2 | Accepted answer

Transactions create Unspent Transaction Outputs [utxo](/questions/tagged/utxo "show questions tagged 'utxo'"). [UTXO are uniquely identifiable.](https://bitcoin.stackexchange.com/a/21459/5406) UTXO are indivisible, they are destroyed completely, when money is spent from them. ([Which is why you need to send change back to yourself.](https://bitcoin.stackexchange.com/q/736/5406))
Naturally, this also means that you cannot chose what address you send money from, in fact the "sending address" only exists implicitly by being the address that received the funding payment.

So, putting all this together, whenever someone tries to spend money, the network's nodes check if the corresponding UTXO are available to be spent, i.e. listed in the set of UTXO.

If somebody tried to spend money twice, the UTXO would have been consumed by the first transaction already, and would therefore no longer be listed in the set of UTXO.


---

