tevador / RandomX

Proof of work algorithm based on random code execution
BSD 3-Clause "New" or "Revised" License
1.43k stars 307 forks source link

Random question about "directed rounding support for floating point" #203

Closed oknoorap closed 3 years ago

oknoorap commented 3 years ago

I read the FAQ and it said:

Web mining is infeasible due to the large memory requirement and the lack of directed rounding support for floating point operations in both Javascript and WebAssembly.

I want to create a javascript miner version of RandomX algo, I'm just curious, are these libraries support direct rounding floating point operation?

tevador commented 3 years ago

Yes, a javascript miner is technically possible using software-emulated floating point operations, but it will be too slow for any practical use. IIRC someone already implemented it and was getting around 1 H/s per CPU core.

oknoorap commented 3 years ago

@tevador wow cool, someone already created js miner, where is the repo? can you share with me 😁

tevador commented 3 years ago

It was a closed-source miner. Here is the discussion from reddit. However, their website doesn't seem to work anymore.

oknoorap commented 3 years ago

Ah okay thanks for the info, and also you told that JS RandomX miner is possible, it motivates me to do different approach but still in JS. 👍

oknoorap commented 3 years ago

@tevador is your randomX service actually works? https://github.com/tevador/randomx-service

tevador commented 3 years ago

Yes, it works. You can test it here: https://tevador.github.io/

oknoorap commented 3 years ago

It's error, "service is not accessible", what happen?

tevador commented 3 years ago

It's error, "service is not accessible", what happen?

It means you didn't follow the "How to use" instructions on the website correctly.

Or your web browser blocks requests to localhost. The following browsers are known to work: Chrome, Edge, Firefox (make sure it's updated to the latest version).

oknoorap commented 3 years ago

alright, I thought it works online. so, technically it's server who's doing random_x hashing job?

tevador commented 3 years ago

so, technically it's server who's doing random_x hashing

No. Hashes are calculated by the client running randomx-service. It works exactly like any web miner except the hashing is not done directly in the browser due to js/wasm limitations.

oknoorap commented 3 years ago

yes I mean the hashing work will be done on the server, right? isn't the server use 100% of cpu resources? can we start talk in telegram / any chat platfrom, I'll PM you . I think our chit-chat is out of topics here 😁

tevador commented 3 years ago

yes I mean the hashing work will be done on the server, right?

No. That's not how it works at all. Hashing is still done by the client and not by the server.

You can come to the IRC channel #monero-pow on Freenode and ask there if you have specific questions.