Go to file
2018-12-23 14:09:09 +01:00
doc 8 branch conditions for CALL/RET 2018-12-21 22:41:35 +01:00
src JitCompilerX86: use mmap to allocate an executable buffer 2018-12-23 14:09:09 +01:00
tests ALU/FPU test: Fixed MSVC x86 build 2018-11-20 22:41:34 +01:00
.gitignore RandomX portable interpreter 2018-12-11 21:00:30 +01:00
LICENSE Initial commit 2018-11-01 00:34:52 +01:00
makefile JitCompilerX86: use mmap to allocate an executable buffer 2018-12-23 14:09:09 +01:00
README.md Renamed immediate constants 2018-12-20 18:36:09 +01:00

RandomX

RandomX is an experimental proof of work (PoW) algorithm that uses random code execution to achieve ASIC resistance.

Key features

  • CPU-friendly (especially for x86 and ARM architectures)
  • ASIC-resistant, FPGA-resistant, GPU-resistant
  • Memory-hard (requires >4 GiB of memory)
  • Web-mining resistant due to high memory requirement

Virtual machine

RandomX is intended to be run efficiently on a general-purpose CPU. The virtual machine (VM) which runs RandomX code attempts to simulate a generic CPU using the following set of components:

Imgur

Full description: vm.md.

Dataset

RandomX uses a 4 GiB read-only dataset. The dataset is constructed using a combination of the Argon2d hashing function, AES encryption/decryption and a random permutation. The dataset is regenerated every ~34 hours.

Full description: dataset.md.

Instruction set

RandomX uses a simple low-level language (instruction set), which was designed so that any random bitstring forms a valid program. Each RandomX instruction has a length of 128 bits.

Full description: isa.md.

Proof of work

RandomX produces a 256-bit final hash value to be used for a Hashcash-style proof evaluation. The hash of the block header is used for the first VM initialization. The program initialization and execution are chained multiple times to prevent mining strategies that search for programs with particular properties (for example, without division).

The final result is obtained by calculating a Blake2b hash of the Register file and a checkum of the Scratchpad.

Acknowledgements

The following people have contributed to the design of RandomX:

RandomX uses some source code from the following 3rd party repositories: