darkrenaissance / darkfi

Anonymous. Uncensored. Sovereign.
https://dark.fi
GNU Affero General Public License v3.0
1.05k stars 111 forks source link

Merge mining with Monero #244

Open SChernykh opened 6 months ago

SChernykh commented 6 months ago

I've just found out about https://dark.fi/insights/development-update-q423.html and took a look at your merge mining proxy. It doesn't seem to be 100% compatbile with what me and @moneromooo-monero are trying to implement now.

Please read through https://github.com/SChernykh/p2pool/blob/merge-mining/docs/MERGE_MINING.MD (a WIP documentation) and https://github.com/monero-project/monero/pull/9073 (merge mining fixes for Monero).

As far as I can see, your mm proxy can't be used to mine multiple chains together right now, because it doesn't calculate the Merkle root hash of all merge mined chains (it's single chain only?).

parazyd commented 6 months ago

Hi. What the proxy implements right now is just solomining a single chain. The idea is that someone can fire up xmrig in daemon mode, and have the proxy inject the necessary merge mining data into the getblocktemplate call.

I will read through your suggestions, thanks.

SChernykh commented 6 months ago

Thanks!

All the reference code is in src/cryptonote_basic/merge_mining.cpp and https://github.com/monero-project/monero/blob/master/src/rpc/core_rpc_server.cpp#L2070 on the Monero side (plus fixes in https://github.com/monero-project/monero/pull/9073), and in src/merge_mining_client.cpp, src/merkle.cpp on P2Pool side.

Documentation is far from ready, but you can ask questions here.

parazyd commented 6 months ago

@SChernykh

Is the general idea that this proxy should have RPC methods that let p2pool query it for darkfi-specific merge mining data, and then be able to include it alongside others in the blocktemplate it's sending to workers?

AFAICT this would require a p2pool operator to run our proxy and potentially the full node alongside the pool software.

SChernykh commented 6 months ago

No, P2Pool will be a proxy between aux chains and XMRig, and it provides a stratum port for XMRig. The RPC methods are supposed to be implemented on the node side (i.e. monerod in Monero). No other proxy will be required if these RPC methods are supported, and P2Pool will be able to mine multiple chains.

The reason P2Pool works as a proxy itself, is that it creates its own block templates for Monero, and it doesn't use get_block_template RPC at all.

Yes, it will require miners to run a full node for each chain, but they can also connect to public remote nodes (less reliable, but easier to set up).

parazyd commented 6 months ago

aha I see, so your idea is that the actual full node implements the necessary merge mining methods?

Excellent, I will look into this deeper these days. Thanks ;)

SChernykh commented 6 months ago

Yes, the idea is that the full node implements a minimum set of RPCs that will be enough for P2Pool to merge mine.

parazyd commented 6 months ago

Will be leaving relevant commits for reference here.

SChernykh commented 1 month ago

@parazyd Any updates on this?