Skip to content

Commit 69d2474

Browse files
committed
add proxies definition
1 parent 33951ad commit 69d2474

File tree

4 files changed

+55
-1
lines changed

4 files changed

+55
-1
lines changed

05-Mining-Protocol.md

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,4 +526,58 @@ This message can be sent only to connections that don’t have `REQUIRES_STANDAR
526526
| Field Name | Data Type | Description |
527527
| ---------------- | ------------- | ----------------------------------------------------------------------------------------- |
528528
| group_channel_id | U32 | Identifier of the group where the standard channel belongs |
529-
| channel_ids | SEQ0_64K[U32] | A sequence of opened standard channel IDs, for which the group channel is being redefined |
529+
| channel_ids | SEQ0_64K[U32] | A sequence of opened standard channel IDs, for which the group channel is being redefined |
530+
531+
## 5.5 Proxies
532+
533+
Proxies are entities that aggregate hashrate from multiple Mining Devices into a single Connection.
534+
535+
The following protocol primitives are based on the assumption that proxies are part of the infrastructure:
536+
- Extended Extranonces: allowing for efficient hashing space distribution.
537+
- Future Jobs: allowing for in-site caching of Future Jobs (therefore avoiding empty Jobs).
538+
539+
Proxies can be nested into multiple layers, depending on different needs for hasher infrastructure.
540+
The infrastructure complexity may vary according to operational requirements, but a single proxy layer should suffice for most simple setups.
541+
542+
Proxies can be split in two main categories:
543+
544+
### 5.5.1 Mining Proxy
545+
546+
A Mining Proxy covers the full scope of the Mining Protocol. It supports all types of channels, both for Upstream and Downstream Connections.
547+
548+
| | **Standard Channels** | **Group Channels** | **Extended Channels** |
549+
|----------------|-----------------------|--------------------|-----------------------|
550+
| **Upstream** | yes | yes | yes |
551+
| **Downstream** | yes | yes | yes |
552+
553+
A Mining Proxy is responsible for delivering Jobs to Downstream Channels and is a crucial piece of infrastructure for optimizing the hash space distribution across multiple SV2 Mining Devices (plus SV1 Mining Devices, in case a Translator Proxy is available Downstream).
554+
555+
A Mining Proxy can forward multiple Standard Channels to the Upstream, ideally one representing each SV2 Mining Device Downstream.
556+
The Upstream (Pool, JDC or another Mining Proxy) is expected to send a `SetGroupChannel` message aggregating different Standard Channels.
557+
The Upstream sends jobs via `NewExtendedMiningJob` to Group Channels, and if some Downstream is a Mining Device (i.e.: the `SetupConnection` had the `REQUIRES_STANDARD_JOBS` flag) the Mining Proxy converts that message into different `NewMiningJob` messages after calculating the correct Merkle Root based on each Standard Channel's `extranonce_prefix`.
558+
559+
Alternatively, a Mining Proxy could aggregate multiple Donwstream Standard Channels into a single Extended Channel. The Upstream sends Jobs via `NewExtendedMiningJob`, and for each Downstream SV2 Mining Device, the Mining Proxy sends different `NewMiningJob` message, where the Merkle Root is based on the Standard Channel's `extranonce_prefix`.
560+
561+
| Group + Standard Channels | Extended + Standard Channels |
562+
|--------------------------------------|--------------------------------------|
563+
| ![](./img/mining_proxy_standard.png) | ![](./img/mining_proxy_extended.png) |
564+
565+
### 5.5.2 Translator Proxy
566+
567+
A Translator Proxy has a much more limited scope of functionality, when compared to a Mining Proxy.
568+
It can only open Extended Channels with its Upstream, and all its Downstream Connections are SV1.
569+
570+
Its main purpose is to allow legacy SV1 Mining Devices to be deployed within SV2 infrastructures.
571+
572+
| | **Standard Channels** | **Group Channels** | **Extended Channels** |
573+
|----------------|-----------------------|--------------------|-----------------------|
574+
| **Upstream** | no | no | yes |
575+
| **Downstream** | no (SV1) | no (SV1) | no (SV1) |
576+
577+
A Translator Proxy establishes SV1 connections with its Downstream SV1 Mining Devices, and establishes `extranonce_size` and a unique `extranonce_prefix` for each one of them via the `mining.set_extranonce` SV1 message.
578+
579+
It receives Extended Jobs from the Upstream via `NewExtendedMiningJob` messages. For each Downstream SV1 Mining Device, a `mining.notify` SV1 message is sent, and the SV1 Mining Devices are expected to calculate their own Merkle Roots while rolling over their assigned Extranonce space.
580+
581+
|![](./img/translator_proxy.png)|
582+
|-|
583+

img/mining_proxy_extended.png

321 KB
Loading

img/mining_proxy_standard.png

297 KB
Loading

img/translator_proxy.png

294 KB
Loading

0 commit comments

Comments
 (0)