{"id":15146882,"url":"https://github.com/x25/coinhive-stratum-mining-proxy","last_synced_at":"2025-04-09T10:09:25.612Z","repository":{"id":76807458,"uuid":"104999683","full_name":"x25/coinhive-stratum-mining-proxy","owner":"x25","description":"Browser mining on any pool using CoinHive.js library","archived":false,"fork":false,"pushed_at":"2018-02-09T13:06:01.000Z","size":170,"stargazers_count":267,"open_issues_count":9,"forks_count":109,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-04-02T03:35:32.673Z","etag":null,"topics":["coin-hive","coinhive","mining","mining-pool","monero"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/x25.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-27T09:32:25.000Z","updated_at":"2025-03-21T14:39:40.000Z","dependencies_parsed_at":"2023-07-11T22:33:58.710Z","dependency_job_id":null,"html_url":"https://github.com/x25/coinhive-stratum-mining-proxy","commit_stats":{"total_commits":19,"total_committers":5,"mean_commits":3.8,"dds":0.368421052631579,"last_synced_commit":"41ce52579524647a561c0b2bbe69731a9d8151be"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x25%2Fcoinhive-stratum-mining-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x25%2Fcoinhive-stratum-mining-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x25%2Fcoinhive-stratum-mining-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x25%2Fcoinhive-stratum-mining-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/x25","download_url":"https://codeload.github.com/x25/coinhive-stratum-mining-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248018061,"owners_count":21034048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coin-hive","coinhive","mining","mining-pool","monero"],"created_at":"2024-09-26T12:20:23.919Z","updated_at":"2025-04-09T10:09:25.575Z","avatar_url":"https://github.com/x25.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CoinHive Stratum Mining Proxy\n\nA proof of concept of web mining using CoinHive's [JavaScript Mining](https://coinhive.com/documentation/miner) 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](https://en.bitcoin.it/wiki/Stratum_mining_protocol). You can even set up your [own pool](https://github.com/sammy007/monero-stratum).\n\nPros: no dev fee, adblock bypass, use any pool you like.\n\n## Installation\n\nRun on Docker ([docker hub repository](https://hub.docker.com/r/0x25/coinhive-stratum-mining-proxy/)):\n\n```sh\n$ git clone https://github.com/x25/coinhive-stratum-mining-proxy.git\n$ cd coinhive-stratum-mining-proxy\n$ docker build -t coinhive-stratum-mining-proxy .\n$ docker run -p 8892:8892 coinhive-stratum-mining-proxy \u003cstratum tcp host\u003e \u003cstratum tcp port\u003e\n```\n\neg:\n\n```sh\n$ docker run -p 8892:8892 coinhive-stratum-mining-proxy xmr-eu1.nanopool.org 14444\n```\nOr install dependencies (```apt-get install ...``` or ```brew install ...```):\n\n- python\n- python-dev\n- pip\n- openssl-dev\n- gcc\n- git\n- musl-dev\n- libffi-dev\n\nand run on Linux/Mac box:\n\n```sh\n$ git clone https://github.com/x25/coinhive-stratum-mining-proxy.git\n$ cd coinhive-stratum-mining-proxy\n$ pip install -v -r requirements.txt\n$ python coinhive-stratum-mining-proxy.py \u003cstratum tcp host\u003e \u003cstratum tcp port\u003e\n```\n\neg:\n\n```sh\n$ python coinhive-stratum-mining-proxy.py xmr-eu1.nanopool.org 14444\n```\n\n## Usage\n\n1. Install and Run `coinhive-stratum-mining-proxy`\n2. Load the Coinhive Miner\n\n```html\n\u003cscript src=\"https://coinhive.com/lib/coinhive.min.js\"\u003e\u003c/script\u003e\n```\n\nThe javascript can be saved/renamed and loaded from your server, see [adblock_bypass.html](https://github.com/x25/coinhive-stratum-mining-proxy/blob/master/static/adblock_bypass.html).\n\n3. Change the ```CoinHive.CONFIG.WEBSOCKET_SHARDS``` config variable:\n\n```html\n\u003cscript\u003e\nCoinHive.CONFIG.WEBSOCKET_SHARDS = [[\"ws://localhost:8892/proxy\"]];\n\u003c/script\u003e\n```\n\n4. Start Mining\n\n```html\n\u003cscript\u003e\nvar miner = new CoinHive.Anonymous('YOUR_MONERO_ADDRESS');\nminer.start();\n\u003c/script\u003e\n```\nor\n\n```html\n\u003cscript\u003e\nvar miner = new CoinHive.User('YOUR_MONERO_ADDRESS', 'YOUR_WORKER_NAME');\nminer.start();\n\u003c/script\u003e\n```\nthe username will be used as the stratum worker name (use only if your pool supports worker names).\n\n5. Profit!\n\n## SSL/Secure WebSockets\n\nGenerate keypair:\n\n```sh\nopenssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 100 -nodes\n```\n\nRun script with ```--ssl=key.pem:cert.pem``` parameter:\n\n```sh\npython coinhive-stratum-mining-proxy.py \u003cstratum tcp host\u003e \u003cstratum tcp port\u003e --ssl=key.pem:cert.pem\n```\nIf 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.\n\n## Statistic\n\nSimple stats are available at ```/stats``` route:\n\n```sh\ncurl http://localhost:8892/stats?password=YOUR_PASS\n{\"total_hashes\": 0, \"uptime\": 15.53, \"clients\": 1}\n```\n\nNo password by default, please run with ``--password=YOUR_PASS`` argument to setup password.\n\n## Demo\n\nSetup and run `coinhive-stratum-mining-proxy` with `xmr-eu1.nanopool.org 14444` parameters and open http://localhost:8892 in your browser for live demo.\n\n## Links\n\n- [JavaScript Miner API](https://coinhive.com/documentation/miner)\n- [Solo mining stratum pool for Monero](https://github.com/sammy007/monero-stratum)\n\n## Disclaimer\n\nThis project is not endorsed by or affiliated with coinhive.com in any way.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx25%2Fcoinhive-stratum-mining-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx25%2Fcoinhive-stratum-mining-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx25%2Fcoinhive-stratum-mining-proxy/lists"}