<p>Full node may build the UTXO set 6 blocks behind to cater for possible orphaning. 0.5% rate as off 2019 (I think). Example</p>

<p>Let said currently is Block 500,006</p>

<p>The full node will do the UXTO index from Block 1 till Block 500,000
Block 500,001 till 500,006 is left untouched because these blocks has a high probability of orphaning. </p>

<p>Once orphaned, it quite messy to redo the index. May as well just wait for it to be stabilized first with 6 blocks of PoW.</p>

<p>To search the UTXO set, it searches the UTXO index, if you cannot find it will search block 500,001 till 500,006. If still unfound, then the UXTO is non-existence yet.</p>

CC BY-SA 4.0
2020-04-17T02:13:56.910Z
2020-04-17T02:13:56.910Z
Cisco Mmu
<blockquote>
  <p>Does it check every block in between where the UTXO first appeared and the current time to make sure it didn't get spent then?</p>
</blockquote>

<p>Yes, but this check is not done for each UTXO individually as transactions come in, it is an ongoing process that specifies the current state of the network. </p>

<p>A bitcoin node will independently work through the entire transaction history of the network, and while doing so it will build an index of <em>unspent transaction outputs</em> (UTXOs), which are, as the name suggests, transaction outputs which have not yet been spent, and thus are valid to be spent on the network. As new outputs are created, they are added to the UTXO set. Likewise, when a UTXO is consumed as input to a transaction, it is removed from the UTXO set. So any valid new transaction must specify one or more of these UTXOs as inputs (with the exception of coinbase transactions, which do not have any inputs). </p>

CC BY-SA 4.0
2020-01-27T19:54:31.940Z
2020-01-27T19:54:31.940Z
chytrik
<p>Does it check every block in between where the UTXO first appeared and the current time to make sure it didn't get spent then? Or is there some other caching or other method to make the check faster?</p>

<transaction-verification><utxo-set>
How do nodes validate that a UTXO in a new transaction is unspent?
Andrew
# How do nodes validate that a UTXO in a new transaction is unspent?

(Asked by: username_0 on 2020-01-27)

Does it check every block in between where the UTXO first appeared and the current time to make sure it didn't get spent then? Or is there some other caching or other method to make the check faster?

**Tags:** transaction-verification, utxo-set


---

## 2 answers

### Answer by username_2 on 2020-01-27. Score: 3 | Accepted answer

> Does it check every block in between where the UTXO first appeared and the current time to make sure it didn't get spent then?

Yes, but this check is not done for each UTXO individually as transactions come in, it is an ongoing process that specifies the current state of the network.

A bitcoin node will independently work through the entire transaction history of the network, and while doing so it will build an index of *unspent transaction outputs* (UTXOs), which are, as the name suggests, transaction outputs which have not yet been spent, and thus are valid to be spent on the network. As new outputs are created, they are added to the UTXO set. Likewise, when a UTXO is consumed as input to a transaction, it is removed from the UTXO set. So any valid new transaction must specify one or more of these UTXOs as inputs (with the exception of coinbase transactions, which do not have any inputs).


---

### Answer by username_1 on 2020-04-17. Score: 0

Full node may build the UTXO set 6 blocks behind to cater for possible orphaning. 0.5% rate as off 2019 (I think). Example

Let said currently is Block 500,006

The full node will do the UXTO index from Block 1 till Block 500,000
Block 500,001 till 500,006 is left untouched because these blocks has a high probability of orphaning.

Once orphaned, it quite messy to redo the index. May as well just wait for it to be stabilized first with 6 blocks of PoW.

To search the UTXO set, it searches the UTXO index, if you cannot find it will search block 500,001 till 500,006. If still unfound, then the UXTO is non-existence yet.


---

