Ergo and the Autolykos Consensus Mechanism: Part I

Translation temporarily unavailable. Showing original English.
Ergo Platform

30 de maio de 2022

The following is an in-depth, technical breakdown of Ergo’s consensus mechanism, Autolykos. As this is a lengthy and detailed topic, we will publish it in segments over the next two weeks. For Part I, the author starts to break down the block mining pseudocode and guides us through the creation of “list R.”

Part I

Autolykos, the Ergo consensus mechanism, is one of the few asymmetric memory-hard, proof of work puzzles that is still ASIC resistant - thus ensuring that the blockchain is kept as decentralized as possible. Autolykos is based on the Equihash paper[1] and the birthday problem. To summarize, the miner is tasked to find k (=32) out of N elements, such that the hash of the sum of the elements is less than the target. The following pseudocode explains the mining process and this analysis will break down each line extensively since there are very few online resources that explain Autolykos in its entirety.

Autolykos Block Mining Pseudocode
Screenshot 2022-06-01 at 23.41.49.png

Before discussing the block mining procedure, the algorithm first requires a very large cyclic group G of prime order q with fixed generator g and identity element e. This prime group is used to return integers in Z/qZ during the Blake2b256-based hashing function.

Example cyclic group with generator z, identity element 1, order 6[2]
unnamed (1).png

We will not focus extensively on the cyclic group as it only covers a small segment of the PoW scheme. Now, let’s tackle Autolykos Block mining line by line.

Line 1 – Input h and m

The PoW begins with the two inputs: the block height h and the upcoming block header hash m. The block header hash is a hash of the block header components, such as the previous block header hash, merkle root, nonce, etc.

Line 2 – Calculate list R

Firstly, it is important to notice the H() notation in line 2. This notation calls the hashing function Algorithm 3. Algorithm 3 is a hash function based on Blake2b256 and it is used throughout Autolykos. Algorithm 3 states that if the Blake hash of the inputs is below 2256 (= 1664 = 0xFFFFFFFFFFFF86633A9E8F1256D61ED5325EBF2A4B4366BA0000000000000000), then hash.mod(q) is returned. If not, Algorithm 3 repeats until it reaches a numeric hash within the valid range. For reference, note that q is the prime order of group G, Blake2b256 hash outputs are 256 bits, 64 digits long, and Algorithm 3 will always return a numeric hash in Z/qZ.

Blake2b256 Based Hash function
Screenshot 2022-06-02 at 03.17.18.png

In line 2, the focus is the creation of list R. List R contains r values which are 31-byte numeric hashes created from integers in [0, N). r values are generated by takeright(31,H(j||h||M)). The variables are as follows:

  • j, integer in [0, N)
  • h, block height
  • M, 8kb of constant data - padding to slow down hash calculation

The section takeRight(31,H(…)) means that given H(…), a 32-byte Blake2b256 output, the 31 bytes on the right (i.e. in little endian (whereas other hash algorithms are bit endian)) are returned. In other words, the most significant byte, the byte farthest to the left, is dropped. As a result, each r value is the 31 least significant bytes derived from the 32-byte H(j||h||M)) output. For example, if j = 1, r1 = takeRight(31,H(1||h||M)).List R consists of N elements and can be generated for each block by incrementing j by 1 N-1 times. Since H(…) returns hash.mod(q), we can state that list R consists of r0, 1, 2, 3 … N-1 and list R ⊂ Z/qZ. As stated in the Autolykos v2 whitepaper[3], “N elements are derived from block height and constants, unlike Autolykos v1, so miners can recalculate block candidates easily now (only indexes are depending on them).” In other words, j is always in [0,N), N is determined by h, M is always constant, and h changes every block, the only variable a miner needs to compute list R is h.

List R is stored in RAM. In Autolykos, N = 226 (67,108,864 integers) is used in implementation for every block before 614400. Thus, the memory requirement for blocks before block 614400 is (226 * 31 bytes =) 2.08GB. N first increased on block 614400. Post block 614400, every 51200 blocks, N increases by 5%. In other words, the memory requirement of an Ergo miner increases by 5% every ~71 days. On block 4198400 the value of N becomes constant and equal 2,143,944,600[4]. Note that the last 2 values listed in the table should be 2,143,944,600 and not 2,147,387,550. After block 4198400, the storage requirement of list R will be (31 bytes * 2,143,944,600) = 66.46GB.

