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.

1 Answer 1

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.

4
  • 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
    Oct 26, 2019 at 1:43
  • 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. Oct 26, 2019 at 1:52
  • 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
    Oct 26, 2019 at 2:08
  • 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: blockchain.com/btc/block/… Oct 26, 2019 at 2:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.