What if a pair of double-spent transactions are collected into a new block?

3

Let's say, Alice sent a bitcoin to Bob, and then immediately sent the same coin to another address controlled by her. A honest node collected these two transactions into a new block. Would the node be able to detect that this pair of transactions are double spent?

cryptoeconomist

Posted 2017-01-08T00:30:02.673

Reputation: 39

2A node that collects them into the same block is by definition not honest, as it is a violation of the consensus rules that outlaw double spending.Pieter Wuille 2017-01-08T01:25:06.893

Answers

4

When Alice sends the bitcoin, she spends an Unspent Transaction Output (UTXO) created by a previous transaction. To create a doublespend, she has to use the same UTXO as an input for another transaction.

As every full node keeps track of all existing UTXO, it is trivial for all nodes to recognize these transactions as doublespend. A block containing two conflicting transactions would be invalid, and thus would not be accepted by any nodes.

Murch

Posted 2017-01-08T00:30:02.673

Reputation: 41 609