A Merkle Tree is a method for storing data accurately and securely. This data structure is used with blockchain-based cryptocurrencies such as Bitcoin. The reason why it is called a “Merkle Tree” is because it was invented by a man named Ralph Merkle, and because the actual shape of a Merkle Tree vaguely resembles a tree.
Ralph Merkle is an American computer scientist who is known as one of the fathers of modern public key cryptography that is integral to cryptocurrencies. In addition to being know for the Merkle Tree, which is named after him, he is also known for Merkle’s Puzzles, and the Merkle-Hellman Knapsack Cryptosystem.
How do Merkle Trees work?
The Merkle tree is an ingenious invention, and it is a major part of the reason why cryptocurrencies like Bitcoin can function effectively. To understand how a Merkle Tree works, you need to first understand how a blockchain works. A blockchain is an open-source ledger that keeps track of every single transaction for a digital currency like Bitcoin.
Blockchains are so named because the “chain” (giant list) of transactions is comprised of “blocks,” which are smaller groups of transactions. To visualize this concept, consider this image:
[] – [] – [] – [] – [] – []
In the image above, you can see what appears to be blocks linked together by a chain. This is essentially how blockchain works. However, instead of small rectangles, the blocks on a blockchain are groups of transactions performed by currency users, and they are recorded for everyone to see on a public ledger, that is the blockchain.
Where Merkle Trees come in is by providing a structure for all transactions on an individual block to be organized well, and so that the authenticity of every transaction can be independently verified. Essentially, Merkle Trees are designed to help prevent fraud and to make it easy for people to tell that fake transactions are not occurring without having to download the entire Bitcoin blockchain.
On any given block on the Bitcoin blockchain, or on any other cryptocurrency’s blockchain, there may be hundreds, or even thousands of transactions. However, for the purpose of this article, imagine that there are only four. In such a case, a Merkle Tree for this block would look like this:
Source: https://brilliant.org/wiki/merkle-tree/
The bottom transactions are called leaves. The first step on forming the Merkle Tree is to get a “hash,” or transaction id for each leaf. This is done by miners who must find the answer to mathematical problem to create the hash. Once this is done, the next step is for the leaf hashes to be put into pairs and then hashed again. This creates the next level of the tree.
This process is then repeated all the way until there is only one hash at the top of the tree that represents all of the hashes that have come before it. The top hash is called the Merkle Root.
The result of Merkle Trees being formed is that every single transaction that takes place on a block is verified and identified through hashing. Each level of the tree can only be formed by the successful hashing of the former level (with the exception of the first level). Merkle Trees provide a beautiful structure to all of these transactions, and the layers of hashing prevent fraudulent transactions. This is because if a fraudulent transaction was attempted it would alter the Merkle Root, and everyone would be able to tell.
Why Are Merkle Trees So Important?
Merkle Trees are so important because they make it impossible for people to create fake transactions, and they radically speed up the time it takes to verify transactions. If Merkle Trees did not exist, and if multiple layers of hashes were not required, resulting in Merkle Roots, then it would be significantly easier for hackers to create fake transactions.
If fake transactions were to occur on blockchain-based digital currencies, then it could destroy the trust of the entire currency. After all, one of the main reasons why people choose to use blockchain currencies such as Bitcoin is because they trust that the blockchain is accurate, and that no fake transactions or units of currency are being created.
Preserving Trust in Cryptocurrencies
In other words, the Merkle Tree is of paramount importance for preserving trust for people who use digital currencies. It is ironic that a common criticism of Bitcoin and other blockchain-based cryptocurrencies are that they are not trustworthy. However, the truth is that a large amount of effort is put forth to make sure that the integrity of these currencies is preserved.
Mathematical and computer science breakthroughs the likes of which the world has never seen before, such as the Merkle Tree, help to make sure that these currencies are completely sound. Many people who recognized the value of this technology and who bought into cryptocurrencies such as Bitcoin or Ethereum early on, made substantial amounts of money.
Larger Significance
The fact that Merkle Trees help cryptocurrencies to be open-sourced, independently verifiable, secure, and highly accurate is increasingly making digital money such as Bitcoin a viable alternative to government backed, national fiat currencies. In some nations, such as Zimbabwe and Venezuela for example, where inflation is rampant due to excessive government money printing and political unrest, cryptocurrencies are becoming more and more heavily used.
In fact, in Zimbabwe, Bitcoin is so popular that it trades at a substantial premium: roughly $16,500. The current price of Bitcoin in America is currently around $11,000 (11/20/2017), which means that in some countries, it is trading at more than a 50% premium.
Better Than Government Backed Currencies?
In the future, more countries that face inflation due to excessive fiat money printing could see a similar increase in cryptocurrency interest. Fiat (paper) currencies that are essentially backed by nothing, do not use Merkle Trees and are subject to inflation any time the government behind them decides it wants to print money.
So, one could argue that the larger significance of the Merkle Tree is that it is one of the main reasons why cryptocurrencies are becoming more and more popular. In the next ten or twenty years, cryptocurrencies could gain market caps worth trillions of dollars, instead of just billions or hundreds of billions like they have today. If they do, the Merkle Tree will be one of the key reasons why.
However, not every nation is taking kindly to Bitcoin and other cryptocurrencies that rely on Merkle Tree technology. In fact, a number of prominent nations around the world have outlawed, or are taking steps towards making Bitcoin and other cryptocurrencies illegal. For example, Bitcoin is either illegal or extremely heavily regulated in China, Iceland, Vietnam, Bolivia, Krygestan, Ecuador, and a number of others.
In recent years, nations have been scrambling to solidify their positions on Bitcoin and other cryptocurrencies as they rise in popularity. Bitcoin and alt coins still remain legal and widely held in places such as the United States, the United Kingdom, Canada, and South Korea. If another major global economic crash occurs, such as the one in 2008, then cryptocurrencies could rise even further in popularity as people flood into them to preserve their purchasing power during economic uncertainty.
Final Thoughts
The Merkle Tree is a cryptographic invention that is essential for the health and efficient functioning of cryptocurrencies like Bitcoin. It arranges the data for transactions on the blockchain into well organized, verifiable units. It is one of the best and most effective means that the cryptocurrency community has for making sure that digital currencies continue to be legitimate and do not spiral into fraudulent chaos.
The Merkle Tree is also one of the key distinguishing factors between cryptocurrencies and fiat currencies that are frequently used in the digital space, such as the US Dollar. Fiat currencies do not have open-sourced blockchains used to verify transactions. This is largely because they are government regulated, and governments often create more units of currency out of thin air, thus defeating the purpose of a blockchain, or of a Merkle Tree system.
Merkle Trees are as elegant as they are functional. They were a true breakthrough technology, and the cryptocurrency world has benefitted immensely from it. Over time, when future generations reflect back on the creation of cryptocurrencies, they will likely view the Merkle Tree as one of the defining moments that led to cryptocurrencies going mainstream.
Of course, some people may argue that cryptocurrencies like Bitcoin are not mainstream yet, and they still might not become mainstream. However, if cryptocurrencies continue to progress and grow in popularity at their current rate, then it is almost inevitable that they will become mainstream.
Future Risks For Cryptocurrency
One major risk that they face however, is governments banning them as some have already done. Only time will tell exactly how governments will react once the market cap of cryptocurrencies begins to compete more seriously will that of the national fiat currencies such as the US Dollar, the Pound Sterling, the Indian Rupee, and others.
Throughout history, many fiat currencies have gone bust or experienced hyper-inflation. If national governments fear that this may happen to their currencies, then they could become more hostile to competitors such as other fiat currencies or even cryptocurrency.