How Bitcoin prevents double-spending

Double spending

If a user can reacquire the coins they spent in one transaction and spend them again in another, it's called double-spending.

Bitcoin prevents double spending with the following two properties:

Unspent transaction output (UTXO) model

In Bitcoin, a user can only spend a coin once. New coins are generated as output whenever a Bitcoin is spent, also known as UTXOs. All Bitcoin transactions point to UTXOs produced as output in some previous transactions.

Miners typically maintain a UTXO database, and whenever a UTXO is spent, its entry is deleted from the database. Therefore, if someone tries to spend that UTXO again, they'll get an error and reject the transaction as the input UTXOs have already been spent elsewhere.

A transaction is refrencing a previous transaction's output
1 of 3

Distributed consensus and global ledger

The entire blockchain is visible to every node, and a consensus is held before adding a block to the blockchain. Every node verifies all the transactions in a candidate blockBlock that is proposed by miners to all other nodes to add it to their local views of the blockchain., and if an incorrect/malicious transaction is found, that block is rejected, Thus preventing double-spending.

Initial state of the blockchain
1 of 4

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved