cazala / coin-hive-stratum

use CoinHive's JavaScript miner on any stratum pool
http://npmjs.com/package/coin-hive-stratum
416 stars 465 forks source link

Reverse Proxy to allow Regular Miners to mine for Coin Hive #140

Open billygerhard opened 6 years ago

billygerhard commented 6 years ago

Is it possible to use the proxy backwards, or maybe it would be a new project itself, but be able to use any miner like xmr-stak, but hash towards your coin-hive account instead of using the javascript miner for coin-hive?

cazala commented 6 years ago

why would you do that?

vidoza commented 6 years ago

I am not sure what @billygerhard mean but maybe it is because of antivirus app? Coinhive.com domain is on many blacklist and it is automatically blocked. If we could create reverse proxy on our own server and domain, antivirus will not detect it as an malware.

cazala commented 6 years ago

yea but you could simply use xmr-stak and mine on any regular pool (supportxmr, moneroocean, minexmr, etc). Why do you need coinhive if you are not doing web mining? Why would you pay the 30% commission if you can simply mine on any other pool and pay the regular <1% commissions?

notgne2 commented 6 years ago

it is a very very weird and arguably stupid request, but there's no reason it shouldn't be possible, though it's well out of the scope of this project. If you want something like that it's going to be a totally new codebase and could even end up being a little more complex. If there's a valid reason behind it I'm sure somebody is going to make it, or maybe even already has.

billygerhard commented 6 years ago

They take a 30% commission, but they guarantee payout per hash, even if their pool doesn't get the block reward. If you are using coin hive as service on a site, then you probably have servers running like I do, and they are not anywhere near maxed out. If I can add to my coin hive balance with double or triple the hashing power with the same processors, why not. yes, I can just point them to a normal pool, but getting to that payout threshold on a couple servers alone will take lots of time, but if I can get my coin hive balance to the payout amount faster, that would help pay the server bills.

cazala commented 6 years ago

fair enough, that's a good answer. this was not the first time someone asked for this, that's why I wanted to know what was the reason behind this request, I was just curious. now answering your question: it's doable, but it's not possible with this proxy. it's basically doing the same thing but the other way around, receiving TCP connections from miners, and connecting to Coinhive via WebSockets, translating stratum message from the miners to Coinhive's custom protocol and vice versa.

vidoza commented 6 years ago

I tried to do it with something like that https://www.nginx.com/blog/websocket-nginx/ . But with huge traffic it was very unstable and server stucks after several minutes. Is there anyone who have enought knowlage with websocket, who can create something like that and share with others?

cpufanboy commented 6 years ago

You mean kind of like this? http://xmr.cpufan.club/

It's a 1% commission, fwiw

hitmanex commented 6 years ago

@cpufanboy no, not like your noobish site that anyone can make.

hes asking for mining to coinhive. stop spamming your useless site

EZForever commented 5 years ago

@billygerhard Hi there, I wonder if you're still interested in this topic, but if you are, I have a good news for you. I've analyzed almost all JS code from CoinHive last month and made a crypto library and a miner based on that. See libcryptohive and HiveMiner for more information. I hope that these help to you.

P.S. Sorry about my poor English, I'm from China...

billygerhard commented 5 years ago

I haven't looked into it in a while, but I will check out your site when I get a chance!