Skip to the content.

deployment Platform license size

0. Table of Contents

1. Introduction

As a keystone of the cryptocurrency ecosystem, democracy has been severely threatened by the monopolization of mining farms in recent years. Existing countermeasures by enforcing new mining algorithms can effectively address this, but on the other hand have rendered web cryptomining unprofitable and gradually fading.

To address this, we design and implement an open-source web miner named Vectra to make web cryptomining efficient and profitable, thus reviving the democracy of the cryptocurrency ecosystem. Vectra employs a novel methodology of just-in-time transformation of mining programs, which discovers the pervasive isomorphic mining instructions for instruction merging and acceleration.

This repository contains the source code of Vectra, the data involved in this work, and a system demo.

2. Code

Build from source

Vectra consists of two components including WebRandomX and WRXProxy.

WebRandomX is a high-performance web miner. It implements the key mechanisms of just-in-time transformations of mining programs for RandomX. The core of WebRandomX is built into a WASM binary so that one can load it and perform web mining after the page is loaded from the remote server. We provide an example web page to bootstrap the binary.

WRXProxy is a mining pool proxy running on a remote server. It collects mining tasks from the mining pool (binding to a user’s RandomX wallet address), and distributes the tasks to active WebRandomX instances. When a WebRandomX instance finds a nonce that satisfies the difficulty criteria, it will submit it to WRXProxy and WRXProxy then proxies the nonce to the mining pool. In this way, one can gain profits from the submitted nonces.

Prerequisites

Compile and deploy WebRandomX

Clone and build the WebRandomX binary:

git clone https://github.com/WebCryptomining/WebRandomX.git
cd WebRandomX
mkdir build && cd build
emcmake cmake -DARCH=native ..
make

The built binary web-randomx.wasm will locate at WebRandomX/build/web-randomx.wasm

Afterwards, install npm dependencies to build the bootstrap page and run the web server:

npm install
npm run dev

The bootstrap page can be visited at [Your Server IP]:9999.

Note: The proxy server address should be configured in src/js/job.js.

Build and deploy WRXProxy

To enable web mining on WebRandomX page, WRXProxy should be built and deployed on the server:

git clone https://github.com/WebCryptomining/WRXProxy.git
cd WRXProxy && npm install

The RandomX wallet should be configured in config.json:

{
  "miner": {
    "port": 80
  },
  "pool": {
    "host": "gulf.moneroocean.stream",
    "port": 10001
  },
  "info": {
    "wallet": "# Monero Wallet Address",
    "password": "# Monero Wallet Password"
  }
}

Then, simply run npm run start to start the WRXProxy

The WebRandomX page should communicate with the proxy and mine automatically.

3. Data

We provide our measurement data regarding the tested mining programs at WebCryptomining.github.io/dataset

Each file contains the RandomX instructions in a mining program, and each line in a file is a specific instruction organized as:

<op code>, <dst reg>, <src reg>, <mod>, <imm>

4. Demo

We also provide our pre-complied demo for Vectra here.

demo