Data structure called Merkle tree allowing to implement address mapping and accounts creation in the Ethereum system is one the most crucial elements which maintains functioning and security of the network. But how effective is this register technology and is it possible to utilize more effective alternative of it? Let us consider the example of CREDITS platform where developers have abandoned Merkle trees.
What is the Merkle Tree?
To begin with, we will learn general principles of Merkle Tree functioning. Overall, massive data structures which hash large amount of data elements are called Merkle Tree. To simplify this procedure these elements are summed into separate blocks which will be hashed further. These new blocks are hashed again and it continues till we receive only one block as the output.
In practice, basic binary Merkle trees are applied most frequently, each block of it contains only 2 hashes. Nevertheless, what is the necessity of such a complicated procedure? Why we cannot sum all blocks immediately to obtain final root block?
The point is that step-by-step hash algorithm allows to use Merkle proof which is the following: we can take any source block and track all stages of his hashing in the whole tree. In this way, we can check that all hasing rules are abided and each block placed right. It is easy to imagine such algorithm to be applied for a massive database.
Assume that we have some archive which contains enormous amount of data. All of it is stored in the Merkle tree. The root of it must be in the public domain and authorized, for example, signed by lots of users or checked by large-scale computing capacities. So, requesting data about any cell of the archive user can call Merkle proof, making sure that a valid value is being recurrented. Similar scheme can be used for databases of any scale, independently from the quantity of elements stored.
Merkle Tree in the Ethereum network.
Each block of the Ethereum network uses not 1, but the whole 3 Merkle Tree. They are used for hashing 3 types of objects at the same time:
- Transactions fulfillment data and receipt
- Addresses status
Using such protocol in the Ethereum network allows users to receive answers for extremely important for financial operations questions:
1. Does precise transaction exist in precise block?
2. How many events of certain type have been performed by precise address for n period of time?
3. What is a balance of certain account currently?
4. Does a precise account really exist?
5. What outcome will be obtained after transaction fulfillment for certain smart-contract?
The answer for the question is being formed thanks to existence of Merkle Tree for transactions, the second — thanks to Merkle Tree for transactions fulfillment data, the third and the fourth thanks to Merkle Tree for addresses status.
The answer on the fifth question in above mentioned list is formed based on slightly more complicated scheme called Merkle proof of state change. It looks like this: server of the Ethereum system in the local mode forms forged block while fulfilling a transaction. The server is also requesting all necessary dataь for example, the balance of an account, the precise element of a smart-contract and e.t.c. The server itself answers on these requests, writing all data. The conditional report is created right-away after and forwarded to the client as a proof. Client himself performs the same procedures. Both proofs must match each other, if so, it is accepted.
Disadvantages of the Merkle Tree
Undoubtedly the Ethereum network is one the most influential in cryptocurrency infrastructure, among the networks capable of execution of a third-party code ( for example, smart-contract). Many other altcoins are trying to correspond to it in terms of technical solutions, including adoption of hash-function called Markle Tree.
But is it truly so perfect?
Doesn’t it create additional problems for cryptocurrency network functioning? Discuss it shortly. As practice proofs, applying Merkle Tree in Ethereum network has two significant disadvantages:
- For implementation of this technology large-scale computing capacity is necessary that leads to high electricity and constant equipment upgrading costs.
- Transaction slowing makes the system less scalable and less user friendly.
So, the exigency for more effective and productive solutions which will replace Merkle Tree appears. Currently, this technology is already can be considered atavism which is being mechanically adopted from platform to platform. The alternative has been found by developers of CREDITS. What is this alternative exactly and what are the advantages of it?
CREDITS alternative to Merkle Tree.
The developers of CREDITS project offer to left behind Merkle Tree by implementing modern technology of registry creation. It implies recording of transaction blocks hash-codes for adding them into list of candidates. In each record following information is stored:
- Node identification
- Time of transaction note
- Transaction direction — sender and recipient
- Type of debating and crediting
- Quantity of debited or credited units.
Availability of this information into each record and special algorithm for its perseverance ensures faster transaction processing and allows to decrease the probability of unsanctioned and illegitimate corrections of the registry. It also allows to exclude the probability of retrospective changes of some record as well.
All in all, abandoning Merkle Tree in CREDITS platform allows not only to resolve security issue, but to enhance the performance of the network itself as well. It one more time proofs the fact that Merkle Tree is not the essential element of cryptocurrency system, but atavism which is adopted by other projects due to absence of more technologically effective alternatives. You can get more technical details regarding the principle of work and registry creation of CREDITS platform at technical project description which is available on the official website.