3

What if a miner takes a transaction which is already on the chain and adds it to a new block to earn the fee once more?

Which mechanism prohibits replay attacks of this type?

1 Answer 1

8

Transaction inputs use Unspent Transaction Outputs (UTXO).
UTXO are created by transactions. They are uniquely identified by the transaction id and the output position in the transaction that created them.
Once UTXO are used as inputs in another transaction, and that transaction is included in a block, nodes that parse the block will mark them as spent.

So any node evaluating the replay attack will realize that the UTXO are no longer in their UTXO set and therefore the funding for the transaction is invalid.

1
  • 2
    The one exception is coinbase transactions, which don't need to use any UTXOs. But if a miner includes a coinbase transaction that is identical to a previous one, he is only hurting himself. Jul 30, 2016 at 20:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.