This tutorial is a cryptojacking how-to detailing exactly what you need to setup an opt-in WordPress Coinhive miner for the Monero cryptocurrency.
The 4 basic steps are:
- Get a mymonero.com account.
- Get a coinhive.com account.
- Customize JavaScript code.
- Add JavaScript code to your site.
Get a mymonero.com account
- Navigate to https://mymonero.com.
- Create an account.
- Copy down your Private Login Key.
- Store your Address.
Private Login Key
Address
Get a coinhive.com account
- Navigate to https://coinhive.com.
- Create an account.
- Navigate to https://coinhive.com/settings/payments.
- Paste your MyMonero address into the Monero Payment Address.
- Click Save Payment Settings.
Customize JavaScript code
- Navigate to https://coinhive.com/settings/sites.
- Copy the Site Key (public).
- Then customize the JavaScript code below by substituting the Site Key in line 3.
Add JavaScript code to your site
If you're using a WordPress site, there are WordPress plugins that should make this super easy to configure.
However...
If you don't want to install yet another plugin to simply add JavaScript to your posts, here's what I did...
- Install the Ad Inserter WordPress plugin.
- Ad Inserter provides many advanced options to insert any JavaScript, CSS, HTML, PHP or advert code anywhere on the page.
- In your WordPress Admin page, go to Settings > Ad Inserter.
- Add your JavaScript snippet.
- Set Automatic Insertion to Before Post.
- Set the Posts dropdown to Individually enabled. If you want the code on all posts, change this to Individually disabled.
- Click Save All Settings.
- Navigate to your post, scroll to the bottom, and enable it in the post.
Comments 8
thank you very much Ray Li for this script !
how to make my own coustom script for crypto jacking
Author
To get an idea of how Coinhive accomplishes cryptojacking, you could inspect their source code. It’s written in JavaScript, so presumably you could just debug the code that is executing in your browser to get some ideas. Then put together something similar.
You could also check GitHub for others that may have done this before: https://github.com/search?q=coinhive.
I also want to know if you get the amswer please mail me.
i will like to know how i can use this your script to create a cryptojacking script that can be adder to an application like a windows application
Buddy did you figure it out? I’m also trying to do something similar and It’ll be great help for me if you are kind enough to guide me. Please.
“Then customize the JavaScript code below by substituting the Site Key inline 3”
please explain this in detail I didn’t understood
Do you have to put monero mining pool?