All the cryptocurrencies which demand hardware mining have adopted the POW consensus mechanism now. Before mining, we must choose the type of cryptocurrency first. Since the cryptocurrencies to be mined adopt different POW encryption algorithms, they need different mining algorithms as well as different requirements on corresponding miners.
The POW encryption system is a hash function by nature. The Hash algorithm is a very fundamental and important technology in the field of information technology. It can map binary values of any length (plaintext) to shorter fixed-length binary values (hash values), and it’s difficult to map different plaintexts to the same hash value.
Here in this article, some algorithms adopted by the mainstream cryptocurrencies will be introduced as follows.
Bitcoin – SHA256 Algorithm
The well-known Bitcoin adopts the SHA256 algorithm. The mining workers process the transaction data while performing hash calculation to obtain a valid hash value. Then, they publish the blockchains they had packaged to be confirmed by multiple parties, so that the blocks will be announced to have been generated and connected to the blockchain, and other mining workers will continue to have next block packaged with hash calculation.
Mining is the process of non-stop hash calculation. Bitcoin sacrifices some final consistency through hash calculation (because of generation of forks, such as BCH separated from BTC) and it also needs to wait for multiple confirmations. However, such a simple and violent approach ensures the legitimacy of the whole blockchain system and maximizes the robustness of the blockchain system. Even if only one node is active in the whole network, the blockchain system will continue to run. Finally, the POW will fully improve the security of the blockchain system.
Up to now, since the hash calculation of Bitcoin only uses the SHA256 algorithm, a large number of ASIC mining machines were born. The chip was also originally designed to perform SHA256 hash calculation. Individuals will no longer rely on the computing power of the CPU or GPU to carry out mining.
Ethereum – ethash algorithm
The general flow adopted by the algorithm is listed as follows:
- Once there’s a seed, every block can be calculated based on the height from the block to that point.
- Based on the seed, a 16 MB pseudo-random cache can be calculated and used for the storage cache of light client.
- From the cache, a 1 GB data set can be generated, which means each item in the data set depends only on a small number of items in the cache. Complete customers and mining workers store the data set which will grow linearly with the time goes by.
Mining involves obtaining random slices of the data set and conducting hash calculation with them. Mining workers can regenerate the specific portion of the data set based on the cache so that the miners with low memory can conduct verification because verification can be done only by storage cache.
The complete data set is updated every 30,000 blocks, therefore what the most mining workers need to do is to read the data set instead of modifying it.
The high bandwidth requirement means the acceleration from the piled overspeed processing units which share the same memory will produce little benefit in each individual unit (Anti-ASIC by preventing the sharing memory of dedicated chips), therefore the Ethereum mining nowadays usually adopts GPU minder.
Litecoin – Scrypt Hash Algorithm
Scrypt is a kind of KDF algorithm. KDF stands for Key Derivation Function, which is mainly used to generate keys to prevent hackers from generating many keys to probe the passwords at low cost. The effect of Scrypt is just used in the nonce collision of Litecoin to prevent low-cost mining in farms.
The Scrypt algorithm will consume a lot of memory in operation and the hardware cost of the memory is relatively high, which makes it impossible for the pools to conducting mining at a low cost.
Rearrangement of combinations has always been the most common invention of human beings.
The series algorithm adopts a multi-round hash algorithm, which seems to be complicated, however, it’s very simple, that is, the 9 times of hash function on the input data, and the result of the previous round is used as the input of the following round. The 9 rounds of Hash use a total of six encryption algorithms, e.g., BLAKE, BMW, GROESTL, JH, KECCAK and SKEIN, which are recognized as safe hash algorithms with existing implementation codes.
The series algorithm is a kind of series mindset. So long as one of the algorithms has been cracked, the whole algorithm will be cracked. It’s just like a chain with interlocked rings. If one of the rings breaks, the whole chain will be broken into two parts.
Series and parallel always coexist. Heavycoin (HVC) made the first trial.
Details of HVC Algorithm:
- First run HEFTY1 (a Hash algorithm) on the input data to get the result d1
- Taking d1 as input, conduct SHA256, KECCAK512, GROESTL512 and BLAKE512 calculation successively to obtain outputs d2, d3, d4 and d5, respectively.
- The first 64 bits of d2-d5 are extracted separately as the final 256-bit hash result for the block ID after being confused.
The reason for a round of HEFTY1 hash first is that HEFTY1 calculation is extremely difficult and its performance against ASIC are far beyond the SCRYPT.
HVC extracts 64 bits from each of the aforesaid algorithms as the result after combination. In fact, the four algorithms are connected in parallel. If only one of the algorithms is cracked, only the 64 bits in it will be endangered and the whole cryptocurrency system is still safe unless all the four algorithms have been cracked.
The five algorithms only include the encryption algorithms adopted by the mainstream cryptocurrencies. Nowadays there’re hundreds of cryptocurrencies with various algorithms. As for the actual values of the cryptocurrency, it’s necessary to study it carefully before participating in the mining.