What is double spending in crypto?
Double spending is spending the same digital money twice. Blockchains prevent it by having every node check a shared public record before accepting a payment.
Double spending is the act of spending the same unit of digital money more than once. A paper banknote leaves your hand when you pay, but a digital file can be copied, so any digital cash system needs a way to show that a coin has not already been used.
What is the double spending problem?
The Bitcoin white paper puts the problem simply. A payee can check the digital signatures on a coin, but cannot tell from those alone whether an earlier owner already spent it. The paper notes that the only way to confirm a transaction did not happen is to know about all transactions.
The traditional fix is a central mint, such as a bank, that checks every payment. The white paper objected that the whole money system then depends on whoever runs the mint. Its own answer, also summarized in our guide to the Bitcoin white paper, is to announce every transaction publicly and have the network agree on one history.
How does blockchain prevent double spending?
Transactions are grouped into blocks, and each block is chained to the one before it with a hash. Nodes accept a block only if every transaction in it is valid and spends coins that are still unspent. The earliest spend that makes it into the agreed history counts, and later attempts to spend the same coins are rejected.
Because each block carries proof of work, changing an old block means redoing its work and the work of every block after it. The deeper a payment sits, the harder it is to undo. The Bitcoin Wiki says many exchanges and merchants wait for six confirmations, a figure it calls somewhat arbitrary.
What is a double spending attack?
A double spending attack tries to get a seller to hand over goods for a payment that later vanishes. With unconfirmed payments, the Bitcoin Wiki says race attacks and Finney attacks can reverse them at fairly low cost, so zero-confirmation payments suit only small amounts.
Reversing confirmed payments needs more mining power than the rest of the network, the scenario covered in what is a 51% attack. Even then, the white paper says, an attacker can only try to take back its own recent payments. It cannot create value from nothing or take coins that never belonged to it.
Can bitcoin be counterfeited?
Not under normal rules. Every full node checks each block, and blocks that create coins outside the rules are thrown out. A fake coin would need a valid history back to a real one.
Software bugs have been the real risk. In August 2010, a flaw let block 74638 create about 184 billion BTC. A fix came within five hours, and the corrected chain overtook the bad one the next day. In 2018, Bitcoin Core disclosed CVE-2018-17144, a bug that could have let a miner inflate the supply. Fixed versions came out the day after it was reported, and developers said they knew of no attempt to exploit it. The limit itself is explained in why only 21 million bitcoin.
This guide explains how things work. It is not financial, legal or tax advice. Last updated .