Race Attack Meaning
A race attack is a type of double-spending attempt where a malicious actor sends two conflicting transactions to the network at almost the same time. The goal is to "race" a transaction that pays a merchant against a transaction that sends the same funds back to the attacker’s own wallet.
If the attacker can convince the merchant to accept the payment before it is confirmed in a block, they can potentially keep the goods and the money.This attack vector targets businesses that accept zero-confirmation transactions. The attacker sends a payment to the merchant and immediately broadcasts a second transaction with the same inputs but a much higher miner fee.
Since miners prioritize fees, the second transaction is almost certain to be included in the next block first, rendering the merchant's transaction "invalid" because the funds have already been spent in the eyes of the network.To prevent race attacks, most crypto-integrated businesses require at least one confirmation (inclusion in a block) before considering a payment successful. For high-value transactions, three to six confirmations are typically required.
While Bitcoin’s Replace-By-Fee (RBF) feature was designed for legitimate fee-bumping, it also made zero-conf transactions inherently less safe, reinforcing the standard of waiting for on-chain finality.