Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:xmrig/xmrig-proxy into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
xmrig committed May 2, 2018
2 parents 3c89370 + 434a0cc commit 8c39d65
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 27 deletions.
8 changes: 3 additions & 5 deletions doc/STRATUM.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ Miner send `login` request after connection successfully established for authori
"job": {
"blob": "070780e6b9d60586ba419a0c224e3c6c3e134cc45c4fa04d8ee2d91c2595463c57eef0a4f0796c000000002fcc4d62fa6c77e76c30017c768be5c61d83ec9d3a085d524ba8053ecc3224660d",
"job_id": "q7PLUPL25UV0z5Ij14IyMk8htXbj",
"target": "b88d0600",
"id": "1be0b7b6-b15a-47be-a17d-46b2911cf7d0"
"target": "b88d0600"
},
"status": "OK"
}
Expand Down Expand Up @@ -59,8 +58,7 @@ Pool send new job to miner. Miner should switch to new job as fast as possible.
"params": {
"blob": "0707d5efb9d6057e95a35f868231780b3a8649c4e57f3c77eaf437329243eef0b9f4b6987d05b900000000cae7754cb85a0ad8eebf3e0bf55f3ec5e754a1d6b05d46e5c358f907dbcbb72b01",
"job_id": "4BiGm3/RgGQzgkTI/xV0smdA+EGZ",
"target": "b88d0600",
"id": "1be0b7b6-b15a-47be-a17d-46b2911cf7d0"
"target": "b88d0600"
}
}
```
Expand Down Expand Up @@ -130,4 +128,4 @@ Non standard but widely supported protocol extension. Miner send `keepalived` to
"status": "KEEPALIVED"
}
}
```
```
60 changes: 38 additions & 22 deletions doc/STRATUM_EXT.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Stratum protocol extensions
## Mining algorithm negotiation
## 1. Mining algorithm negotiation
Subset of protocol extensions, used to negotiate algorithm between miner and pool/proxy. All extensions is backward compatible with standart stratum protocol.

### Miner defined algorithms list
Miner should send list of algorithms supported. Multiple algorithms in list meant miner can switch algorithms in runtime.
### 1.1. Miner defined algorithms list
Miner should send list of [algorithms](#14-algorithm-names-and-variants) supported. Multiple algorithms in list meant miner can switch algorithms in runtime.
```json
{
"id": 1, "jsonrpc": "2.0", "method": "login",
"params": {
"login": "...", "pass": "...", "agent": "...",
"algo": ["cn", "cn-lite", "cn-heavy"]
"algo": ["cn", "cn/0", "cn/1", "cn/xtl"]
}
}
```
In case if miner not support dynamic algorithm change, miner should send list with one item, for example `"algo": ["cn-heavy"]`, pool/proxy should provide work for selected algorithm or send error.

### Extended job object
To each `job` object pool/proxy should add 2 additional fields `algo` and `variant`.
### 1.2. Extended job object
To each `job` object pool/proxy should add additional field `algo` and optional `variant` field.

```json
{
Expand All @@ -25,7 +25,7 @@ To each `job` object pool/proxy should add 2 additional fields `algo` and `varia
"id": "...",
"job": {
"blob": "...", "job_id": "...", "target": "...", "id": "...",
"algo": "cn", "variant": 1
"algo": "cn/1", "variant": 1
},
"status": "OK"
}
Expand All @@ -37,21 +37,20 @@ To each `job` object pool/proxy should add 2 additional fields `algo` and `varia
"jsonrpc": "2.0", "method": "job",
"params": {
"blob": "...", "job_id": "...", "target": "b88d0600", "id": "...",
"algo": "cn", "variant": 1
"algo": "cn/1"
}
}
```
Possible values for `variant`:

* `1` Force use variant 1 of algorithm.
* `0` Force use original cn/cn-lite algorithm.
* `-1` or missing field, leave miner autodetect algorithm by block version.

Note about `cn-heavy` this algorithm now support only one (original) variant, so only valid values `-1` or `0`. `1` is reserved for future use, current pool/proxy implementation should never send `"variant": 1` if `cn-heavy` algorithm used.
This field used for backward compatibility with xmrig 2.5, new miner implementations should support only `algo`.

If miner not support algorithm connection should be closed by miner to initiate switch to backup pool.

### Algo extension
### 1.3. Algo extension
This extension is backward compatible with xmr-stak [extended mining statistics](#extended-mining-statistics).
First, pool should add `algo` to extensions list:
```json
Expand All @@ -69,30 +68,47 @@ First, pool should add `algo` to extensions list:
}
```

Second, miner add fields `algo` and `variant` to submit request.
Second, miner add fields `algo` to submit request.
```json
{
"id": 2, "jsonrpc": "2.0", "method": "submit",
"params": {
"id": "...", "job_id": "...", "nonce": "...", "result": "...",
"algo": "cn", "variant": 1
"algo": "cn/1"
}
}
```

Note about xmr-stak, this miner not send `variant` field and always use long algorithm names, also used 2 non standart algorithm names `cryptonight-monerov7` and `cryptonight-aeonv7`, pool side should support it as `cn` variant 1 and `cn-lite` variant 1.
Note about xmr-stak, this miner use [different algorithm names](#15-xmr-stak-algorithm-names).

### Algorithm names and variants
### 1.4 Algorithm names and variants
Both miner and pool should support short algorithm name aliases:

| Long name | Short name | Variants |
|-------------------|------------|------------|
| cryptonight | cn | `0` or `1` |
| cryptonight-lite | cn-lite | `0` or `1` |
| cryptonight-heavy | cn-heavy | only `0` |
| cryptonight-ipbc | cn-ipbc | only `1` |
| Long name | Short name | Base algorithm | Variant | Notes |
|-------------------------|----------------|---------------------|-------------|------------------------------------------------------|
| `cryptonight` | `cn` | `cryptonight` | `-1` | Autodetect works only for Monero. |
| `cryptonight/0` | `cn/0` | `cryptonight` | `0` | Original/old CryptoNight. |
| `cryptonight/1` | `cn/1` | `cryptonight` | `1` | Also known as `monero7` and `CryptoNightV7`. |
| `cryptonight/xtl` | `cn/xtl` | `cryptonight | `xtl` | Stellite (XTL) variant. |
| `cryptonight-lite` | `cn-lite` | `cryptonight-lite` | `-1` | Autodetect works only for Aeon. |
| `cryptonight-lite/0` | `cn-lite/0` | `cryptonight-lite` | `0` | Original/old CryptoNight-Lite. |
| `cryptonight-lite/1` | `cn-lite/1` | `cryptonight-lite` | `1` | Also known as `aeon7` |
| `cryptonight-lite/ipbc` | `cn-lite/ipbc` | `cryptonight-lite` | `ipbc` | IPBC variant |
| `cryptonight-heavy` | `cn-heavy` | `cryptonight-heavy` | `0` | Sumokoin and Haven Protocol |

### 1.5 XMR-Stak algorithm names
Mapping between XMR-Stak algorithm names and XMRig names.

Note about **cryptonight** and **cryptonight variant 1**, also known as **cryptonight v7**, all these variants use same algorithm name `cryptonight` or `cn`, miner should able to switch between variants in runtime.
| XMR-Stak name | XMRig Short name |
|---------------------------|------------------|
| `cryptonight` | `cn/0` |
| `cryptonight-monerov7` | `cn/1` |
| `cryptonight_v7` | `cn/1` |
| `cryptonight_v7_stellite` | `cn/xtl` |
| `cryptonight_lite` | `cn-lite/0` |
| `cryptonight-aeonv7` | `cn-lite/1` |
| `cryptonight_lite_v7` | `cn-lite/1` |
| `cryptonight_lite_v7_xor` | `cn-lite/ipbc` |

## Rig identifier
User defined rig identifier. Optional field `rigid` in `login` request. More details: https://github.com/fireice-uk/xmr-stak/issues/849
Expand Down

0 comments on commit 8c39d65

Please sign in to comment.