Transactions, digital signatures, and chains of ownership all protect users from counterfeiting. However, these features alone can’t protect users from receiving a coin that has already been spent. This form of fraud is known as double spending.
This post is part of the extended series Bitcoin from Scratch.
Double spending occurs when a payer gives the same coin to two or more recipients. At the transaction level, a double spend happens when two or more inputs reference the same output. If left unchecked, double spending enables the uncontrolled creation of new money.
Simply trusting a payee does not solve the double spending problem. For example, a coin may have been double spent early in its chain of ownership. Each new recipient passes the bogus coin to a new owner, unaware of its shady history. The fraud would only be detected by a recipient who happens to run across an intersecting chain of ownership.
A related situation arises in physical cash systems when the owner of a metal coin or bank note copies it, then uses the copies to make payments. However, the double spending problem faced by electronic cash systems is unique in that physical tokens can never be exactly replicated. A reference to a transaction output, in contrast, can be copied with 100% fidelity. Double spending allows digital tokens to be spent many times without ever calling the chain of ownership into question.
If left unchecked, double spending erodes buying power for the entire user community. As double spenders conjure value into existence without restriction, the money supply soars. Unconstrained money growth reduces the value of all coins, even those that aren’t double spent. Eventually users flee for more secure stores of value. Building an electronic cash system that can be used in the real world requires a practical solution to the double spending problem.