2
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?
2
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?
1
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.
I'm not sure I understand your scenario fully. Let me try to paraphrase: there are two transactions
A1andB1that are mutually exclusive because they are spending the same UTXO ("a doublespend"). First,A1gets included in the best chain, but then there is a reorg andB1is part of the best chain now. You had spent the output ofA1previously whileA1was part of the best chain in transactionA2. What happens toA2after the reorg? -- Is that what you're asking? – Murch – 2019-10-27T17:38:59.537