In any conversation about Ethereum you may have heard about Ethash. This is the algorithm that makes Ethereum possible. That algorithm makes use of very advanced computing techniques that increase the level of security on the network.
Another way to call this algorithm is by the name Ethash-Dagger-Hashimoto. This was the name it adopted when it was created, however it has changed and evolved a lot since then. In this article we will see what it offers and how it works.
Although its full name is Ethash-Dagger-Hashimoto, we should note that Dagger-Hashimoto refers to the mining algorithm that served as the basis for the creation of the current Ethash. That algorithm was aimed at creating a secure mechanism based on the resistance to ASIC mining and the efficiency it brings by being highly verifiable by thin clients.
The creators of this algorithm are Vitalik Buterin and Thaddeus Dryja. Both developed this system between 2013 and 2014. This algorithm is based on two different algorithms, hence its compound name. The first, Dragger, is an algorithm developed by the same creator of Ethereum, Buterin. This algorithm makes use of directed acyclic graphs (DAG) in order to create a massive data structure.
At the beginning of its development, the structure of the algorithm occupied a space of approximately 1 Gb in storage, however, over the years its storage has been extended up to 4 Gb or 5 Gb. The structure of this algorithm allows the operation of the Hashimoto mining process, the algorithm we will talk about next.
Hashimoto is the second base algorithm of Ethash developed by Thaddeus Dryja with the aim of being able to add ASIC resilience to the system in which it is implemented, and also to carry out hash mining. All this is possible because the algorithm itself increases the RAM consumption and thus limits the ASICs.
From the union of the two algorithms comes another unique algorithm that offers the ability to design a new mining system so complex that ASIC miners cannot implement it effectively. In fact, its structure is so advanced that many developers are trying to implement it as an alternative option to Scrypt. However, Dragger-Hashimoto was not always what it is today. Like everything else, it presented several flaws that turned it into the current algorithm. Below we will see how it works.
The operation of Ethash is completely different from the basic operation of the algorithm on which it is based, Dragger-Hashimoto. However, there are some fundamental features that remain in place.
As the start of the algorithm, it creates a seed calculated through the block headers until the start of mining. Subsequently, the previous seed is used to compute and create a pseudo random cache with an exact size of 16 MB. Once created, this is used to create a data set that occupies more than 4 GB. This data is what we call “DAG“.
The DAG is updated every 30 thousand blocks varying for each mining season. The mining process starts with the creation of the DAG. During mining, random values are taken from the DAG and these are combined with data provided by the network and the rest of the transactions to be verified. For the final phase, verification is performed through a process that generates certain parts of the previous data set using the cache memory to accelerate the process.
To reach the current performance, Ethash has gone through 23 versions of its algorithm. However, there are aspects that have not changed, such as the use of the Keccak-256 and Keccak-512 functions. These are the algorithm from which what we know today as the SHA-3 standard was derived.
It is possible that when we see such a high number of updates, we may think that the developers are not satisfied or that the project is incomplete. However, each update corresponds to a solution of problems that the algorithm may present. The updates were carried out to improve, secure and fix the algorithm, but above all, to increase the difficulty of implementation in ASIC. In this way, an increasingly GPU friendly algorithm was created.
Like any computer system, Ethash has advantages and disadvantages that differentiate it from other algorithms. Below we will see the most important ones: