T he Ethash mining algorithm is the algorithm that makes the operation of the mining en Ethereum . An algorithm of high quality and that uses some very elaborate computer techniques to guarantee the greatest possible security.
Ethash is also known as Ethash-Dagger-Hashimoto, although certainly the current algorithm has changed so much that it might as well be given another name. But what does all this mean? doWhat is Dagger-Hashimoto and how is it related to Ethash? whatHow does it work ethash? What is your future?
Well, all these questions will be answered below in this new article from Bit2Me Academy.
What is Dagger-Hashimoto? The origin of Ethash
To understand how Ethash works, you first need to know What is it Dagger-Hashimoto. That is why, we will first explain this point to advance and understand this striking algorithm.
When we talk about Dagger-Hashimoto, we refer to a mining algorithm that served as the basis for the creation of Ethash. This algorithm sought to create a secure algorithm built on two pillars:
- Be resistant to mining ASIC.
- Highly efficient and easily verifiable by thin clients.
These two pillars are fundamental in the operation of Dagger-Hashimoto. The minds behind the design of this algorithm are Vitalik Buterin y Thaddeus Dryja, who devised the same between the years 2013 and 2014. As you can see, its name comes because the algorithm is actually the union of two different algorithms.
First of all, we have Dagger, an algorithm developed by Vitalik Buterin that uses directed acyclic graphs (DAG) to build a massive data structure. Initially this structure took up a little more than 1 Gb of storage, but currently it is around 4-5 GB. On this structure a series of memory calculations are executed that add a high level of work. This structure is what allows the mining process carried out by the Hashimoto algorithm.
Hashimoto For its part, it is an algorithm developed by Thaddeus Dryja, and aims to add ASIC resistance, and perform mining of hash. This is achieved by making it have a high consumption of RAM and this is a limitation to ASICs. Basically what Hashimoto does, is to take the generated DAG, add the network information about the difficulty, the transactions and generate a hash that identifies the block that is being mined.
By combining both algorithms, we obtain a single algorithm that allows us to design a mining system complex enough for ASIC miners to have problems implementing it efficiently. The structure is so advanced and secure that it was sought to be implemented as an alternative to Scrypt.
However, Dragger-Hashimoto had some flaws that caused its development and evolution to end up giving rise to Ethash.
How does the Ethash algorithm work?
Building on what was learned at Dagger-Hashimoto, the development team at Ethereum He then presented his Ethash algorithm. The basic operation of this algorithm is completely different from the original Dagger-Hashimoto, but the fundamental principles remain. So we have that Ethash works as follows:
- A calculated seed is created using the block headers up to the point where mining begins.
- This seed is then used to calculate and generate a 16 MB pseudorandom cache.
- This cache is then used to generate a data set of more than 4 GB (the DAG). This data set is semi-permanent and is updated every 30 thousand blocks. In this way, the DAG varies for each "mining season".
- Once the DAG is generated, mining begins. This process takes random values from the DAG and combines them using the data supplied by the network and the transactions to be verified.
- Finally verification is done with a process that regenerates specific parts of the dataset using the cache memory, speeding up this process.
This operation is the one currently running, and corresponds to version number 23 of the algorithm. Throughout the process the Keccak-256 and Keccak-512 functions are used, an algorithm from which the SHA-3 standard was derived.
Now surely you will wonder why so many revisions and changes? And the answer to this is that these updates respond to problem resolutions, vulnerabilities, optimizations and, of course, modifications to make work more complex for ASICs and more user-friendly. GPU, which is where the Ethereum community usually makes its biggest mining life.
Ethash algorithm features
All of the above guarantees that Ethash has unique working characteristics, among which we can mention:
- It is highly dependent on operations in RAM memory, consuming large amounts of bandwidth. This is a security measure against ASICs and also elementary for the proper functioning of Ethash. The operations required to build the DAG and the Ethash working cache are highly dependent on these features.
- The algorithm is GPU friendly. Surely you know that current graphics cards or GPUs have an immense capacity. In fact, moving graphics like those in today's games requires huge amounts of memory and unmatched parallel processing. This is a strength if you run mining using Ethash, because you can use the GPU memory to have the entire DAG in memory, along with the cache, and perform all the calculations in a high-speed workspace. As a result, you have the ability to mine much faster.
- Offers excellent verification capabilities for thin clients. With about 16 MB of RAM, it is possible to create a thin client that is able to verify transactions very easily and quickly. In addition to this, a thin client can be up and running and perform the verification process in as little as 30 seconds.
Keccak and SHA-3, how are they different?
Keccak and SHA-3 are two very similar hash functions, in fact, the principle they work on is the same, but applied differently, which gives different results. However, both are practically equivalent in security, speed and computing power necessary for their calculation.
So although both functions generate different hashes, the operating base and their security are practically equivalent.