2 ms·
If you are indexing all transactions you are right that merkle trees are not very useful. They become useful when you aren't, for example, when running a lightw
by olalonde 7y ago
If you are indexing all transactions you are right that merkle trees are not very useful. They become useful when you aren't, for example, when running a lightweight client that only stores block headers.
Let's say you are running a lightweight wallet and import a private key, your client will download all transactions that spend from/to that private key from a node that does index all transactions (a "full node"). With the block hash and merkle branch of each transaction, your client will be able to independently verify that each transactions were included in a block and are therefore valid. This of course assumes that the longest chain (in terms of proof of work) is valid, which is usually a reasonable assumption.