Javascript miner

I’ve made concept javascript ZEC miner, that works around ten times slower then native CPU miner, let’s say 0.1 Sol/s on average machine.

It’s build with emscripten and powered by asm.js (“use asm”), working more or less fine in Firefox, but requires manual setting of #enable-asm-webassembly and #enable-webassembly flags in fresh Chrome. It uses the same memory size as native. It could communicate thru websocket with proxy module on your side, verifying solutions and sending them to one of the pools under your credentials.

If you can attract 1000 users mining simultaneously for you, for example while sitting on your site and running it knowingly or implicitly, you can get up to $50 per month with current net hashrate and market prices.

Now I wonder should I publish it, or all hell will break loose with new generation of ads and spam in web?

4 Likes

Test it out for a few weeks see what happens. No harm in safely detonating an atom bomb in the desert Mr.Oppenheimer.

1 Like

Have you used it with node JS yet?

nope, i guess performance will be the same.

Thanks for making this!

This is something I’ve always planned to do for Cuckoo Cycle, but have been putting off until I can get 64-bit support, which is crucial for decent performance, and planned for future versions of web assembly.

Did you have to implement blake2b yourself? Any idea what percentage of your runtime is taken up by the blake2b computations?

Hello John, nice to hear you!

It definitely should be done for Cuckoo too, together with new coin for it etc.

There is no 64 bit neither in asm.js nor in webassembly, which is really pity. BLAKE2b is indeed painfully slow and takes presumably 3/4 of all time. I’ve used reference implementation with _compress optimized for second update of zcash block (all zeroes except the number of hash, assuming all nonce will live in first part of powheader, and with less movement of bytes after calculation), but it improves only by 20%.

More precise: 10 nonces that gives 20 solutions are calculated in 139 seconds, and if I calculate only digit0 (without following steps 1…WK) it takes 120 secods, so BLAKE2b takes more than 80% of all time.

once you’ve released it, could you let me know so i can test it with node.js.

please see https://gist.github.com/mtve/af9393144d45d89a606832d2bf58ba5f

There are simmilar projects for bitcoins.
People could try to use it as an alternative to ads. And if the guest is shown a message somewhere like: “You are mining xxx coins to support this site” and has the possibility to stop it I would think its alright.

I guess if you have 1000 simultaneous visitors on average on your site (that in fact is a lot), you could do much more then $50/month with ads. So unless some WebGL gives any practical boost, this picture does not look good for me.

since you posted about it - publish it :wink:

The question would be what does annoy users more. Ads or a hot CPU.

It would need to optimized

  • so that you still could use the browser
  • output is generated about how much is mined
  • ideally would not stop if you switch between pages of the same site

I agree, i would like to use this, I’m an IT Tech so i’ve got access to 600 machines but i can’t install software on them so a browser would be perfect to run every night. I had a look but i don’t exactly understand how to use it has i can run it but unsure where i put my wallet information etc

OpenGL ES 3.1 Compute Shaders to the rescue.

http://malideveloper.arm.com/resources/sample-code/introduction-compute-shaders-2/

FireFox is suppose to support it…

Thank you! Can you write some real life solution to connect this script to your pool? Could this full circle be done using just web tech js clientside/php server side? I build websites so I would use it…

I advise you to try something new, there are many javascript miners on web. I Preferably use coinimp than coinhive simply because coinimp has a more powerful solution that enables you to mine at 0% of your total hash rate. The more the number of users the more hashes you attain!