CKB’s Hash Function Eaglesong: Built for the Mining Ecosystem
by Mohammad Musharraf
This is the first in a series of posts on crypto mining and the mining ecosystem
The cryptocurrency mining space is evolving rapidly. We have gone from mining cryptos using the computing power of our personal laptops to using high-end GPUs and ASIC mining equipment for higher mining profitability. As mining difficulty increases, mining hardware manufacturers are competing against each other with all they have to produce better cryptocurrency mining rigs. Before we delve deeper, let us understand what are hash functions and the concept of cryptocurrency mining.
Hash Functions in Terms of Cryptography
In the cryptocurrency mining space, hash functions are mathematical processes that can convert any length of alpha-numeric input into a unique output of fixed length — called the hash.
The below properties define the effectiveness of hash functions:
- they are irreversible functions; meaning that it is almost impossible to know the input even if somebody knows the output hash. This feature makes hashing a common practice for storing data securely.
- the slightest change in the input gives a drastically unique output. Hence, no two different inputs will ever have even closely similar outputs.
We need hash functions in blockchain and cryptography to securely write and store data onto the new blocks of the blockchain. They are a part of a blockchain’s algorithm that helps in confirming legit transactions through the process of cryptocurrency mining. But what is cryptocurrency mining? Let’s see.
Proof-of-Work and Cryptocurrency Mining
Proof-of-Work is the original blockchain consensus algorithm that approves new transactions on a blockchain and writes them on to new blocks. This algorithm relies solely on thousands of people — called nodes — spread across the globe to solve a mathematical puzzle that proves the legitimacy of every transaction and prevents double spend. This is where cryptocurrency mining kicks in. Crypto mining is a term coined to represent the process of using high computing power mining devices to solve mathematical puzzles. These mining deices generate random values at the fastest possible rate until one of the nodes finds a value whose hash is less than that of the target hash. The node who successfully finds the solution for a puzzle is rewarded with a set amount of cryptocurrency. Moving forward, let’s discuss what are ASICs and why we need them.
ASICs and Their Use
As we mentioned earlier, cryptocurrency mining keeps growing more demanding with time. Hence, we need more computational power to meet the needs of the proof-of-work consensus algorithms and continue confirming new transactions on blockchains.
Now, to produce more computational power means higher energy consumption and higher electricity bills. To ensure that miners can still benefit from cryptocurrency mining while having to pay electricity bills for running mining rigs, we need more energy-efficient and cost-effective hardware. Application-specific integrated circuits (ASICs) produce an exceptionally large amount of computing power while consuming a considerably low amount of energy. There are various categories of these ASIC mining chips depending on the hash-function they are configured for. This means that an ASIC chip can only mine those cryptocurrencies whose blockchain network is integrated with the same hash function that the chip is meant to work with. For example, an SHA-256-based ASIC mining hardware can mine all cryptocurrencies who have SHA-256 integrated blockchain, such as BTC, BCH, BSV, LTC, etc.
Eaglesong and Its Benefits
Due to the complexity of these hash-functions, mining chip manufacturers spend tremendous sums of money on research and development purposes. One of the most famous crypto mining chip manufacturer Bitmain had spent a total of $73 million in R&D as of 2018. Considering that cost, it’s easy to realize that small to medium scale manufacturers have a rare chance at competing with the behemoths in this industry. To make this easier for small scale manufacturers of mining hardware, we need a hash function that is novel, simple, and secure. And that’s exactly what Nervos aims to achieve with Common Knowledge Base’s (CKB) hash function dubbed Eaglesong.
Eaglesong is a hash function exclusively developed by Nervos CKB such that the algorithm stays highly simple yet secure. Nervos’s cryptography researcher Alan Szepieniec explains their approach stating: “We wanted a design that was novel enough to constitute a small step forward for science, but still close enough to existing designs to make a strong security argument possible and palatable.” By achieving simplicity in their hash function, Nervos marks the evolution of hash functions into more hardware friendly algorithms. Eaglesong would bring down the barrier to mining hardware manufacturing, which signifies two things:
- lower risk of failure posed due to technical challenges, and
- lower hardware R&D and production costs.
Despite its lower hardware threshold, Eaglesong maintains a neutral approach towards mining hardware.
This means that the hash function is compatible with high-end as well as average mining chips, giving cryptocurrency miners a better chance at earning higher rewards with lower expenditure. In simpler terms, Eaglesong combines all the design principles to make it a win-win ecosystem for manufacturers and miners alike.