Since bitcoin uses binary Merkle trees (just learned that), I want to know what would be the algorithmic efficiency for transaction lookup in the blockchain.
I don't know exactly how the data structure underneath the blockchain is organized.
AFAIK, each block contain a single Merkle tree, which can be related to the previous block tree by the prevId
field in its own block header.
Given all that, I was wondering if, given a TXID
, I would be able to locate that transaction in the blockchain in logarithmic time (O(log2 n)
) as just a simple tree traversing, or if there are some hidden details I'm not considering.