fireice-uk / xmr-stak-cpu

Monero CPU miner
GNU General Public License v3.0
1.11k stars 478 forks source link

Javascript version of the xmr-stak-cpu #307

Closed ghost closed 7 years ago

ghost commented 7 years ago

I am opening this issue to see if anyone is interested in contributing.

As xmr-stak-cpu have minimum dependecy, it is possible to use amalgamation and emscripten to build a javascript version of the library. See https://github.com/dmlc/mxnet.js as an example for our deep learning project.

This could be fun for some usecases, to run xmr-stak-cpu on the browser and provide some cool services

Interesting links: https://www.blendmode.co.uk/job/15001264/f/freelancer/software-architecture-porting-application-javascript https://www.freelancer.com/projects/software-architecture/Porting-Application-Javascript/

And my experimental assembly: https://github.com/procoru/xmr-stak-cpu-emscripten

psychocrypt commented 7 years ago

This sounds interesting but I am currently busy because of other development for xmr-stak. I am not sure if this could only a fun project or really useful for the community.

@fireice-uk what do you think about it?

YetAnotherRussian commented 7 years ago

So I see the the target audience: one share from each background pop-up ad, one thousand bucks in a pocket? Lol

fireice-uk commented 7 years ago

@procoru It won't work for a variety reasons. Most importantly because javascript is already a security nightmare without adding native executable code to the mix, which is what mining would require for any kind of performance.

I will close this as this is impossible - look into javascript mining attempts early on in btc history for reference on what can be done and what cannot.

uaktags commented 7 years ago

well doesn't look to be impossible, but it definitely brings up ethical / moral qusrions.

ref. recent news about pirate bay.

JayWalker512 commented 7 years ago

@uaktags can you provide a reference? I haven't heard.

I do think this is an interesting proposition, and performance concerns don't seem very important to me given the utility as an ad-replacement/donation mechanism and not as a primary mining tool. WebAssembly might yield reasonable performance comparable to non-AES instruction CPUs.

uaktags commented 7 years ago

coin-hive.com - they provide a number of js services that tie in monero mining via the browser.

Alot of pushback has occurred after ThePirateBay used it recently for 24hours. https://www.engadget.com/2017/09/16/pirate-bay-hijacks-cpus-for-digital-currency-mining/

psychocrypt commented 7 years ago

This sides show why we should not support a js miner.

Am 18.09.2017 06:06 schrieb "Tim Garrity" notifications@github.com:

coin-hive.com - they provide a number of js services that tie in monero mining via the browser.

Alot of pushback has occurred after ThePirateBay used it recently for 24hours. https://www.engadget.com/2017/09/16/pirate-bay-hijacks-cpus- for-digital-currency-mining/

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/fireice-uk/xmr-stak-cpu/issues/307#issuecomment-330126082, or mute the thread https://github.com/notifications/unsubscribe-auth/AYsxtqYgDfynfudK0db_aMwU_NoDCV0Kks5sjewngaJpZM4PG3oY .

fireice-uk commented 7 years ago

@JayWalker512 I just checked out of curiosity and that's what coinhive uses. It actually achieves 11 H/S (on a laptop where stak does 35 H/S) - fairly impressive under the circumstances.

JayWalker512 commented 7 years ago

Thanks for the link @uaktags that's really interesting. I'm happy there's a working solution for this. I don't really see any ethical issues so long as visitors are given some kind of notice or a choice "would you like to see ads or mine for us?". Users don't get any warning about the porn ads on TPB but I don't hear much noise about that ;)