A fraudulent technique where the same digital currency is spent more than once, exploiting the digital nature of cryptocurrency transactions.
Double spending is a potential flaw in a digital cash scheme where a single digital token can be spent more than once. This is possible because a digital token consists of a digital file that can be duplicated or falsified. The issue of double spending is a significant obstacle in the development of digital cash and is largely prevented in public blockchains by the use of consensus mechanisms.
Before cryptocurrencies, this problem made digital cash systems reliant on central authorities to verify transactions. Satoshi Nakamoto's innovation with Bitcoin was creating a decentralized system that solved the double-spend problem without requiring trusted third parties.
A malicious actor sends a payment to a merchant, and then, almost simultaneously, sends another transaction using the same coins to another address they control. This could potentially defraud the merchant if both transactions are validated by the network.
Double spending typically requires a congested network, features that allow for transaction replacement, and time pressure on the part of the recipient. Congested networks can lead to miners having different transactions in their mempools, enabling the acceptance of conflicting transactions. Features like Replace-by-Fee (RBF) in Bitcoin can be exploited to replace unconfirmed transactions, facilitating double spending.
The risk of double spending is primarily associated with zero-confirmation transactions—those that haven't yet been included in a block. For this reason, high-value transactions usually require waiting for multiple confirmations before considering the payment final.
If a network is congested and a user sends two transactions using the same coins — one to a merchant and another to an address they control — different miners might validate each transaction, leading to a double spend.
Blockchain networks use various mechanisms to prevent double spending. For instance, Bitcoin's Proof of Work (PoW) consensus mechanism ensures that all transactions are confirmed in a linear sequence (the blockchain), making it nearly impossible to double spend without controlling more than 50% of the network's hash power.
Different cryptocurrencies implement various approaches to minimize double-spend risk. Bitcoin Cash, for example, maintains the PoW consensus mechanism but with larger blocks to reduce network congestion, which helps minimize the conditions where double spending becomes feasible. Additionally, features like Double Spend Proofs in BCH can alert merchants to potential double-spend attempts for zero-confirmation transactions, making everyday commerce more practical.
In Bitcoin, once a transaction is confirmed and added to the blockchain, any attempt to spend the same coins again would be rejected by the network, as it would be recognized as a double spend.
A more sophisticated form of double spending involves colluding with miners to validate fraudulent transactions. This is known as a 51% attack and requires significant resources, making it impractical for most attackers.
The cost of executing a 51% attack varies by network. On major cryptocurrencies with substantial hash power like Bitcoin, such attacks are prohibitively expensive, requiring billions in hardware and electricity. On smaller networks with less hash power, the cost barrier is lower, making them potentially more vulnerable.
If an attacker controls a majority of the network's hash power, they could potentially validate a transaction spending certain coins, and then create a longer blockchain where those coins are spent differently, invalidating the original transaction.
From a technical perspective, double spending is prevented through the combination of cryptographic signatures and the public ledger's chronological ordering of transactions. Each transaction contains inputs (references to previous transaction outputs) and outputs (new destinations for the coins). Once an input is referenced in a confirmed transaction, the network prohibits its reuse in future transactions.
The finality of transactions increases exponentially with each additional confirmation (new block built on top of the block containing the transaction). This is why exchanges and services often require multiple confirmations before crediting deposits, with the number varying based on the cryptocurrency and its block time.
"For a $10 coffee purchase using cryptocurrency, a merchant might accept a zero-confirmation transaction with minimal risk, while a car dealership selling a vehicle worth thousands would likely wait for multiple confirmations before releasing the vehicle."
All terms and definitions may update as the Cryptionary improves.