2

Bitcoin uses a Merkle tree with hash functions. I mean I do not get it why there must be a full binary tree? A complete could also be possible?

Murch
  • 75,206
  • 34
  • 186
  • 622
Peter
  • 123
  • 3

1 Answers1

0

Bitcoin does work with full or complete binary trees. For complete trees, leaves without a partner are simply hashed with themselves instead. The attack that CodesInChaos links was solved by checking that every transaction is unique which is required for valid blocks anyway.

enter image description here

Image from Bitcoin Developer Guide

Murch
  • 75,206
  • 34
  • 186
  • 622