Bitcoin Forum
February 18, 2026, 10:01:58 AM *
News: Community awards 2025
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: Quest to Understand UTXO functionality  (Read 324 times)
statumx
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
February 17, 2026, 06:52:25 PM
 #21

What really happens technically if a transaction attempts to spend the UTXO that has already been spent and how do the node identifies and invalidate such during the mempool and block validation
Is it just enough that spent UTXO are destroyed and no trace of them in the mempoo afterwards?


When a transaction tries to spend an already spent UTXO, nodes detect it by checking the UTXO set (the current chainstate). If the referenced outpoint (txid + vout) is not present in the UTXO database, validation fails immediately with a “missing inputs” error.

At mempool level, nodes also track spent outputs within the mempool itself. So if a new transaction attempts to double-spend an input that is already used by another mempool transaction, it is rejected unless it qualifies for RBF rules.

During block validation, the same principle applies: each input must reference an existing unspent output in the UTXO set as of that block’s context. Once an input is consumed, it is removed from the UTXO set and replaced with the new outputs created by the transaction.

So spent UTXOs are not “destroyed without trace”  they are removed from the UTXO set but remain permanently recorded in the blockchain history. The UTXO set just represents the current spendable state.
PrimeNumber7
Copper Member
Legendary
*
Offline Offline

Activity: 1876
Merit: 2010

Amazon Prime Member #7


View Profile
February 17, 2026, 11:01:06 PM
 #22

Exactly. If you have the full history, then it is trustless. But if you have only the UTXO set, then some malicious node could add some non-existing entries, claiming that you have for example 21 BTCs. And then, you have no way of knowing, if it is fake or real, without checking previous coins.
That is not how pruned nodes work. A pruned node will validate the entire blockchain, and derive the UTXO set from the validated blockchain. The difference is that a pruned node will not keep the blockchain data locally. 

isnt it basically ALL nodes, pruned or unpruned, build their own UTXO set and validate as they go, no one sends them a UTXO set.

or am i misunderstanding?
Yes, that is correct. The UTXO is a derived database from the blockchain. 
Pages: « 1 [2]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!