- Bitcoin & Ordinals Guide
- Posts
- Bitcoin explained in 60 seconds - part #6
Bitcoin explained in 60 seconds - part #6
What is a Merkle tree?
read time 1 minute |
Merkle tree is a word you are going to hear regularly if you find yourself in crypto, Bitcoin or Ordinals space.
Before we explain what a Merkle tree is, you need to know what a (transaction) Hash is.
Read on to understand both topics.
➡️ Transaction Hash
A Bitcoin transaction is also represented as a hash, this is called a transaction hash. It is the process of transforming a string of any length into a string of a fixed length.
To give an example of this:
Input:
Mr.Insights transferred 2BTC to Elon Musk
Hash output:
0bbd1748f16d2da847698b77ef4f9966c0c79b126d675fee121a5fc5c97ce234
➡️ Merkle tree
The Merkle Tree takes its name from the mathematician Ralph Merkle. He discovered that you could represent a lot of information in a single hash.
The data of a transaction is stored on the blockchain by storing its hashes. The Merkle tree is one way of doing this and allows large amounts of data to be stored efficiently and securely. As the name suggests, this is a data structure that resembles a tree. The leaves of this tree contain hashes of data you want to store in the blockchain.
As shown here, transactions are made into their own hash, from these 4 hashes, 2 hashes are then made and finally these two are merged into 1 Top hash.
The Top Hash also called Merkel root or Root hash is the hash of all the underlying hashes. As such, it is the summary of all transactions stored in a block.