How long does it take to find a UTXO in UTXOs set?

0

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.

tesoke

Posted 2019-10-26T00:13:28.927

Reputation: 11

Answers

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.

Raghav Sood

Posted 2019-10-26T00:13:28.927

Reputation: 10 897

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 2019-10-26T01:43:03.147

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 2019-10-26T01:52:44.337

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 2019-10-26T02:08:54.030

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 2019-10-26T02:35:20.947