how does a node searches a transaction among various blocks in blockchain?

how does a node searches a transaction among various blocks in blockchain?

Let me express what I have got to know about blockchain and where am I stuck.

Transactions are stored in the form of merkel trees inside a block. (I know how a merkel tree is made). A merkel root is calculated and stored in the block header. An SPV can ask a full node about the balance of an address (which is an encryption of public key).

Now a full node is supposed to give merkel root hash of all the blocks which contain the transactions( which contains the UTXOs which can be spent by the private key holder by unlocking its output script using its digital signature).

I want to know how does the full node get to know which blocks exactly contains those UTXOs? Does it the traverse merkel tree of each block till genesis block? or is there any way to know if the block contains those transaction or not just by utilising its merkel root.

http://ift.tt/2rRLXnc

Comments

Popular posts from this blog

sendrawtransaction and txn-mempool-conflict

couldn't connect to server: EOF reached (code 1)