The proposal for Mine4aCause is to create a nonprofit organization that creates and manages a tool to engage with the communities of nonprofit organizations where members harnesses their excess browser CPU capacity to mine crypto-currency. All activity would be out in the open with an simple user experience to enable individuals to see the effect of their collective work while controlling the CPU utilization from none to extra-generous. This idea was inspired by projects like SETI@home and Folding@home with a further desire to put this kind of crypto-mining to serve a greater good.
The proposed tool is a browser extension that will generate hashes against a specific organization's pool. Clearly, a functional website that enables partner organizations to run Mine4aCause campaigns will need to be built should there be enough interest in the project. Until then, this POC focuses on a very minimal Chrome browser plugin that enables Monero generation through CoinHive to generate hashes for the CoinHive XMR miner.
This tool can be found in the background-miner
folder. Instructions on getting started are found in the Getting Started section. You'll install the tool in your Chrome browser and it will begin generating hashes for a Monero Pool right away.
The UI is accessible via the extension bar icon. Clicking on the Chrome icon for the Mine4aCause POC Extention will bring up a bare bones interface that identifies the hashing speed, progress and offers a slider to increase or lower the resource use of the extension.
To load an extension...
- Start by retrieving the coinhive js files locally; chrome extensions don't like loading things remotely -
$ ./install-js
- Load the chrome extension page in your browser: chrome://extensions
- Check
Developer mode
on the top right - Click on
Load unpacked extention...
then browse and select thebackground-miner
folder to load it - Click on the
Enabled
checkbox to enable the extension.
During the development of the POX extension, the following were also created.
- A docker based miner - update the
Dockerfile
with your own public site token (see below for instructions). - A simple-ui miner that will load in a page (just load simple-miner.html)
- A chrome browser extension
simple-miner
that will mine while it is open (follow the same instructions to load the POC extension)
To build and run the docker image...
$ docker build --rm -t coin-hive
$ docker run --rm coin-hive
NB! You won't really see tremendous performance out of this since it essentially runs a browser within the container. Update your Docker settings to allow your containers to use more CPU if you would like to get more out of it.
- Enable the POC to remember its power settings
- Build a website to demonstrate campaign integration with stats per organization
- Update the UI
- Investigate Coin Hive Stratum as a solution to reducing payment fees.
- Consider writing an opensource replacement for coinhive.js
Special thanks to Juan Cazala and his coin-hive project.