Diving Deep into UTXO Mechanics

20 replies 302 views
stacksatsHero Member
Posts: 404 · Reputation: 2023
#1Aug 30, 2025, 12:36 PM
What happens if a transaction tries to spend a UTXO that's already been spent? How do nodes catch that in the mempool and block validation? Is it enough that spent UTXOs just vanish from the mempool?
2 Reply Quote Share
0x4lphaFull Member
Posts: 519 · Reputation: 509
#2Sep 1, 2025, 02:26 AM
So, if you use Bitcoin in a transaction, you can't use the same coins again unless it's already been spent. I mean, the receiver could send it to someone else or their own address, right?
1 Reply Quote Share
gang2015Member
Posts: 682 · Reputation: 62
#3Sep 1, 2025, 04:48 AM
Nodes check their UTXO set to see if the TX is trying to spend an existing UTXO. If it's already spent, they know it’s invalid.
3 Reply Quote Share
CalmMinerFull Member
Posts: 554 · Reputation: 784
#4Sep 1, 2025, 07:47 AM
Like ABCbits mentioned, UTXOs belong to a UTXO set, which is like a database stored by all full nodes. Once spent, it's removed. And remember, only coinbase transactions lack an input.
5 Reply Quote Share
im_cobraFull Member
Posts: 107 · Reputation: 274
#5Sep 2, 2025, 08:11 AM
Expanding on that... If a node tries to push a transaction with an already spent UTXO, they’re gonna get banned by other nodes for breaking consensus rules.
2 Reply Quote Share
im_vectorSenior Member
Posts: 23 · Reputation: 865
#6Sep 2, 2025, 01:33 PM
Exactly! If it’s not in the UTXO set, it means it’s spent. Spent outputs are wiped off the UTXO set and create new outputs instead.
0 Reply Quote Share
alexsatNewbie
Posts: 278 · Reputation: 15
#7Sep 2, 2025, 05:29 PM
This usually happens when UTXOs were spent in a previous block, confirmed by miners. The real issue is figuring out double spends happening in the same block, like two transactions created milliseconds apart.
4 Reply Quote Share
ColdGangMember
Posts: 152 · Reputation: 183
#8Sep 2, 2025, 10:09 PM
Bitcoin's a public ledger, meaning spent coins are marked as such. Nodes use timestamps and other data to confirm coins are legit and haven’t been spent before.
4 Reply Quote Share
0xBlockMember
Posts: 34 · Reputation: 139
#9Sep 3, 2025, 02:07 AM
Miners have geographically diverse nodes to quickly start on new blocks after one is found. Merchants do the same to protect their nodes from attacks. Conflicting transactions won't guarantee confirmation.
0 Reply Quote Share
stacksatsHero Member
Posts: 404 · Reputation: 2023
#10Sep 3, 2025, 03:15 AM
Do pruned nodes reliably serve UTXO data for wallets? Are there limitations compared to archival nodes?
3 Reply Quote Share
0xBlockMember
Posts: 34 · Reputation: 139
#11Sep 3, 2025, 05:53 AM
Edge cases exist in all engineering. If you add an address after syncing, knowing available UTXOs is tricky. Electrum won’t work with pruned nodes either. You should be fine if your wallet has the private key when syncing starts.
0 Reply Quote Share
gang2015Member
Posts: 682 · Reputation: 62
#12Sep 3, 2025, 09:45 AM
Yeah, sometimes they have limitations too, like accepting 0-conf TX below 500 bucks or from familiar customers.
5 Reply Quote Share
dave.forkMember
Posts: 375 · Reputation: 185
#13Sep 3, 2025, 10:11 AM
Keep in mind, pruned nodes store UTXO data, so they can verify new blocks. However, they only send the latest blocks to others due to being node network limited.
4 Reply Quote Share
stacksatsHero Member
Posts: 404 · Reputation: 2023
#14Sep 3, 2025, 12:08 PM
UTXO means "Unspent Transaction Output". You can't have a "spent UTXO". Clarity helps, but what do you mean by serving UTXO data?
4 Reply Quote Share
dave.forkMember
Posts: 375 · Reputation: 185
#15Sep 3, 2025, 03:18 PM
I meant UTXO data for light clients. ABCbits clarified it for me.
2 Reply Quote Share
stacksatsHero Member
Posts: 404 · Reputation: 2023
#16Sep 3, 2025, 09:06 PM
It depends on the light client. I doubt any light client uses just the UTXO set. They can show current balance but not past transactions...unless it was synced from the genesis block.
6 Reply Quote Share
alex.byteLegendary
Posts: 170 · Reputation: 5910
#17Sep 3, 2025, 09:43 PM
So you’re saying a pruned node can’t serve as the genesis for new nodes since it lacks the full blockchain history?
2 Reply Quote Share
0xBlockMember
Posts: 34 · Reputation: 139
#18Sep 3, 2025, 09:53 PM
Exactly! If you have the full history, it’s trustless. With just the UTXO set, a malicious node could fake balances, and you'd have no way to check if it’s real or not.
6 Reply Quote Share
topbl45tNewbie
Posts: 20 · Reputation: 4
#19Sep 5, 2025, 03:50 AM
Pruned nodes validate the entire blockchain and create the UTXO set from that, but they won’t keep the whole blockchain data.
4 Reply Quote Share
alex.byteLegendary
Posts: 170 · Reputation: 5910
#20Sep 5, 2025, 05:06 AM
Isn’t it true that all nodes, whether pruned or not, build their own UTXO set? They validate as they go, right?
4 Reply Quote Share

Related topics