RandomWOW/README.md

47 lines
2.2 KiB
Markdown
Raw Normal View History

2018-10-31 23:34:52 +00:00
# RandomX
2018-12-14 11:12:18 +00:00
RandomX is an experimental proof of work (PoW) algorithm that uses random code execution to achieve ASIC resistance.
2018-10-31 23:46:39 +00:00
2018-12-14 11:12:18 +00:00
### Key features
2018-11-05 17:27:48 +00:00
2018-12-14 11:12:18 +00:00
* 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
2018-10-31 23:46:39 +00:00
## Virtual machine
2018-12-14 11:12:18 +00:00
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:
2018-10-31 23:46:39 +00:00
2018-12-14 11:12:18 +00:00
![Imgur](https://i.imgur.com/ZAfbX9m.png)
2018-11-05 17:27:48 +00:00
2018-12-14 11:12:18 +00:00
Full description: [vm.md](doc/vm.md).
2018-11-05 17:27:48 +00:00
2018-12-14 11:12:18 +00:00
## Dataset
2018-10-31 23:46:39 +00:00
2018-12-14 11:12:18 +00:00
RandomX uses a 4 GiB read-only dataset. The dataset is constructed using a combination of the [Argon2d](https://en.wikipedia.org/wiki/Argon2) hashing function, [AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) encryption/decryption and a random permutation. The dataset is regenerated every ~34 hours.
2018-10-31 23:46:39 +00:00
2018-12-14 11:12:18 +00:00
Full description: [dataset.md](doc/dataset.md).
2018-10-31 23:46:39 +00:00
## Instruction set
2018-12-14 11:12:18 +00:00
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.
2018-12-14 11:12:18 +00:00
Full description: [isa.md](doc/isa.md).
2018-10-31 23:46:39 +00:00
2018-11-18 10:38:33 +00:00
## Proof of work
RandomX produces a 256-bit final hash value to be used for a Hashcash-style proof evaluation.
2018-12-14 11:12:18 +00:00
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).
2018-11-18 10:38:33 +00:00
2018-12-14 11:12:18 +00:00
The final result is obtained by calculating a Blake2b hash of the Register file and a checkum of the Scratchpad.
2018-12-14 11:12:18 +00:00
## Acknowledgements
The following people have contributed to the design of RandomX:
* [SChernykh](https://github.com/SChernykh)
* [hyc](https://github.com/hyc)
2018-11-18 10:38:33 +00:00
2018-12-14 11:12:18 +00:00
RandomX uses some source code from the following 3rd party repositories:
* Argon2d, Blake2b hashing functions: https://github.com/P-H-C/phc-winner-argon2
* PCG32 random number generator: https://github.com/imneme/pcg-c-basic
2018-12-20 17:36:09 +00:00
* Software AES implementation https://github.com/fireice-uk/xmr-stak
* t1ha2 hashing function: https://github.com/leo-yuriev/t1ha