Overview
In cryptography and computer science, a hash tree or Merkle tree is a tree in which every "leaf" node is labelled with the cryptographic hash of a data block, and every node that is not a leaf (called a branch, inner node, or inode) is labelled with the cryptographic hash of the labels of its child nodes. A hash tree allows efficient and secure verification of the contents of a large data structure. A hash tree is a generalization of a hash list and a hash chain.
Demonstrating that a leaf node is a part of a given binary hash tree requires computing a number of hashes proportional to the logarithm of the number of leaf nodes in the tree. Conversely, in a hash list, the number is proportional to the number of leaf nodes itself. A Merkle tree is therefore an efficient example of a cryptographic commitment scheme, in which the root of the tree is seen as a commitment and leaf nodes may be revealed and proven to be part of the original commitment.
The concept of a hash tree is named after Ralph Merkle, who patented it in 1979.
5 sources for this section
- 1Merkle tree — Wikipedia, revision 1375083916
- 2Becker, Georg (2008-07-18). "Merkle Signature Schemes, Merkle Trees and Their Cryptanalysis" (PDF). Ruhr-Universität Bochum. p. 16. Archived from the original (PDF) on 2014-12-22. Retrieved 2013-11-20.
- 3"Handbook of Applied Cryptography". cacr.uwaterloo.ca. Section 13.4.1. Retrieved 2024-03-07.
- 4Merkle, R. C. (1988). "A Digital Signature Based on a Conventional Encryption Function". Advances in Cryptology – CRYPTO '87. Lecture Notes in Computer Science. Vol. 293. pp. 369–378. doi:10.1007/3-540-48184-2_32. ISBN 978-3-540-18796-7.
- 5US patent 4309569
Uses
Hash trees can be used to verify any kind of data stored, handled and transferred in and between computers. They can help ensure 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.
1 source for this section
Overview
A hash tree is a tree of hashes in which the leaves (i.e., leaf nodes, sometimes also called "leafs") are hashes of data blocks in, for instance, a file or set of files. Nodes farther up in the tree are the hashes of their respective children. For example, in the above picture hash 0 is the result of hashing the concatenation of hash 0-0 and hash 0-1. That is, hash 0 = hash( hash 0-0 + hash 0-1 ) where "+" denotes concatenation.
Most hash tree implementations are binary (two child nodes under each node) but they can just as well use many more child nodes under each node.
Usually, a cryptographic hash function such as SHA-2 is used for the hashing. If the hash tree only needs to protect against unintentional damage, non-cryptographic checksums such as CRCs can be used.
1 source for this section
Tiger tree hash
The Tiger tree hash is a widely used form of hash tree. It uses a binary hash tree (two child nodes under each node), usually has a data block size of 1024 bytes and uses the Tiger hash.
Tiger tree hashes are used in Gnutella, Gnutella2, and Direct Connect P2P file sharing protocols and in file sharing applications such as Phex, BearShare, LimeWire, Shareaza, DC++ and gtk-gnutella.
7 sources for this section
- 1Merkle tree — Wikipedia, revision 1375083916
- 6Chapweske, J.; Mohr, G. (March 4, 2003). "Tree Hash EXchange format (THEX)". Archived from the original on 2009-08-03.
- 7"tigertree.c File Reference". Gtk-Gnutella. Retrieved 23 September 2018.
- 8"Audit: P2P DirectConnect Application". Symantec. Archived from the original on January 29, 2015. Retrieved 23 September 2018.
- 9Arne Babenhauserheide (7 Jan 2007). "Phex 3.0.0 released". Phex. Retrieved 23 September 2018.
- 10"DC++'s feature list". dcplusplus.sourceforge.net.
- 11"Development". GTK-Gnutella. Retrieved 23 September 2018.
The source notesEvidence & further reading11 sources
- Merkle tree — Wikipedia, revision 1375083916 Wikipedia contributors · Reference source · accessed 2026-09-22
- Becker, Georg (2008-07-18). "Merkle Signature Schemes, Merkle Trees and Their Cryptanalysis" (PDF). Ruhr-Universität Bochum. p. 16. Archived from the original (PDF) on 2014-12-22. Retrieved 2013-11-20. emsec.rub.de · Reference source · link imported 2026-09-22
- "Handbook of Applied Cryptography". cacr.uwaterloo.ca. Section 13.4.1. Retrieved 2024-03-07. cacr.uwaterloo.ca · Reference source · link imported 2026-09-22
- Merkle, R. C. (1988). "A Digital Signature Based on a Conventional Encryption Function". Advances in Cryptology – CRYPTO '87. Lecture Notes in Computer Science. Vol. 293. pp. 369–378. doi:10.1007/3-540-48184-2_32. ISBN 978-3-540-18796-7. doi.org · Reference source · link imported 2026-09-22
- US patent 4309569 worldwide.espacenet.com · Reference source · link imported 2026-09-22
- Chapweske, J.; Mohr, G. (March 4, 2003). "Tree Hash EXchange format (THEX)". Archived from the original on 2009-08-03. web.archive.org · Reference source · link imported 2026-09-22
- "tigertree.c File Reference". Gtk-Gnutella. Retrieved 23 September 2018. gtk-gnutella.sourceforge.net · Reference source · link imported 2026-09-22
- "Audit: P2P DirectConnect Application". Symantec. Archived from the original on January 29, 2015. Retrieved 23 September 2018.