Algorithm negotiation

Subset of protocol extensions, used to negotiate algorithm between miner and pool/proxy. All extensions is backward compatible with standard stratum protocol.

Pool defined algorithm

This is primary and required extension, it add ability for specifying algorithm for every pool job by adding simple text field "algo".

  • Extension simplify miner setup, algorithm defined only on pool side, this get rid of misconfigured miners.
  • For multi-algorithm pools this extension is only possible way to make miners switch mining algorithm by pool request.

{
  "id": 1, "jsonrpc": "2.0", "error": null,
  "result": {
    "id": "...",
    "job": {
      "blob": "...", "job_id": "...", "target": "...", "id": "...",
      "algo": "cn/r"
    },
    "status": "OK"
  }
}
{
  "jsonrpc": "2.0", "method": "job",
  "params": {
    "blob": "...", "job_id": "...", "target": "b88d0600", "id": "...",
    "algo": "cn/r"
  }
}

List of algorithms supported by XMRig, however this specification not limited to only these algorithm names, it can be extended to fit your requirements. If miner not support algorithm, connection should be closed by miner to initiate switch to backup pool.

Miner defined algorithms

This is optional part of algorithm negotiation, this extension allow miner tell pool what algorithms supported by miner for algorithm swithing. This extension adds new field "algo" to login request with JSON array format. In case if miner not support dynamic algorithm switching, miner should send list with one item, for example "algo": ["cn/r"], pool/proxy should provide work for selected algorithm or respond with error. Sorting of algorithm list is undefined by this specification, except first item which may be preferred by user.

{
  "id": 1, "jsonrpc": "2.0", "method": "login",
  "params": {
    "login": "...", "pass": "...", "agent": "...",
    "algo": ["rx/0", "cn/r", "cn-lite/1"]
  }
}