Ragnaroek / mithril

Pure Rust Monero Miner
GNU General Public License v3.0
235 stars 40 forks source link

What is the worker based on? #10

Closed jgillich closed 6 years ago

jgillich commented 6 years ago

Hi @Ragnaroek,

I'm trying to understand your work_job function and what all the values mean (primarily nonce & the loops, as well as num_target). What information did you use to implement it? It's really difficult to find anything at all about this, since documentation for Stratum is basically non-existent.

Thanks!

Ragnaroek commented 6 years ago

Yes, that part was challenging. I also did not find a proper documentation for the stratum protocol that is used for Monero mining pools.

The start is somehow the stratum protocol for Bitcoin pools: https://en.bitcoin.it/wiki/Stratum_mining_protocol

The Monero version is derived from that and you get the rough idea of how the protocol works.

For client side details much is based on the C implementation in https://github.com/fireice-uk/xmr-stak-cpu Another source was one of the pool server implementations: https://github.com/zone117x/node-cryptonote-pool From that parts I could make an implementation that works :)

I did only understand num_target after reading "Understanding Bitcoin" by Pedro Franco, where a same scheme for Bitcoin is described where a compacted target is used.

jgillich commented 6 years ago

I did look at various C/C++ implementations, but they're doing lots of pointer magic that just isn't possible in type safe languages. But thanks to you, I managed to get my Go version working. :)

Now on to OpenCL and CUDA, ha.

brandonros commented 11 months ago

while nonce <= 65535 {

Why are you trying 0 -> 0xFFFF nonce wise? In my experience, most nonces are larger than that?

https://github.com/Ragnaroek/mithril/blob/104ee0fc9cba19586f8d0902ff396f9665cc1471/src/worker/worker_pool.rs#L191