New Webchain Mining algorithm. How does it work?

9 abr. 2019

We recently changed our PoW algorithm from cryptonight-webchain to lyra2-webchain. In this post, we’ll describe how it works and what are differences between these two algorithms.


The main goal of introducing the new algorithm was to decrease differences in hash rate between high-end CPUs or GPUs and lower-end CPUs. To achieve this, we decided to use an algorithm that is not CPU bound, but memory bound. Each lyra2-webchain thread uses 6MB matrix (the equivalent of cryptonight’s scratchpad). It doesn’t fit into currently manufactured CPUs cache so during hash calculation it uses RAM heavily. It has two main consequences: 1) CPU cache doesn’t limit threads count anymore, 2) RAM throughput has a high impact on the hash rate.


Due to these facts, increasing threads above certain value won’t give any gain in hash rate. For example, let’s assume we have 8 cores CPU and each thread uses 25% of RAM throughput. With 4 threads we’re using 100% of throughput so increasing threads further won’t increase hash rate. With a higher number of threads, each thread will become slower due to waiting for data from RAM. So to determine optimal threads count, you’ll need to try different count and use the lowest that gives a maximum hash rate.


In addition, new PoW algorithm doesn’t require AESNI extension to run at full speed. Older CPUs or architectures other than x86 will gain on this change.


Part of you can see hash rate decrease but due to block difficulty decrease, earnings should stay on the same level or even increase.


Purpose of all these changes is to implement egalitarian distribution of coins as we described in our whitepaper.