Coinhive can be integrated into your sites in several different ways. For the Simple UI and the Captcha you only need to copy a few lines of code into your site's source. The JavaScript API in turn gives you the full control over the behavior of the miner, but requires some JavaScript knowledge.

Simple Miner UI

The easiest way to implement the miner into your page and let your users control it.


Display, customize and verify the Proof Of Work Captcha.

JavaScript Miner

Embed, control and get status information from the JavaScript miner on your webpage.


Verify tokens, get and withdraw user balances and programmatically create shortlinks.

WordPress Plugins

Third party plugins for easy integration into your WordPress site. Note that these are inofficial plugins ande we cannot offer technical support.

Non-Adblocked Version

AuthedMine - A version of our miner that is not blocked by adblockers but requires an explicit opt-in from the end-user.

Further Reading

Proof of Work Captcha

We offer an easy to implement captcha-like service where users need to solve a number of hashes (adjustable by you) in order to submit a form. This prevents spam at an inconvenience that is comparable to a classic captcha. All with the added benefit of earning you money.

An alternative for Google's reCaptcha

For an example, have a look at our login page.

The captcha API is modeled after Google's reCaptcha. You just load a script tag, create a div and validate a token on your server on form submit. See the detailed implementation guide in the documentation.

Proof of Work Shortlinks

If you have an URL you'd like to forward your users to, you can create a cnhv.co shortlink to it. The user has to solves a number of hashes (adjustable by you) and is automatically forwarded to the target URL afterwards.

Example: cnhv.co/6bk (this just forwards to the Monero article on Wikipedia)

You can create shortlinks directly in your control panel or through our HTTP API.

Flexible JavaScript API

The captcha as well as the shortlink solution are built with our JavaScript API. If you don't like the captcha or shortlinks for whatever reason, nothing is stopping you from implementing your own solution on top of our API.

The JavaScript API let's you associate solved hashes to specific users on your site. Users can solve hashes on your behalf in return for benefits you provide.

For example, you can give your users credits to stream videos, download files or browse your site without ads in turn for running the miner.

Load the Coinhive Miner and start mining

<script src="https://coinhive.com/lib/coinhive.min.js"></script>
    var miner = new CoinHive.User('SITE_KEY', 'john-doe');

Get the number of hashes solved by a user

curl "https://api.coinhive.com/user/balance?name=john-doe&secret=<secret-key>"
# {success: true, name: "john-doe" balance: 4096}

See the documentation for the details.

My Hash Rate Seems Low – Why Monero?

Monero is different. To mine Monero, you have to calculate hashes with an algorithm called Cryptonight. This algorithm is very compute heavy and – while overall pretty slow – was designed to run well on consumer CPUs.

There are solutions to run the Cryptonight algorithm on a GPU instead, but the benefit is about 2x, not 10000x like for other algorithms used by Bitcoin or Ethereum. This makes Cryptonight a nice target for JavaScript and the Browser.

Of course, when running through JavaScript performance still takes a bit of a toll, but it's not that bad. Our miner uses WebAssembly and runs with about 65% of the performance of a native Miner. For an Intel i7 CPU (one of the fastest desktop CPUs) you should see a hashrate of about 90h/s. A native miner would get to 140h/s.

We'd like to further close this gap and are working on solutions to do so.

Will This Work On My Site?

Technically yes, economically probably not. If you run a blog that gets 10 visits/day, the payout will be miniscule. For the captcha and shortlinks with a sensible hash goal (1024–16384) you'll need to have a whole lot of users to make this worthwhile.

Implementing a reward system for your site or game where users have to keep mining for longer durations is far more feasible. With just 10–20 active miners on your site, you can expect a monthly revenue of about 0.3 XMR (~$).

If you run a streaming video site, a community site, an online game or anything else where you can give your users an incentive to run the miner for longer durations, then by all means: try it.

Fair Payouts

We pay per solved hash. The payout rate is adjusted automatically every few hours based on the global difficulty of the network and the average reward per block. The payout rate is calculated like this:

(<solved_hashes>/<global_difficulty>) * <block_reward> * 0.7

With the current network difficulty of 121.09G (updated March 08, 2019 - 16:56) and average block reward of 3.07 XMR:

(<solved_hashes>/121089533795) * 3.07 XMR * 0.7 = 0.000018 XMR per 1M hashes

I.e. you get 70% of the average XMR we earn. Unlike a traditional mining pool, this rate is fixed, regardless of actual blocks found and the luck involved finding them. We keep 30% for us to operate this service and to (hopefully) turn a profit.

We try to run this service with as much transparency as possible. If your users solve hashes, you get paid. Period. The minimum payout threshold is 0.02 XMR (~$1).

Payouts are fully automated and are initiated every 2nd hour, 12 times a day. If you reach the minimum payout threshold, you'll automatically receive your money in the next batch.

© 2019 coinhive
Legal Information Documentation