N elements based on block height
unnamed (3).png
N elements, Ethash vs. Autolykos

Autolykos is like Ethash in the sense that block height determines N elements to be stored in RAM. With Autolykos, block height determines N 31-byte numeric hashes to be stored. With Ethash, block height determines N 128B DAG pages to be stored. You might ask yourself, if an Ergo block occurs every 2 minutes, how are Ergo miners able to generate a 2GB+ dataset so quickly? Ethereum miners only regenerate the DAG every 100 hours because it takes so long… For an Ergo miner, the burden to compute list R is N instances of Algorithm 3; remember, each r value is computed as takeRight(31,H(j||h||M)). However, a GPU can do this very quickly GPUs generally have 32-wide or 64-wide multiprocessors meaning that 32 or 64 Algorithm 3 instances can be done simultaneously depending on the GPU. For example, a 32-wide GPU such as the RTX570 can fill list R in just a few seconds.

For Part II, we will pick up from here and continue the explanation of Autolykos v2. Stay tuned to Ergo’s social media channels for updates on Part II of this series.

[1] https://www.researchgate.net/publication/316904748_Equihash_Asymmetric_Proof-of-Work_Based_on_the_Generalized_Birthday_Problem
[2] https://en.wikipedia.org/wiki/Cyclic_group#/media/File:Cyclic_group.svg
[3] https://www.docdroid.net/mcoitvK/ergopow-pdf
[4] https://www.ergoforum.org/t/autolykos-v-2-details/480
[5] Credit to Wolf9466#9466 on Discord

Share post

Ergo Infrastructure DAO: Descentralizando a Espinha Dorsal do Ecossistema Ergo

Ergo Infrastructure DAO: Descentralizando a Espinha Dorsal do Ecossistema Ergo

A missão da Ergo sempre foi enraizada na descentralização, não apenas na camada de consenso, mas em toda a pilha.

Ergo Platform

13 de agosto de 2025

Mew Finance: Um Conjunto de Ferramentas DeFi Divertido para o Ecossistema Ergo

Mew Finance: Um Conjunto de Ferramentas DeFi Divertido para o Ecossistema Ergo

Mew Finance é um conjunto de aplicativos descentralizados na Blockchain Ergo.

Ergo Platform

12 de agosto de 2025

Lithos: Descentralizando a Mineração com Pools On-Chain

Lithos: Descentralizando a Mineração com Pools On-Chain

Lithos é um novo protocolo projetado para reformular como os pools de mineração funcionam, movendo-os para on-chain, dando aos min.

Ergo Platform

24 de julho de 2025

Sigma 6.0: Um Ergo Mais Inteligente e Flexível

Sigma 6.0: Um Ergo Mais Inteligente e Flexível

Sigma 6.0 é uma grande atualização proposta para a blockchain Ergo.

Ergo Platform

23 de julho de 2025

Moldando o Futuro de Rosen: Uma Chamada da Comunidade sobre Cinco Propostas Chave do Tesouro

Moldando o Futuro de Rosen: Uma Chamada da Comunidade sobre Cinco Propostas Chave do Tesouro

O co-fundador da Rosen, Armeanio, apresentou cinco novas propostas ao Tesouro de Rosen.

Ergo Platform

9 de julho de 2025

UTXO Estendido da Ergo e a Ascensão da Inteligência Econômica Artificial

UTXO Estendido da Ergo e a Ascensão da Inteligência Econômica Artificial

Uma Visão Prática para Agentes Econômicos Autônomos Agentes econômicos autônomos na blockchain da Ergo realizam trabalho útil em .

Ergo Platform

12 de maio de 2025

ErgoHACK X: Inteligência Artificial na Blockchain Ergo

ErgoHACK X: Inteligência Artificial na Blockchain Ergo

