Tutto sull’algoritmo Ethash

Tiempo de lectura: 4 minutos

In qualsiasi conversazione su Ethereum potresti aver sentito parlare di Ethash. Questo è l’algoritmo che rende possibile Ethereum. Tale algoritmo utilizza tecniche di elaborazione molto avanzate che aumentano il livello di sicurezza della rete.

Un altro modo per chiamare questo algoritmo è con il nome Ethash-Dagger-Hashimoto. Questo era il nome che ha adottato quando è stato creato, tuttavia da allora è cambiato e si è evoluto molto. In questo articolo vedremo cosa offre e come funziona.

Sebbene il suo nome completo sia Ethash-Dagger-Hashimoto, bisogna notare che Dagger-Hashimoto si riferisce all’algoritmo di mining che è servito come base per la creazione dell’attuale Ethash. Tale algoritmo mirava a creare un meccanismo sicuro basato sulla resistenza al mining ASIC e sull’efficienza che apporta essendo altamente verificabile dai thin client.

 

 

L’Origine di Ethash

I creatori di questo algoritmo sono Vitalik Buterin e Thaddeus Dryja. Entrambi svilupparano questo sistema tra il 2013 e il 2014. Questo algoritmo si basa su due diversi algoritmi, per questo il nome composto. Il primo, Dragger, è un algoritmo sviluppato dallo stesso creatore di Ethereum, Buterin. Questo algoritmo utilizza grafici aciclici diretti (DAG) per creare una struttura dati massiccia.

All’inizio del suo sviluppo, la struttura dell’algoritmo occupava uno spazio di storage di circa 1 Gb, tuttavia negli anni il suo storage è stato esteso fino a 4 Gb o 5 Gb. La struttura di questo algoritmo consente il funzionamento del processo di mining di Hashimoto, l’algoritmo di cui parleremo in seguito.

Hashimoto è il secondo algoritmo di base di Ethash sviluppato da Thaddeus Dryja con l’intento di essere in grado di aggiungere resilienza ASIC al sistema in cui è iutilizzato, e anche per effettuare l’hash mining. Tutto questo è possibile perché l’algoritmo stesso aumenta il consumo di RAM e quindi limita gli ASIC.

Dall’unione dei due algoritmi ne è nato uno unico, che offre la possibilità di progettare un nuovo sistema di mining così complesso che i miners di ASIC non possono implementarlo in modo efficace. In effetti, la sua struttura è così avanzata che molti sviluppatori stanno cercando di implementarla come opzione a Scrypt.

Tuttavia, Dragger-Hashimoto non è sempre stato quello che è oggi. Come tutto il resto, presentava diversi difetti che lo hanno trasformato nell’attuale algoritmo. Di seguito vedremo come funziona.

Qué-es-Ethash

Come funziona Ethash?

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.

Qué-es-Ethash

Advantages and disadvantages

Like any computer system, Ethash has advantages and disadvantages that differentiate it from other algorithms. Below we will see the most important ones:

Advantages:

  • Easy to implement. Ethash is a simple, secure and above all practical algorithm.
  • Speed. By using the DAG structure in memory in addition to the Keccak function and the use of cache, Ethash becomes one of the most efficient algorithms in terms of block production. Thanks to this, the Ethereum network uses a block production time adaptable to the requirements of the network.
  • Verification capacity. One of the advantages over other algorithms is that with only 16 MB of RAM we can create a thin client with the ability to verify transactions quickly and easily. Such a client could carry out the verification process in as little as 30 seconds.

Disadvantages:

  • ASIC resistance. One of the advantages of Ethash was broken in 2018 due to the miner created by Bitmain that mined with Ethash.
  • Excessive memory consumption. This makes it difficult to mine on computers with lower capacity. Its excessive consumption comes from its operation highly dependent on RAM operations that consume large amounts of bandwidth. Although it is a protective measure against ASICs, it is also necessary to maintain proper system operation. Thanks to the cache, more efficient mining can be performed using the space for performing calculations.
  • The difficulty of this algorithm is so scalable that it causes high mining difficulty for Ethereum network miners thus risking the security of its blockchain.

lascia un commento
L'indirizzo email non verrà pubblicato. I campi richiesti sono contrassegnati *