Awesome Open Source
Awesome Open Source

CoinHive Stratum Mining Proxy

A proof of concept of web mining using CoinHive's JavaScript Mining library. The proxy acts like coin hive to connect to a mining pool. Should work with any monero pool based on the Stratum Mining Protocol. You can even set up your own pool.

Pros: no dev fee, adblock bypass, use any pool you like.


Run on Docker (docker hub repository):

$ git clone
$ cd coinhive-stratum-mining-proxy
$ docker build -t coinhive-stratum-mining-proxy .
$ docker run -p 8892:8892 coinhive-stratum-mining-proxy <stratum tcp host> <stratum tcp port>


$ docker run -p 8892:8892 coinhive-stratum-mining-proxy 14444

Or install dependencies (apt-get install ... or brew install ...):

  • python
  • python-dev
  • pip
  • openssl-dev
  • gcc
  • git
  • musl-dev
  • libffi-dev

and run on Linux/Mac box:

$ git clone
$ cd coinhive-stratum-mining-proxy
$ pip install -v -r requirements.txt
$ python <stratum tcp host> <stratum tcp port>


$ python 14444


  1. Install and Run coinhive-stratum-mining-proxy
  2. Load the Coinhive Miner
<script src=""></script>

The javascript can be saved/renamed and loaded from your server, see adblock_bypass.html.

  1. Change the CoinHive.CONFIG.WEBSOCKET_SHARDS config variable:
CoinHive.CONFIG.WEBSOCKET_SHARDS = [["ws://localhost:8892/proxy"]];
  1. Start Mining
var miner = new CoinHive.Anonymous('YOUR_MONERO_ADDRESS');


var miner = new CoinHive.User('YOUR_MONERO_ADDRESS', 'YOUR_WORKER_NAME');

the username will be used as the stratum worker name (use only if your pool supports worker names).

  1. Profit!

SSL/Secure WebSockets

Generate keypair:

openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 100 -nodes

Run script with --ssl=key.pem:cert.pem parameter:

python <stratum tcp host> <stratum tcp port> --ssl=key.pem:cert.pem

If you use the Let's Encrypt generated certificates or if you see the error NET::ERR_CERT_AUTHORITY_INVALID in the browser, you should find the intermediate (a.k.a. chain.pem) certificates and run the script with --ssl=key.pem:cert.pem:chain.pem parameters.


Simple stats are available at /stats route:

curl http://localhost:8892/stats?password=YOUR_PASS
{"total_hashes": 0, "uptime": 15.53, "clients": 1}

No password by default, please run with --password=YOUR_PASS argument to setup password.


Setup and run coinhive-stratum-mining-proxy with 14444 parameters and open http://localhost:8892 in your browser for live demo.



This project is not endorsed by or affiliated with in any way.



Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
python (54,523
mining (54
monero (53