We are sure that you are already familiar with the basic concepts that relate to cryptocurrency mining, including: a proof of work algorithm, blocks, transaction fees, rewards, computing power, hash, and more. All this is currently relevant for the Ethereum network. But blockchain also uses an algorithm that allows ordinary computers to mine blocks. This is a modified version of the Dagger-Hashimoto algorithm and it is called Ethash.
Ethash is a hash algorithm used in Ethereum-based blockchain currencies. This is the successor to Dagger Hashimoto, designed to be ASIC resistant. The algorithm requires a large amount of memory, which does not allow specialized ASIC hardware to be an effective mining solution.
Ethash is a Proof of Work hash algorithm created specifically for Ethereum (ETH). Ethash is based on providing a large, temporary, randomly generated dataset that forms the DAG (part of the Dagger). It is designed to hash fast verification time in a slow environment with only a processor, but provides significant mining acceleration in the presence of a large amount of memory with high bandwidth.
Large memory requirements mean that large-scale miners get a relatively small superlinear advantage. The high throughput requirement means that the acceleration from storage on many ultrafast processors sharing the same memory offers few advantages over a single module.
This is important in the sense that mining the pool does not benefit the nodes performing the test, which prevents centralization.
How the Ethash algorithm works
The mining algorithm stimulates competition for the fastest time to solve a block known as hash rate. Specialized and very powerful computers, known as integrated circuits (ASICs), were developed specifically for mining bitcoins, pushing ordinary computers with a processor / GPU out of the game. Thanks to ASIC, the major hash power is centralized on large installations.
They raised complexity to a very high level, which means a lot of electricity and computing power is wasted. To counter this, Ethereum has developed the Ethash algorithm, which introduces memory rigidity as a basis for competition for miners. This means that the most important thing is to have memory on the computer, not speed.
This eliminates the need to purchase competitive mining installations. If mining requires a memory and a processor, then the best equipment to use is a regular computer, and, therefore, an ordinary PC with sufficient memory can compete on an equal footing with any other.
This memory requirement implies that large mining pools do not benefit from using their huge number of ASICs that share the same memory. This gives little benefit to the miners of the pool, thus contributing to greater decentralization.
The stages along which the algorithm goes are as follows:
- There is a seed that can be calculated for each block by scanning the block headers to this point.
- At the initial stage, a 16 MB pseudo-random cache can be computed, which is stored by small nodes.
- A 1 GB data set is generated from the cache with the property that each element in the data set depends on only a small number of cache elements. Full clients and miners store this data set, which grows linearly with time.
- Mining involves collecting random fragments of a data set and hashing them. Testing can be done with low memory, using a cache to regenerate certain necessary parts of the data set.
A large data set is updated once every 30,000 blocks, so the vast majority of miners read the data, rather than make changes to it.
Ethash uses DAG (oriented acyclic graph) to prove the algorithm of work. It is generated for each era, that is, every 30,000 blocks (125 hours, about 5.2 days). Creating a DAG is time consuming. If customers generate it only on demand, you can observe a long wait at each transition of eras, before the first block of a new era is found.
However, the DAG depends only on the block number, so it can and should be calculated in advance in order to avoid a long waiting time at each transition. If miners don’t cache packets in advance, the network may experience a huge delay with each transition of eras.
Please note that DAGs do not need to be generated for PoW verification, which allows testing both with low CPU utilization and with small memory.
The Ethash algorithm, like many other technologies, primarily seeks to reduce the amount of computing power needed for mining, as well as reduce the risk of centralization. To some extent, he succeeds, given that most of the forks of Ethereum use it as the main algorithm.
If we take into account the need for mining for the functioning of the blockchain ecosystem, the Ethash algorithm makes this process much more profitable and attractive.