dotnwat / xmonarch

Cryptonight hash function in asm.js and WebAssembly
51 stars 17 forks source link

The mining algorithm of Monero has been updated #19

Open liyh12 opened 6 years ago

liyh12 commented 6 years ago

hello, Do you have a plan to upgrade the algorithm?

https://getmonero.org/2018/02/11/PoW-change-and-key-reuse.html

dotnwat commented 6 years ago

thanks for pointing this out. have all those patches dropped and live on the chain?

yorrd commented 6 years ago

@noahdesu I believe so. I'm happy to test if there's anything usable :)

Other miners are already working on the updated software

dotnwat commented 6 years ago

i'll take a look. i don't know anything about the algorithm update, but it could range from very easy to a lot of work :)

yorrd commented 6 years ago

@noahdesu does this mean it's going to be on the more difficult side of the spectrum? We do have some resources on our hands, if you give us a quick walkthrough of what is to be done, we'd be happy to help out. My understanding on how the algorithm works or what you base it on is pretty limited. If you could show me what the "original" is where you take reference and quickly explain your methodology you applied last time, you'd enable me to help you update most of the code I guess. I'm certainly willing to put in a lot of time if I know what to do <3

dotnwat commented 6 years ago

@yorrd no it doesn't mean it will be difficult. i just added "help wanted" because i'm not going to be able to get to this for at least a few weeks. However, I just went to look to see what kind of changes might be involved...

I just found this change set:

https://github.com/xmrig/xmrig/commit/48b1de0b59bc2969fd9a2b951773488b9501ae4e#diff-493b8f3de96918ee49c8e59088770f4b

And honestly it looks like it should be quite easy. I haven't gone through it extensively, but it looks like the basic underlying crypto is unchanged, and the changes look like they are at a higher level.

So the changes would mostly be to https://github.com/noahdesu/xmonarch/blob/master/cryptonight/cryptonight.c

and then updating the cryptonight hashes used in the test cases.

I'll poke around a bit more, but please let me know how I can help or if you get stuck. It should be easy to migrate to the new algorithm without understanding cryptonight at all. The key is to go find a decent CPU miner, and then just pull out the core.

This is the one i started with originally, but it looks like it hasn't been updated. https://github.com/bearbin/cpuminer-cryptonight/blob/master/cryptonight_lobotomized.c

liyh12 commented 6 years ago

hello you can use this file replace your cyptonight.c

https://github.com/notgiven688/webminerpool/blob/master/hash_cn/webassembly/cryptonight.c