0

Is bitcoin Merkle tree always binary?

(1) I am wondering about the lookup efficiency of the Merkle tree.

(2) I haven't found any evidence that Merkle trees are mandatory binary, which would allow a O(log2 n) lookup algorithm.

(3) If a node may have an arbitrary number of children, then the lookup function would have a O(logK n * K), where K is the maximum number of allowed child nodes (as far as I remember).

Raj Kumar
  • 19
  • 3

1 Answers1

1

Merkle Trees by definition are binary, look at the original patent here. The tree structure in Bitcoin is binary too.

The trees aren't lookup trees like traditional search trees, rather they're used as a way to get rid of blockchain data later but have a proof that given a "root node" specific data exists in a block.

Instead of having to transmit an entire Bitcoin block with n transactions to show that your transaction exists in a specific block, you only have to provide log(n) nodes from the merkle tree.

Joe Thomas
  • 5,807
  • 6
  • 25
  • 36