0
By verification I do not mean the puzzle solving/hash calculating part but the part involving searching all of the blocks to check if the transaction is valid or not?
For example if A transferred some coins to B ten years ago and after that A didn't make any transaction. Now A wants to make some transaction. To verify this transaction, the miners need to know A's balance which was last updated ten years ago. To do this the miners have to traverse through huge number of blocks to the block of then, won't it take much time?
Does Merkle tree plays any role in this? – abhishek singla – 2019-04-17T12:24:13.043
@abhisheksingla Merkle tree is basically constructed by grouping and hashing the
txidsof the transactions in the block until you get to the root. It can no way tell, if that transaction has been spent earlier. They can be used to inform, say a simplified node, that a particular transaction has been included in the block by providing them a merkle path. – Ugam Kamat – 2019-04-17T12:27:41.367can we say that merkle tree reduces the time to reach a particular transaction by providing the merkle path which should be the order of O(log(n)) being a binary tree? or is it a totally different thing and only "aggressively cached in memory" is responsible for verifying faster? – abhishek singla – 2019-04-17T13:05:40.013
@abhisheksingla the latter. Caching UTXOs in the RAM is what allows faster transaction validation. If you do not have the UTXO set, you have to go through the entire blockchain to see that the transaction and vout referenced has not been spent earlier. In fact, when you initialize a full node, this UTXO set is built from scratch by checking all the way up from the genesis block. – Ugam Kamat – 2019-04-17T13:17:18.053