- A Merkle Tree allows computers on a network to verify individual records without having to review and compare versions of database.
- They do so by using cryptography that reveals record while also guaranteeing records database hasn’t been changed.
- First patented in 1979 by Ralph Markle. Markle Trees important key to database verification throughout the history of computers.
- Because of the distributed nature of the blockchain, secure and fast everyone on the network has ledger.
- It allows you to prove that two versions of a ledger are minimal computing power and network bandwidth.
- At the top of a hash tree, a top hash (or root hash or master hash).
- Before downloading a file on a p2p network, in most cases, hash is acquired from a trusted source, or site known good recommendations of files to download.
- When hash , the hash tree received from any non-trusted source, peers p2p network.
- Then, the received hash tree is checked against the trusted top hash, and if the hash tree or fake, another hash tree from another source tried until the program finds one that matches hash
How does it work?
- Transactions A,B,C,D.
- Hashed H(A),H(B),H(C).H(D)
- A Merkle Tree solves the problem of data by pairing transactions up to and hashing them together.
- H(A)+H(B) = H(AB) and
- H(C)+H(D) = H(CD)
- Each Bitcoin block has the Merkle root contains block header.
- To verify block content and consistency of multiple ledgers. One compare the Merkle Tree of both the block.
- Even inconsistency would vastly different Merkle roots the properties of a hash.
Cryptographic Hash Functions
Before we bandy Merkle trees, we need to get a better understanding of the cryptographic hash function.
A hash function is responsible for mapping any form of arbitrary data of any length to a fixed-sized affair. It’s a cryptographic function and hence is extensively used in cryptography.
The hash functions are effective and are known for their one property, i.e., the function can not be reversed. It’s a one-way function that’s designed to work this way only.
Hashing has multiple uses including
Train integrity checks and verification
There are many hash families out there including Message Direct (MD), Secure Hash Function (SHF), and RIPE Message Direct (RIPEMD).
Still, we will get the ensuing affair
, If we use a SHA256 hash algorithm and pass 101Blockchains as input.fbffd63a60374a31aa9811cbc80b577e23925a5874e86a17f712bab874f33ac9
To add it up, the crucial parcels of hash functions include
Can not be Reversed Engineered
- Hash trees verify any data stored, handled, and transferred in and between computers.
- These are hash-based cryptography.
- Hash trees the IPFS, Btrfsand ZFS file systems.