Celebrando uma Década de Inovação Descentralizada Participe do 10º aniversário do ErgoHACK e esteja na vanguarda da revolução da I.

Ergo Platform

10 de abril de 2025

Ergo Pulse com Charles Hoskinson

Ergo Pulse com Charles Hoskinson

“Quando olhamos para as coisas que Alex tem feito, a equipe tem feito e a comunidade tem feito, eles são logicamente consistentes .

Plataforma Ergo

13 de abril de 2022

Mais novo mercado de NFTs em Ergo está ganhando a atenção dos Ergonautas

Mais novo mercado de NFTs em Ergo está ganhando a atenção dos Ergonautas

Em Outubro de 2020, NFTs na blockchain Ergo foram lançados.

Plataforma Ergo

7 de abril de 2022

NIPoPoWs em Ergo: Inovações em Blockchain

NIPoPoWs em Ergo: Inovações em Blockchain

A blockchain Ergo está rapidamente se tornando conhecida dentro do espaço cripto como uma líder em desenvolvimento e inovação em b.

Plataforma Ergo

1 de abril de 2022

Prova de Trabalho, Energia e Ergo

Prova de Trabalho, Energia e Ergo

Introdução Prova de Trabalho (PoW, em Inglês) foi descrita no artigo original de Bitcoin como sendo composta de duas partes.

Plataforma Ergo

29 de março de 2022

Armazenando Ergo: SAFEW

Armazenando Ergo: SAFEW

Neste artigo, continuamos nossa série de guias para configurar e usar uma das muitas novas carteiras Ergo.

Plataforma Ergo

25 de março de 2022

Minerando Ergo no Windows

Minerando Ergo no Windows

Minerar Ergo como parte de uma pool de mineração é fácil, particularmente no Windows.

Plataforma Ergo

17 de março de 2022

What is a DAO (Decentralized Autonomous Organization)?

What is a DAO (Decentralized Autonomous Organization)?

Introduction A decentralized autonomous organization (DAO) is a new type of cooperative.

Ergo Platform

15 de março de 2022

Instruções: Cunhando um Token Não-Fungível (NFT) na Blockchain Ergo

Instruções: Cunhando um Token Não-Fungível (NFT) na Blockchain Ergo

O que é um NFT? Qualquer unidade de uma moeda corrente, como por exemplo o dólar estadunidense, é indistinguível de qualquer outr.

Plataforma Ergo

8 de março de 2022

Blockchain e a Motivação para Ergo

Blockchain e a Motivação para Ergo

Desde o nascimento de Bitcoin, tecnologia blockchain tem sofrido enormes avanços.

Plataforma Ergo

3 de março de 2022

Resultados do ErgoHack III

Resultados do ErgoHack III

Após um bem-sucedido ErgoHack III, o júri tomou sua decisão final! Há tantos projetos maravilhosos que participaram neste último.

Fundação Ergo

1 de março de 2022

A Adoção de Moedas Estáveis está no Horizonte?

A Adoção de Moedas Estáveis está no Horizonte?

Hoje, moedas estáveis lastreadas ao dólar americano (USD) somam quase U$185 bilhões de valor de mercado - um aumento de 500% des.

Plataforma Ergo

24 de fevereiro de 2022

DeFi em Ergo: Taxas usando Tokens Personalizados

DeFi em Ergo: Taxas usando Tokens Personalizados

Moedas de infraestrutura são importantes pois precisamos delas para pagas taxas de transações quando usamos sistemas financeiros.

Plataforma Ergo

22 de fevereiro de 2022

Explicativo Ergo: Aluguel de Armazenamento

Explicativo Ergo: Aluguel de Armazenamento

Resumo do Artigo: Aluguel de Armazenamento é uma taxa por armazenamento de longo prazo na blockchain Ergo.

Plataforma Ergo

18 de fevereiro de 2022

Uma Introdução a Privacidade e Segurança em Blockchain

Uma Introdução a Privacidade e Segurança em Blockchain

Depois que o primeiro artigo científico emergiu na internet em 2008, a tecnologia blockchain evoluiu tremendamente.

Plataforma Ergo

17 de fevereiro de 2022