What is Merkle Tree

Recently FTX’s bankrupt shocked the whole industry. Almost all top exchanges have announced their 100% proof of reserve. Different exchanges chose different approaches. Some chose Merkle Tree, some published their wallet address, while some chose the independent audit. So you must be curious about what is Merkle Tree.

Picol 100% Reserve Plan

Picol has been operating for more than 3 years, and keeping 100% reserve as our responsibility. We promise that we will never embezzle users’ funds and users can withdraw their coins at any time. This time Picol has chose the appraoch of Merkle Tree to prove our 100% reserve.

Explanation of Merkle Tree

Merkle Tree was invented by Ralph Merkle in 1979, which has been more than 40 years since it’s born. It’s a kind of algorithm based on zero-knowledge to let every single node to be able to verify if the whole data is trustable.

1. Hash algorithm

Before learning Merkle Tree, we need to understand what is the Hash algorithm. Hash algorithm is a mathematical function that garbles data and makes it unreadable. Hashing algorithms are one-way programs, so the text can’t be unscrambled and decoded by anyone else. Cryptocurrencies like Bitcoin also utilize hash algorithm. For example, you don’t know the private key if you know one’s Bitcoin address, while you can generate your address if you have the private key.

2. Generate Merkle Tree

After understanding hash algorithm, we can start to generate a Merkle Tree now. First of all, we need to generate a “leaf“ for every single user. These leaves contain the ID and assets data snapshot at a specific time. Picol uses the userid, the coins a user owns, and the balance of these coins as the basic data. According to these data, we calculate every basic data into a hashed value. Every user will have a hashed value, like Hash1, Hash2, Hash3, Hash4. Here we have the first layer of “branch“.

Then let’s generate the second layer of branch. Let’s combine the hash 1 and hash 2 together, and calculate the Hash12 for Hash1+Hash2. And also we will have Hash34 using the same method. That’s how we have the 2nd layer of branch.

If we keeps combining the hash values of the second branch, we will have a new layer of branch, with the new hash values like Hash1234.

At last, we will have only one hash value in the end. We call that value the “Hash Root“.

Here’s how we get a Merkle Tree from scratch.

Thanks for your support.

Picol team