A race attack is a type of Bitcoin-mitigating attack where an attacker creates two contradictory transactions side by side with the intent of spending those funds twice. For example, an attacker would send the same coin to different vendors using different machines, and if the vendors skip block verification to deliver the goods, they would realize that the transaction was nullified during the mining process.
Understanding the term
The two equal transactions made by the attacker use the same fund to broadcast a competing transaction across the network. A victim of the race attack would receive the first transaction by accepting the payment before it is confirmed.
At the same time, the attacker would receive an equal amount on the second transaction, which would make the first transaction invalid. During a race attack, it is possible to use the same cryptocurrency to make two simultaneous transactions using different machines.
The trick behind race attacks is not giving the receiver the opportunity to wait for the first transaction confirmation. If block confirmation takes place after receiving the first transaction, receivers will quickly realize that it was rejected during the mining.
The best way to protect oneself from such an attack is by disabling incoming connections and choosing particular outgoing connections and well-connected nodes.
The purpose of race attacks is to spend the same funds twice. Traders and vendors who accept payments readily without block confirmation are vulnerable to race attacks.