-
Notifications
You must be signed in to change notification settings - Fork 114
Introduction of Mining Algorithms
Mining is the process of generating the new blocks, in which the records of current transactions are added to the record of past transactions. Miners use software that contribute their mining power to participate in the maintenance of a blockchain. In return, they obtain a certain amount of QKC per block, which is called coinbase reward. Like many other blockchain technologies, QuarkChain adopts the most widely used Proof of Work (PoW) consensus algorithm to secure the network.
A cryptographically-secure PoW is a costly and time-consuming process which is difficult to solve due to computation-intensity or memory intensity but easy for others to verify. For a block to be valid it must satisfy certain requirements and hash to a value less than the current target threshold. Reverting a block requires recreating all successor blocks and redoing the work they contain, which is costly.
By running a cluster, everyone can become a miner and participate in the mining process. The mining rewards are proportional to the number of blocks mined by each individual.
According to QuarkChain’s two-layered blockchain structure and Boson consensus, different shards can apply different consensus and mining algorithms. As part of the Boson consensus, each shard can adjust the difficulty dynamically to increase or decrease the hash power of each shard chain.
In order to fully test QuarkChain testnet 2.0, we adopt three different types of mining algorithms” Ethash, Double SHA256, and Qkchash, which is ASIC resistant and exclusively developed by QuarkChain founder Qi Zhou. These first two hash algorithms correspond to the mining algorithms dominantly conducted on the graphics processing unit (GPU) and application-specific integrated circuits (ASIC), respectively.
In order to fully verify QuarkChain testnet 2.0, we adopt three different types of mining algorithms, Ethash, Double Sha256, and QKchash, which is ASCI resistant and exclusively developed by CEO Qi Zhou. These three hash algorithms correspond to the mining algorithms dominantly conducted on the graphics card (GPU), application-specific integrated circuits (ASIC), and CPU, respectively.
Ethash is the PoW mining algorithm for Ethereum. It is the latest version of earlier Dagger-Hashimoto. Ethash is memory intensive, which makes it require large amounts of memory space in the process of mining. The efficiency of mining is basically independent of the CPU, but directly related to memory size and bandwidth. Therefore, by design, building Ethash ASIC is relatively difficult. Currently, the Ethash mining is dominantly conducted on the GPU machines.
Double Sha256 is the PoW mining algorithms for Bitcoin. It is computational intensive hash algorithm, which uses two SHA256 iterations for the block header. If the hash result is less than the specific target, the mining is successful. ASIC machine has been developed by Bitmain to find more hashes with less electrical power usage.
Originally, Bitcoin mining was conducted on the CPU of individual computers, with more cores and greater speed resulting in more profitability. After that, the mining process became dominated by GPU machines, then field-programmable gate arrays (FPGA) and finally ASIC, in a race to achieve more hash rates with less electrical power usage. Due to this arms race, it has become increasingly harder for prospective new miners to join. This raises centralization concerns because the manufacturers of the high-performance ASIC are concentrated in a small few.
To solve this, after extensive research and development, QuarkChain founder Dr. Qi Zhou has developed mining algorithm -- Qkchash, that is expected to be ASIC-resistant. The idea is motivated by the famous date structure orders-statistic tree. Based on this data structure, Qkchash requires to perform multiple search, insert, and delete operations in the tree, which tries to break the ASIC pipeline and makes the code execution path to be data-dependent and unpredictable besides random memory-access patterns. Thus, the mining efficiency is closely related to the CPU, which ensures the security of Boston consensus and encourges the mining decentralization.
Please refer to Dr. Qi’s paper for more details: https://medium.com/quarkchain-official/order-statistics-based-hash-algorithm-e40f108563c4
Numbers of Shards: 8
Cluster: According to the real-time online mining node
The corresponding mining algorithm is as follows:
Chains | Hash Algorithm | Target Block Time |
---|---|---|
Root Chain | Ethash with Guardian | 60 seconds |
4 shards | Ethash | 10 seconds |
2 shards | Double Sha256 | 10 seconds |
2 shards | Qkchash | 10 seconds |
(Read more about Ethash with Guardian: https://github.com/QuarkChain/pyquarkchain/wiki/Ethash-with-Guardian)
We will provide cluster software and the demo implementation of CPU mining to the public. Miners are able to arbitrarily select one shard or multiple shards to mine according to the mining difficulty and rewards of different shards. GPU / ASIC mining is allowed if the public manages to get it working with the current testnet. With the upgrade of our testnet, we will further provide the corresponding GPU / ASIC software. QuarkChain's two-layered blockchain structure, new P2P mode, and Boson consensus algorithm are expected tobe fully tested and verified in the QuarkChain testnet 2.0.
Official Website: https://www.quarkchain.io/
Discord Developer Community: https://discord.me/quarkchain