Skip to content

Latest commit

 

History

History
32 lines (18 loc) · 6.95 KB

x16rs_algorithm_description.md

File metadata and controls

32 lines (18 loc) · 6.95 KB

X16RS algorithm design and GPU code explanation

The X16RS algorithm is a strong random proof of work algorithm originally designed and invented by Hacash. It is improved based on X16S and has two design goals:

  1. The new algorithm can only use CPU mining in the initial stage, so that the existing GPU graphics mining kits and ASIC professional equipment cannot be used directly, reducing the concentration of currency output distribution, and allowing early individual participants to use consumer-grade general-purpose computing equipment. Participate in currency distribution;
  2. Prevent the emergence of ASIC professional equipment for a certain period (such as 5-10 years) or longer, delay the concentration of mining as much as possible, and make the currency distribution more fair and decentralized;

However, Hacash does not believe that it is reasonable and effective to permanently ban the emergence of ASIC devices by constantly changing the mining algorithm like Monero Coin. Changing the mining algorithm will introduce serious centralization decision-making problems, making the information on mining costs unable to operate in a market mechanism and remain stable. Long-term capital will not be invested due to the inability to calculate returns. The entire network will continue to face severe pressure from technology and community division. . In essence, when the difficulty of mining computing power rises to a certain level, even if individual users use consumer-grade equipment and household electricity to participate in mining, it is completely unprofitable, because this is completely unable to compete with the scale advantages of large-scale professional CPU mines. . Therefore, Hacash believes that the design of the mining algorithm only needs to ensure the fair participation of individuals and the decentralized distribution of currency in the early stages of the project. After the community size and the difficulty of computing power reach a certain level, the mining business will become professional in any case. At the stage of globalization and scale, continuing to fight against this economic law is futile or even completely harmful.

The specific improvements of X16RS compared to the X16R algorithm are as follows:

  1. Algorithm rounds are not always 16 rounds, but start from round 1, add 1 round every 50,000 blocks (about half a year), and continue to increase in about 8 years, until it finally reaches 16 rounds and then fixed at 16 rounds;
  2. The algorithm selected in each round is not predetermined, but the remainder is calculated from the last digit of the hash value of the previous round and 16, and the number of the next round of algorithm is selected, so that the process of each operation is random and unpredictable to the greatest extent ;

The above two randomness improvements make it necessary for ASIC dedicated circuits to deal with condition selection bifurcation and uncertain number of cycles for many times. Circuit design faces huge hardware redundancy space and operating idle time. It is difficult to design and implement, and manufacturing costs are high. , The operating efficiency is low, so that its cost and efficiency cannot easily reach the cost and efficiency of general-purpose CPU mass production. The dedicated hardware circuit chip for the X16RS algorithm is economically infeasible, and it is difficult to appear. Although the design is difficult to implement and the operating efficiency is low, this does not completely rule out the possibility of ASICs appearing. Even if professional hardware mining equipment finally appears (for example, 10 years later), Hacash does not plan to modify the algorithm to prevent this situation. The reasons have been mentioned above.

This "anti-ASIC algorithm" also brings another benefit, that is, it greatly reduces the mining efficiency gap between GPU graphics card concurrent computing and CPU multi-core computing. Under the same circumstances, the efficiency of using GPU devices to execute mining algorithms will not be several orders of magnitude higher than the computational efficiency of CPUs, or even worse than the power consumption cost of certain multi-core computing optimization CPUs. The reason is that the code with strong randomness and many logical judgment branches is not suitable for the hardware design characteristics of GPU "simple logic and large concurrency".

Because this algorithm design contains a lot of randomness, the sha3 algorithm selected for each hash calculation is different, and the calculation time required for each sha3 algorithm is also very different, and its external performance is power statistics unstable, it is very unstable. and there is often a difference of about ten times in the calculation power statistics before and after the two times. This highly random side effect brings some difficulty to the computing power of the statistical equipment. You can only estimate an approximate value based on the long-term computing power statistics, but it cannot be stable and accurate. The lower the computing power, the higher the degree of inaccuracy and instability of such statistics.

In general, according to the test of a limited number of equipment, unless the code of GPU graphics operation is very in-depth and professionally optimized to fit the underlying hardware, there is no significant difference between its mining efficiency and multi-core CPU, even on the same equipment and energy consumption. Under the cost, it is not as efficient as the multi-core, multi-channel CPU platform. In addition, for the time being, there is no possibility of the emergence of ASIC devices.

Due to the diversity of graphics computing hardware, software platforms, target codes, and compilation environments, different hardware and platforms require targeted coding and deployment. To complete a complete set of graphics mining solutions that adapt to different platforms and environments will inevitably cost Huge development time and energy. Since Hacash still has many other more important and core features that need to be designed and developed, we do not intend to do comprehensive and in-depth development, testing and optimization on GPU graphics mining software. This work will depend on the contributions of the open source community or the R&D investment of professional/commercial mining organizations.

We provide a basic GPU computing code for the OpenCL platform, which is modified from the existing X16R graphics card algorithm. After a simple test, it can run correctly. But this does not mean that all graphics card devices and platforms can use this set of codes to run, nor does it mean that using this set of GPU codes can achieve higher mining efficiency than CPUs. Mining is a professional matter, and its efficiency depends on energy costs and R&D investment.

The relevant code has been submitted to Github for open source: