Double spending is an attempt to spend the same digital money twice: send a coin to one recipient and then pay someone else with it or send it back to yourself. Blockchain prevents this with a shared transaction record and confirmations.
The core problem of digital money
A digital file can be copied as many times as you like. If money were just a file, nothing would stop you from sending the same “banknote” to two people. Banks solve this centrally: they keep a single database of accounts and debit the money themselves. Bitcoin became the first working system to solve the problem without a central intermediary; Satoshi Nakamoto described it precisely as a way to prevent double spending in a peer-to-peer network. Every node keeps the same transaction history, and the order of transactions is fixed by blocks.
How the network stops it
Every node that receives a transaction checks whether the coins it uses have already been spent. If two transactions spend the same coins, only one will make it into a block and the network will reject the other. Until a transaction is included in a block, it waits its turn in the mempool, and at that stage someone can still try to replace it. Once it is in a block, and with each further confirmation, reversing it becomes harder. That is why merchants and exchanges wait for several confirmations before crediting funds.
Types of attack
Race attack: a fraudster sends two transactions with the same coins almost simultaneously, one to the merchant and one to themselves, hoping the second ends up in a block. Replace-by-fee: on the bitcoin network an unconfirmed transaction can be replaced by another with a higher fee, so if the merchant hands over the goods before confirmation, the money may go back to the buyer. 51% attack: with majority power, already confirmed blocks can be rewritten. The first two types threaten only those who accept payments without confirmations.
How to protect yourself
Do not treat a transfer as received until it has enough confirmations: for bitcoin, six blocks, roughly an hour, is the traditional benchmark, and fewer will do for small amounts. Do not trust screenshots or a “sent” status in someone else's wallet; check the incoming funds on your side or in a block explorer. In P2P trades, release coins only after the money has actually arrived. For small instant payments, Layer 2 solutions work well, as their protection is designed differently.
A buyer pays a merchant 0.01 BTC for goods and shows the transaction sitting in the mempool. The merchant does not wait for confirmation and hands over the goods. A minute later, the buyer sends the same coins to another of their own addresses with a fee three times higher. Miners pick the more profitable transaction, the second one gets into a block, and the first disappears. Had the merchant waited for even one confirmation, the trick would not have worked.
Related terms
51% AttackTransaction ConfirmationsMempoolBlockchain ConsensusSatoshi Nakamoto
On the site
CryptocurrenciesHow to buy cryptoBitcoin Price PredictionCrypto market Monopoly
This article was written by AI. Check specific rates, taxes and broker terms with primary sources.