<p>It is impossible to answer this accurately without knowing details such as the hardware the miner is using, their utxo storage method, and their validation process.</p>

<p>However, in general, the utxo set can be stored as a list keyed by the utxo identifier (<code>txid:vout</code>). This provides O(1), or constant, look up complexity for a single utxo. </p>

<p>However, the utxo set may not fit entirely in memory on many systems, and the actual retrieval time may be longer than you'd expect in an ideal scenario after accounting for disk access time, and other implementation specific details.</p>

<p>In a miner's case, they validate incoming transactions and prepare a block template by feerate asynchronously from the actual mining operation - this allows them to have a reasonably good chance of maximising their earnings per block without having the mining process blocked by tx and block validation systems.</p>

CC BY-SA 4.0
2019-10-26T01:43:03.147Z
Thanks. How do the miners can start mining before generating the block?! They need to know the whole block and then try to find a solution to the puzzle. Am I wrong?
tesoke
CC BY-SA 4.0
2019-10-26T01:52:44.337Z
They start mining a bare minimum (empty) block, and keep replacing the block header with the header for a more optimal block as better transactions are available and checked. This allows them to constantly be mining *some* block.
Raghav Sood
CC BY-SA 4.0
2019-10-26T02:08:54.030Z
Suppose that they could mine the bare minimum (empty) block very quieckly before they could find enough valide TXs. Then will other miners accept this empty block as a new block?!
tesoke
CC BY-SA 4.0
2019-10-26T02:35:20.947Z
As long as the empty block has valid proof of work, it will be accepted. There are many such blocks. Here's one from a couple of days ago: https://www.blockchain.com/btc/block/0000000000000000000da19960ca1695b1ccaf25400050faf29966bd6b3b56c9
Raghav Sood
CC BY-SA 4.0
2019-10-26T00:20:38.473Z
2019-10-26T00:20:38.473Z
Raghav Sood
<p>to validate a TX, the miner or full node should first find the UTXO. How long does it take to find a specific UTXO in a list of UTXOs set?</p>

<p>Right now, there are around 100 million of UTXOs. Then, how long does it take to find a specific UTXO among 100 million UTXOs? I need to know the accurate time.</p>

<mining-theory><utxo><utxo-set>
How long does it take to find a UTXO in UTXOs set?
tesoke
# How long does it take to find a UTXO in UTXOs set?

(Asked by: username_0 on 2019-10-26)

to validate a TX, the miner or full node should first find the UTXO. How long does it take to find a specific UTXO in a list of UTXOs set?

Right now, there are around 100 million of UTXOs. Then, how long does it take to find a specific UTXO among 100 million UTXOs? I need to know the accurate time.

**Tags:** mining-theory, utxo, utxo-set


---

## 1 answers

### Answer by username_1 on 2019-10-26. Score: 2

It is impossible to answer this accurately without knowing details such as the hardware the miner is using, their utxo storage method, and their validation process.

However, in general, the utxo set can be stored as a list keyed by the utxo identifier (`txid:vout`). This provides O(1), or constant, look up complexity for a single utxo.

However, the utxo set may not fit entirely in memory on many systems, and the actual retrieval time may be longer than you'd expect in an ideal scenario after accounting for disk access time, and other implementation specific details.

In a miner's case, they validate incoming transactions and prepare a block template by feerate asynchronously from the actual mining operation - this allows them to have a reasonably good chance of maximising their earnings per block without having the mining process blocked by tx and block validation systems.

> **Comments:**
> **username_0**: Thanks. How do the miners can start mining before generating the block?! They need to know the whole block and then try to find a solution to the puzzle. Am I wrong?  
> **username_1**: They start mining a bare minimum (empty) block, and keep replacing the block header with the header for a more optimal block as better transactions are available and checked. This allows them to constantly be mining *some* block.  
> **username_0**: Suppose that they could mine the bare minimum (empty) block very quieckly before they could find enough valide TXs. Then will other miners accept this empty block as a new block?!  
> **username_1**: As long as the empty block has valid proof of work, it will be accepted. There are many such blocks. Here's one from a couple of days ago: https://www.blockchain.com/btc/block/0000000000000000000da19960ca1695b1ccaf25400050faf29966bd6b3b56c9  

---

