5

I've looked at the wiki in search of how the information about Ethash algorithm but I did not find the answer.

Where can I find detailed information about it or can someone explain it?

2 Answers 2

4

The general route that the algorithm takes is as follows:

  1. There exists a seed which can be computed for each block by scanning through the block headers up until that point.
  2. From the seed, one can compute a 16 MB pseudorandom cache. Light clients store the cache.
  3. From the cache, we can generate a 1 GB dataset, with the property that each item in the dataset depends on only a small number of items from the cache. Full clients and miners store the dataset. The dataset grows linearly with time.
  4. Mining involves grabbing random slices of the dataset and hashing them together. Verification can be done with low memory by using the cache to regenerate the specific pieces of the dataset that you need, so you only need to store the cache.

    The large dataset is updated once every 30000 blocks, so the vast majority of a miner's effort will be reading the dataset, not making changes to it.

See Ethash-Design-Rationale for design rationale considerations for this algorithm.


More sources:

Page number 15 of Yellow Paper.

Ethash in Ethereum wiki on github.

2

From here

Ethash is the name of the PoW algorithm used in Ethereum. Originally, this was proposed as the Dagger-Hashimoto algorithm, but much has changed since the first implementation, and the PoW algorithm has now evolved into what's known as Ethash.

Similar to Bitcoin, the core idea behind mining is to find a nonce (a random arbitrary number), which, once concatenated with the block header and hashed, results in a number that is lower than the current network difficulty level. Initially, the difficulty was low when Ethereum was new, and even CPU and single GPU mining was profitable to a certain extent, but that is no longer the case. Now, only either pooled mining or large GPU mining farms are used for profitable mining purposes.

Ethash is a memory-hard algorithm, which makes it difficult to be implemented on specialized hardware. As in Bitcoin, ASICs have been developed, which have resulted in mining centralization over the years, but memory-hard PoW algorithms are one way of thwarting this threat, and Ethereum implements Ethash to discourage ASIC development for mining. Ethash is a memory-hard algorithm and developing ASICs with large and fast memories is not feasible. This algorithm requires subsets of a fixed resource called Directed Acyclic Graph (DAG) to be chosen, depending on the nonce and block headers.

DAG is a large, pseudo-randomly generated dataset. This graph is represented as a matrix in the DAG file created during the Ethereum mining process. The Ethash algorithm expects the DAG as a two-dimensional array of 32-bit unsigned integers.

Mining can only start when DAG is completely generated the first time a mining node starts. This DAG is used as a seed by the algorithm called Ethash. According to current specifications, the epoch time is defined as 30,000 blocks, or roughly 6 days. The Ethash algorithm requires a DAG file to work. A DAG file is generated every epoch, which is 30,000 blocks. DAG grows linearly as the chain size grows. Currently, the DAG size is around 3.5 GB (as of block 9325164) and epoch number 310.

The protocol works as follows:

  1. First, the header from the previous block and a 32-bit random nonce is combined using Keccak-256.
  2. This produces a 128-bit structure called mix .
  3. mix determines which data is to be picked up from the DAG.
  4. Once the data is fetched from the DAG, it is "mixed" with the mix to produce the next mix , which is then again used to fetch data from the DAG and subsequently mixed. This process is repeated 64 times.
  5. Eventually, the 64th mix is run through a digest function to produce a 32-byte sequence.
  6. This sequence is compared with the difficulty target. If it is less than the difficulty target, the nonce is valid, and the PoW is solved. As a result, the block is mined. If not, then the algorithm repeats with a new nonce.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.