Understanding Monero’s Fair Mining Algorithm RandomX

Understanding Monero’s Fair Mining Algorithm RandomX

Author: Pan Zhixiong

Source: Lianwen

As professional mining equipment has invaded cryptocurrency and blockchain platforms, more and more people are beginning to worry that the so-called "decentralization" is in jeopardy. For example, in Bitcoin, which has the largest number of users, no one uses general-purpose CPUs and GPUs to participate in network consensus because the cost far exceeds the benefits. Some projects are trying to develop more general PoW algorithms to allow more people to participate. For example, the Monero project, which has always been at the forefront of developing algorithms to resist ASIC mining, has just carried out a hard fork to upgrade the PoW algorithm. In the future, only a modern CPU and at least 2GB of memory will be needed to participate in mining fairly.

This hard fork upgrade was activated at block height 1,978,433, which is about 3 am on December 1st. Monero will switch the proof-of-work algorithm to RandomX to replace the original CryptoNight algorithm, weaken the impact of dedicated mining equipment ASIC on network computing power and optimize CPU mining. In addition, this version also includes other updates, including: long payment IDs will be gradually phased out to improve user experience and reduce support for exchanges; each transaction must contain at least two outputs; at the protocol level, a lock time of 10 blocks (about 20 minutes) will be enforced after receiving the transaction.

Monero Upgrade Plan

Is decentralization a mere formality?

Many cryptocurrencies based on proof-of-work consensus are now facing a question. Although such blockchain platforms are still open to everyone without permission, the mining equipment involved in the consensus is becoming more and more specialized. This will prevent ordinary users from participating in the consensus decision-making of the network, which means that the concept of "decentralization" becomes meaningless. Even Bitcoin cannot get rid of such a problem. Perhaps Satoshi Nakamoto did not expect that the PoW algorithm originally suitable for central processing unit CPU calculations would be gradually eliminated after the transformation, customization and development of geeks. Dedicated ASIC equipment has occupied all the computing power of Bitcoin. Bitmain and Canaan Technology, for example, focus on the research and development of such chips.

Bitcoin difficulty explodes

Therefore, many researchers are trying to develop PoW algorithms that ASICs cannot gain an advantage over, or so-called "ASIC-resistant" algorithms, so that more people can participate in the network using general-purpose computing devices. Once the number of miners increases, the degree of decentralization will also increase. The RandomX algorithm that Monero upgraded through a hard fork in the early morning of December 1 is one of such attempts that deserves attention.

RandomX, where everyone can participate in mining

Tevador, one of the developers of RandomX, wrote in the document: "RandomX is a proof-of-work algorithm optimized for general-purpose CPUs. RandomX uses random code execution and several memory technologies to minimize the efficiency advantages of specialized hardware." RandomX is also named after "random code execution."

Technically, RandomX uses a virtual machine to execute programs in a specific instruction set, such as integer operations, floating-point operations, and branch prediction. Such programs can be converted into native machine code of the CPU on the fly, and finally, the output of the executed program is merged into a 256-bit result using the hash function Blake2b. RandomX can run in two modes, fast mode that requires 2GB of shared memory or light mode that requires 256MB of shared memory. These two modes can be switched at any time, and the results of the operation are the same, but the fast mode is suitable for "mining" and the light mode is more suitable for verifying transactions.

Only 2GB of memory and a modern CPU are needed for mining, which lowers the entry barrier for ordinary users to participate in mining. If you have bought any new PC in the past two or three years, the memory requirement is definitely met. As for the CPU, developers believe that CPUs after 2011 are more suitable. The specific configuration depends on the relevant configuration. According to some existing data, it seems that AMD has more advantages than Intel. If you want to run a full node, you only need to use "light mode", and the memory requirement is only 256 MB.


RandomX hashrate comparison of some chips

Permanent storage protocol Arweave will also integrate RandomX

Of course, for such emerging algorithms, security risks need to be avoided as much as possible. Therefore, the RandomX algorithm has undergone security audits by four independent security research teams, namely Trail of Bits, X41 D-SEC, Kudelski Security, and QuarksLab, and all four audits were organized and coordinated by the Open Source Technology Improvement Fund (OSTIF). The first audit was funded by Arweave, a blockchain permanent storage protocol, which is also an early adopter of RandomX, and the other three audits were funded by Monero community donations. No serious flaws were found in RandomX in the audit report, and some other problems have been fixed in the code.


Arweave project website

Sam Williams, CEO of Arweave, said, “ASIC-resistant PoW algorithms like RandomX will further enhance the permanent, low-cost, and tamper-resistant network we provide. RandomX helps us ensure that the decentralized content policy in the Arweave network will remain well-distributed among parties around the world.”

Not only is Monero officially exploring this, but some projects are also willing to try these fairer algorithms. However, this type of algorithm is still relatively new, and although it has passed multiple security audits, there are still many details that require longer observation. Despite this, RandomX is still an experiment that cryptocurrency geeks are willing to see, and it may also be a nightmare for mining machine manufacturers.

<<:  Whatsminer M30S has returned to mass production, Antminer intends to compete with speed in performance

>>:  58 bitcoins were lost, but the exchange only compensated 8.7 + a power bank?

Recommend

What does a high forehead mean for a woman?

The most feared features of a woman's face ar...

Men's moles, what is the fortune of men with moles on the corners of their eyes?

Moles can easily have various influences on a per...

Moles on the face can bring good luck to men

Everyone has moles on their body. Some people thi...

What happens if the emotional line is broken?

1. If your love line is broken between the ring f...

How to read a man's facial features

The five facial features refer to the eyes, ears,...

Bitcoin mining machine weekly market analysis and quotation (2016-05-30)

Mining machine name Hashrate(T) Power consumption...

What is the drooping eye?

It is said that eyes are windows to the soul. In ...

Can lucky moles be removed? Which moles cannot be removed?

The appearance of moles will affect our appearanc...