Demonstrating that a leaf node is a part of the given hash tree requires processing an amount of data proportional to the logarithm of the number of nodes of the tree; this contrasts with hash lists, where the amount is proportional to the number of nodes.
Common Uses#Hash trees can be used to verify any kind of data stored, handled and transferred in and between computers.
Currently the main use of hash trees is to make sure that data blocks received from other peers in a peer-to-peer network are received undamaged and unaltered, and even to check that the other peers do not lie and send fake blocks.
Hash trees are used in the
- IPFS file system
- Btrfs file system
- ZFS file system
- BitTorrent protocol
- Apache Wave protocol
- Git distributed revision control system
- Tahoe-LAFS backup system
- Merkle Trees including
- Certificate Transparency framework
- a number of NoSQL systems like Apache Cassandra, Riak and DynamoDB.
The original purpose of hash trees was to make it possible to efficiently handle many Lamport one-time signatures. Each Lamport key can only be used to sign a single message, but combined with hash trees they can be used for many messages, becoming a fairly efficient digital signature scheme known as a Merkle signature scheme.