3

I understand how full nodes use Merkle proofs to convince SPV clients that certain transactions are valid / invalid.

Does the Bitcoin software use Merkle trees in any other way?

3

The merkle root is included in the block header as a cryptographic commitment of the transactions that were included in that block. Without such a commitment, the POW for the block would be computed independent of the transactions included in the block. Transaction ordering is important, so a cryptographic proof/commitment needs to be included in the POW, otherwise the network would be unable to verify which transactions are in each block.

The merkle tree structure itself could be replaced by something else (eg just chain all transactions, hash that, and include the result in the header as a cryptographic commitment), but using the merkle tree structure has some added benefits (faster verification for SPV wallets, for example).

There may be some other reasons I am not remembering, but the cryptographic commitment is the most obvious that comes to mind.

2

Yes.

To find a non-SPV application of the Merkle tree, you needn't look further than the first mention of "Merkle Tree" in the Bitcoin whitepaper. It appears in section 7, "Reclaiming Disk Space", which explains how it can be used to prune old, irrelevant transactions, even among full nodes.

SPV itself is presented in section 8, aptly titled "Simplified Payment Verification".

Another application is not mentioned in the Bitcoin whitepaper, because it is a later development and is not strictly a part of the core protocol, and that is in mining pools. With a Merkle Tree, a miner can tweak the generation transaction independently based on the pool's template (for a wider range of hash attempts), or alternatively choose his own work and submit to the pool a proof that he is working for the pool.

1

Simply, no. Instead, probably, it'd concat all the TXIDs in the block and [Double] Sha256 them. This can be calculated much faster than a Merkle Tree. Merkle Trees have no use other than allowing someone without the complete set of the data to verify that a specific transaction was in the tree.

  • I guess it's technically true that the Merkle tree structure is only used to verify a tx is in a block without the full set of txs, however, SPV is not the only place where that ability is used. See my answer for additional applications - bitcoin.stackexchange.com/a/78838/575. – Meni Rosenfeld Sep 1 '18 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.