<p>No, not really.</p>

<p>First of all, there is no clear way for everyone to agree on which was the first transaction to be sent to the network.  If the attacker was to send two conflicting transactions (call them A and B) to different nodes almost simultaneously, then depending on how the propagate, some nodes might see A first, and others B.</p>

<p>For the Bitcoin Core reference client, if it receives A first and later receives B, it will ignore B and will not relay B to its peers.  This hampers a double-spend attack somewhat.  But if a client later receives a mined block that contains the transaction B, it will accept it in place of A.  And a miner has total freedom which of the two transactions to include in a block.</p>

CC BY-SA 3.0
2014-05-09T19:56:20.220Z
2014-05-09T19:56:20.220Z
Nate Eldredge
<p>In tackling double spending, does the protocol enforces that only the first transaction (and by first i mean the first transaction to be send to the network) is considered as valid ? </p>

<doublespend>
Double spending race attack first transaction
perencia
# Double spending race attack first transaction

(Asked by: username_0 on 2014-05-09)

In tackling double spending, does the protocol enforces that only the first transaction (and by first i mean the first transaction to be send to the network) is considered as valid ?

**Tags:** doublespend


---

## 1 answers

### Answer by username_1 on 2014-05-09. Score: 3 | Accepted answer

No, not really.

First of all, there is no clear way for everyone to agree on which was the first transaction to be sent to the network. If the attacker was to send two conflicting transactions (call them A and B) to different nodes almost simultaneously, then depending on how the propagate, some nodes might see A first, and others B.

For the Bitcoin Core reference client, if it receives A first and later receives B, it will ignore B and will not relay B to its peers. This hampers a double-spend attack somewhat. But if a client later receives a mined block that contains the transaction B, it will accept it in place of A. And a miner has total freedom which of the two transactions to include in a block.


---

