<p>A transaction's input parameter has to include the outpoint (<code>txid</code> and <code>vout</code>) of the transaction from which you have got the bitcoins. These outpoints helps nodes verify that the transaction is consuming inputs that have not been spent before. Full nodes maintain a UTXO set of all such outpoints so that they can easily verify the transaction when they get one. Since you are claiming that you have received a double spend transaction, I am assuming it means that there is another transaction that is consuming the same outpoint as the transaction from which you have got your bitcoins. </p>

<p>In a general case, when a chain re-org happens, transactions that were in the blocks of the previous version of the chain but not present in the current active chain are removed and moved to the mempool (provided it is valid), where it will wait until it is confirmed. But since the transaction from which you got the bitcoins is consuming the same outpoint as the transaction that is confirmed in the active chain, the double spend transaction will be discarded by the nodes as it will be invalid. Since, your spending of the double spend is pointing to a transaction that is invalid, your transaction is invalid as well.</p>

<p>That is the very reason it is recommended to wait for a few blocks (6 blocks ideally) before considering that you have got the bitcoins from the other person/machine. If the amount is really sizable, it would be prudent to wait for tens of block confirmations.</p>

CC BY-SA 4.0
2019-10-27T15:45:33.420Z
2019-10-27T15:45:33.420Z
Ugam Kamat
<p>Given I can receive a double spend and potentially re-spend it after 1 confirmation, what happens to that transaction once the double spend is detected during a blockchain reorg?</p>

CC BY-SA 4.0
2019-10-27T17:38:59.537Z
I'm not sure I understand your scenario fully. Let me try to paraphrase: there are two transactions `A1` and `B1` that are mutually exclusive because they are spending the same UTXO ("a doublespend"). First, `A1` gets included in the best chain, but then there is a reorg and `B1` is part of the best chain now. You had spent the output of `A1` previously while `A1` was part of the best chain in transaction `A2`. What happens to `A2` after the reorg? -- Is that what you're asking?
Murch
<doublespend><chain-reorganization>
What happens if I spend a double spend?
Anonona
# What happens if I spend a double spend?

(Asked by: username_0 on 2019-10-27)

Given I can receive a double spend and potentially re-spend it after 1 confirmation, what happens to that transaction once the double spend is detected during a blockchain reorg?

**Tags:** doublespend, chain-reorganization

> **Comments:**
> **username_1**: I'm not sure I understand your scenario fully. Let me try to paraphrase: there are two transactions `A1` and `B1` that are mutually exclusive because they are spending the same UTXO ("a doublespend"). First, `A1` gets included in the best chain, but then there is a reorg and `B1` is part of the best chain now. You had spent the output of `A1` previously while `A1` was part of the best chain in transaction `A2`. What happens to `A2` after the reorg? -- Is that what you're asking?  

---

## 1 answers

### Answer by username_2 on 2019-10-27. Score: 1 | Accepted answer

A transaction's input parameter has to include the outpoint (`txid` and `vout`) of the transaction from which you have got the bitcoins. These outpoints helps nodes verify that the transaction is consuming inputs that have not been spent before. Full nodes maintain a UTXO set of all such outpoints so that they can easily verify the transaction when they get one. Since you are claiming that you have received a double spend transaction, I am assuming it means that there is another transaction that is consuming the same outpoint as the transaction from which you have got your bitcoins.

In a general case, when a chain re-org happens, transactions that were in the blocks of the previous version of the chain but not present in the current active chain are removed and moved to the mempool (provided it is valid), where it will wait until it is confirmed. But since the transaction from which you got the bitcoins is consuming the same outpoint as the transaction that is confirmed in the active chain, the double spend transaction will be discarded by the nodes as it will be invalid. Since, your spending of the double spend is pointing to a transaction that is invalid, your transaction is invalid as well.

That is the very reason it is recommended to wait for a few blocks (6 blocks ideally) before considering that you have got the bitcoins from the other person/machine. If the amount is really sizable, it would be prudent to wait for tens of block confirmations.


---

