0

A user sending coins broadcast transaction hash to bitcoin network. Now if someone is able to copy the message (hashed transaction) and relay it multiple times it could lead to possible disruption.

Eg:

Node 1 sends a transaction to node 2. Node 2 forwards to node 3 and so on. This transaction gets mined.

Now what will happen if node 2 will try to relay the same message again?

How this is prevented in bitcoin network?

  • I don't understand. What you're describing is normal operation: every node will relay to transaction to all peers eventually, until the whole network has heard about it. – Pieter Wuille Mar 13 '18 at 19:56
2

Now what will happen if node 2 will try to relay the same message again?

How this is prevented in bitcoin network?

The transaction is the same as one that the nodes have already seen; it has the same txid, so they will ignore it.

Bitcoin does not use an accounts based system. Rather Bitcoin uses a transaction outputs model, so each input directly references a transaction output that is being spent. So there is no problem with transactions being replayed; they have already been seen so they're just duplicates that can be ignored.

| improve this answer | |
  • Andrew, Thanks!. So is it the txid a unique identifier here? Who creates txid? Is txid related to 'sender', 'receiver' and 'amount of coin' getting transferred? – Faiz Ali Mar 13 '18 at 20:28
  • 1
    The txid is a unique identifier. It is the hash of the transaction itself. It isn't something that is assigned or created by anybody. It is a property of the transaction itself that anyone can calculate. – Andrew Chow Mar 13 '18 at 20:37

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.