Merkle trees allows efficient data verification across a network.
In cryptography and computer science, a hash tree or Merkle tree is a tree in which every leaf node is labelled with the hash of a data block and every non-leaf node is labelled with the cryptographic hash of the labels of its child nodes.
Decentralized networks operate without relying on a central source of truth, and instead rely on group coordination in order to establish a shared state. Trust is distributed among participants, so to have confidence that each participant is telling the truth, there must be a mechanism for guaranteeing that participants have not accidentally corrupted or intentionally tampered with the system’s state.
Hence, the Merkle tree: a data structure that was patented in 1979, and because of its unique content validating and performance qualities, has since become the backbone of decentralized software like Git, BitTorrent, ZFS, and Ethereum.
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.