<p>This is not prescribed in the Bitcoin network protocols, of course. So each software developer is free to make their own choices.</p>
<p>Personally I think only the most inexperienced and naive developer would choose to read and re-read half a terabyte of data every time they need to retrieve a few bytes of data for a transaction. An index of any type is the obvious approach. There are numerous libraries and tools for this purpose.</p>

CC BY-SA 4.0
2022-05-13T08:30:22.650Z
2022-05-13T08:30:22.650Z
RedGrittyBrick
<p>Is that the process will go through all the blocks and find the block which contains the txid or there's an index table for all transactions?</p>

<transactions><block>
How does the block searching by txid works?
Kalle Chen
# How does the block searching by txid works?

(Asked by: username_0 on 2022-05-13)

Is that the process will go through all the blocks and find the block which contains the txid or there's an index table for all transactions?

**Tags:** transactions, block


---

## 1 answers

### Answer by username_1 on 2022-05-13. Score: 1 | Accepted answer

This is not prescribed in the Bitcoin network protocols, of course. So each software developer is free to make their own choices.

Personally I think only the most inexperienced and naive developer would choose to read and re-read half a terabyte of data every time they need to retrieve a few bytes of data for a transaction. An index of any type is the obvious approach. There are numerous libraries and tools for this purpose.


---

