Using Javascript to mine crypto for charity
Cudo donate are an interesting company I worked for briefly last summer holidays. They are subsidiary of Cudo Ventures, a software company that had a few different teams creating products for different industries. Cudo donate was one of these teams, and one of their biggest products was cryptocurrency mining softtware, to either by deployed independently as a desktop application, or as a web application overlayed on an existng web page.
Whilst desktop mining is much more popular and effective, web-based mining that runs a javascript background process when you visit a website, originally gained attention because it doesnt require anyone visiting the site to download anything first. Web based mining also uses the CPU, rather than traditional GPU mining.
Due to the security sandbox that the browser runs in, that severly limits access to the CPU and priviliged memory, profitable web-based mining is pretty much impossible, and you usually wont even be able to cover your electricity costs.
As reported by Bitcoin.com, the Browse Aloud browser plug-in was hijacked and around 5,000 computers were stricken with embedded cryptocurrency mining scripts — among them British government computer systems. Even with 5,000 government computers, running these kinds of scripts led to only $24 of Monero being mined. Another article on arXix report how one of the biggest campaign operators using Coinhive — an in-browser cryptocurrency mining service — made a measly $7.69 USD after running Coinhive’s script on 11,000 websites for three months. On the contrary, CoinHive is still raking it in. It keeps 30% of all mined Monero for itself, and its ad-hoc browser-mining botnet is responsible for 1.18 percent of the entire Monero network. An analysis of the overall hash rate and network statistics suggests that CoinHive generates over 300 XMR (approximately $24,000) each week.
Despite this, the web version of this miner was still popular with a few major charities, including Childrens Air Ambulance who for a while, put this miner on their home page, which started your computer mining automatically on behalf of the charity when you visited the site. They’ve since taken it down. Theres plenty of other cases of charities using web based mining for fundraising also. Change.org also launched its own philanthropic cryptocurrency mining initiative.
“’The Mining Screensaver’ by Change.org claims to wield the ability to change the world by utilizing the processing power of computers worldwide. Anyone willing to contribute to the initiative can start mining by downloading and installing the screensaver app. All Monero generated is to be donated immediately to the Change.org Foundation, in full. Apparently, the screensaver would generate $10,000 worth of donations over one month, if 10,000 users ran the screensaver for 12 hours per day each.
UNICEF has also launched Game Chaingers in an effort to bring together gamers from across the globe and have them unite their computing power for a good cause. This initiative uses the traditional type of minining with expensive GPU hardware. “To participate in this operation, all you need to do is to install Claymore, a mining software,” the Game Chaingers website reads. “You will be able to start or stop mining when you want, and generate Ethereum right in UNICEF’s electronic wallet.”
There are many different kinds of mining algorithms for use with different cryptocurrencies and different hash rates. However, not all are suitable for web based mining with the CPU. Theres lots of different website providing profit calculators if you know your hash rate, but most people dont acually know their make and model of CPU, and if they did, asking them to enter this is a error prone and cumbersome. There are some CPU id programs out there, usually written in C, but theyre not guaranteed to work for all platforms and computers. In the end, we found CryptoKnight to generally be a safe option, whilst other charities usually opt for CoinHive. Alternativelu, the NiceHash service is a mining marketplace with a unique model thats great for beginners.
During my time at cudo, I rewrote the some of the existing web site from React and next to Vue and nuxt, modelled an SQL schema to map cpu models to optimum hash rates, and helped to develop our own CPU id programs, which although wasnt eventually used, I learned a lot in the process.
