{"eip":1571,"title":"EthereumStratum/2.0.0","description":"This draft contains the guidelines to define a new standard for the Stratum protocol used by Ethereum miners to communicate with mining pool servers.","authors":["Andrea Lanfranchi (@AndreaLanfranchi)","Pawel Bylica (@chfast)","Marius Van Der Wijden (@MariusVanDerWijden)"],"status":"Stagnant","type":"Standards Track","category":"Interface","created":"2018-11-09","discussionsTo":"https://github.com/AndreaLanfranchi/EthereumStratum-2.0.0/issues","repo":"EIPs","label":"EIP-1571","officialUrl":"https://eips.ethereum.org/EIPS/eip-1571","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1571.md","url":"https://eips.huatuo.xyz/eip-1571/","tldr":{"en":"A proposed, compact JSON-over-TCP Stratum protocol for Ethereum proof-of-work miners and mining pools, aiming to replace the many incompatible Stratum flavours in use.","ja":"Ethereum のプルーフ・オブ・ワークのマイナーとマイニングプール向けに提案された、コンパクトな JSON over TCP の Stratum プロトコル。使われている互換性のない多数の Stratum 方言を置き換えることを目指す。","ko":"이더리움 작업 증명 채굴자와 채굴 풀을 위해 제안된, JSON over TCP 방식의 간결한 Stratum 프로토콜. 현재 쓰이는 서로 호환되지 않는 여러 Stratum 변종을 대체하는 것을 목표로 한다.","zh":"为以太坊工作量证明矿工和矿池提出的紧凑的、基于 TCP 的 JSON Stratum 协议，旨在取代目前使用的众多互不兼容的 Stratum 变体。"},"tags":["mining","stratum","pool","proof-of-work","protocol"],"explainers":{"en":{"lang":"en","tldr":"A proposed, compact JSON-over-TCP Stratum protocol for Ethereum proof-of-work miners and mining pools, aiming to replace the many incompatible Stratum flavours in use.","tags":["mining","stratum","pool","proof-of-work","protocol"],"related":[3675],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-1571/","markdown":"## What problem does it solve?\n\nProof-of-work miners rarely ran a full node; they connected to a mining pool that handed out work and collected results. Pools used \"Stratum\", a persistent TCP connection carrying line-based JSON messages. But Ethereum never had an official Stratum spec, so each pool spoke its own dialect, and mining software had to guess which one it was talking to.\n\nThe messages were also wordy. The spec estimates a typical `mining.notify` at about 240 bytes, which adds up quickly at one job per block across tens of thousands of connections, and hurts miners on poor connections.\n\nEthereumStratum/2.0.0 proposes one well-defined, byte-frugal protocol, built mainly on NiceHash's EthereumStratum/1.0.0.\n\n## How it works\n\n- Messages are JSON-RPC 2.0, one per line ending in `\\n`, but trimmed: the `jsonrpc` member is always omitted, `id` must be an integer 0–65535, and numbers are sent as lowercase hex without `0x` or leading zeros.\n- **Handshake:** the client sends `mining.hello` (agent, host, port, protocol). The server replies with its protocol, whether it will gzip all further messages, whether sessions can be resumed, an idle timeout and max error count.\n- **Session:** `mining.subscribe` starts or resumes a session; `mining.authorize` registers each worker (`account.machine`) and returns a short token used in later messages.\n- **Setup:** `mining.set` sends values that rarely change (epoch number instead of seed hash, target, algorithm, and an `extranonce` prefix that gives each miner its own nonce range).\n- **Work:** `mining.notify` sends job id, block number, header hash and a \"previous shares are stale\" flag. `mining.submit` returns job id, the nonce suffix (without the extranonce) and the worker token.\n- Extras: `mining.hashrate` reporting, `mining.noop`, `mining.reconnect` and `mining.bye`.\n\n## Sample code\n\nA typical exchange (one JSON object per line):\n\n```json\n{\"id\":0,\"method\":\"mining.hello\",\"params\":{\"agent\":\"ethminer-0.17\",\"host\":\"pool.example\",\"port\":\"4d2\",\"proto\":\"EthereumStratum/2.0.0\"}}\n{\"id\":0,\"result\":{\"proto\":\"EthereumStratum/2.0.0\",\"encoding\":\"plain\",\"resume\":\"1\",\"timeout\":\"b4\",\"maxerrors\":\"5\",\"node\":\"Geth/v1.8.18\"}}\n{\"id\":1,\"method\":\"mining.subscribe\"}\n{\"id\":2,\"method\":\"mining.authorize\",\"params\":[\"0xYourAccount.rig1\",\"x\"]}\n{\"id\":2,\"result\":\"w-123\"}\n{\"method\":\"mining.set\",\"params\":{\"epoch\":\"dc\",\"target\":\"0112e0be826d694b2e62d01511f12a6061fbaec8bc02357593e70e52ba\",\"algo\":\"ethash\",\"extranonce\":\"af4c\"}}\n{\"method\":\"mining.notify\",\"params\":[\"bf0488aa\",\"6526d5\",\"645cf20198c2f3861e947d4f67e3ab63b7b2e24dcc9095bd9123e7b33371f6cc\",\"0\"]}\n{\"id\":31,\"method\":\"mining.submit\",\"params\":[\"bf0488aa\",\"68765fccd712\",\"w-123\"]}\n{\"id\":31}\n```\n\nHere the full nonce is the extranonce plus the submitted suffix: `af4c68765fccd712`.\n\n## Things to know\n\n- Status is **Stagnant**. Pools and miners continued to use a mix of dialects.\n- Ethereum mainnet stopped using proof-of-work at the Merge ([EIP-3675](/eip-3675/)), so this protocol is no longer relevant to Ethereum itself; it may still interest other Ethash-based chains.\n- Unlike earlier Stratum flavours, the client speaks first (`mining.hello`) to avoid letting the server be used for traffic amplification attacks.\n- Extranonces must keep their leading zeros (`\"01ac\"` and `\"1ac\"` give different nonce ranges), and pools may use at most 6 hex characters.\n"},"ja":{"lang":"ja","tldr":"Ethereum のプルーフ・オブ・ワークのマイナーとマイニングプール向けに提案された、コンパクトな JSON over TCP の Stratum プロトコル。使われている互換性のない多数の Stratum 方言を置き換えることを目指す。","tags":["mining","stratum","pool","proof-of-work","protocol"],"related":[3675],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-1571/","markdown":"## 何を解決するのか\n\nプルーフ・オブ・ワークのマイナーがフルノードを動かすことはまれで、仕事を割り当てて結果を集めるマイニングプールに接続していました。プールが使っていたのが「Stratum」で、行単位の JSON メッセージを運ぶ永続的な TCP 接続です。しかし Ethereum には公式の Stratum 仕様が一度もなく、プールごとに独自の方言を話していたため、マイニングソフトは相手がどの方言を使っているかを推測しなければなりませんでした。\n\nメッセージも冗長でした。仕様書は、典型的な `mining.notify` を約 240 バイトと見積もっています。ブロックごとに 1 つのジョブを、数万の接続に送ると、すぐに積み重なり、回線の悪いマイナーには負担になります。\n\nEthereumStratum/2.0.0 は、NiceHash の EthereumStratum/1.0.0 を主なベースに、明確に定義された、バイト数を節約する 1 つのプロトコルを提案します。\n\n## 仕組み\n\n- メッセージは JSON-RPC 2.0 で、1 行に 1 つ、`\\n` で終わりますが、切り詰められています。`jsonrpc` メンバーは常に省略され、`id` は 0〜65535 の整数でなければならず、数値は `0x` や先頭のゼロなしの小文字の 16 進で送られます。\n- **ハンドシェイク:** クライアントが `mining.hello`（agent、host、port、protocol）を送ります。サーバーは、自分のプロトコル、以降のすべてのメッセージを gzip 圧縮するかどうか、セッションを再開できるかどうか、アイドルタイムアウト、最大エラー数を返します。\n- **セッション:** `mining.subscribe` がセッションを開始または再開します。`mining.authorize` が各ワーカー（`account.machine`）を登録し、以降のメッセージで使う短いトークンを返します。\n- **セットアップ:** `mining.set` が、あまり変わらない値を送ります（シードハッシュの代わりのエポック番号、ターゲット、アルゴリズム、各マイナーに固有の nonce 範囲を与える `extranonce` プレフィックス）。\n- **ワーク:** `mining.notify` が、ジョブ ID、ブロック番号、ヘッダーハッシュ、「以前のシェアは無効（stale）」フラグを送ります。`mining.submit` は、ジョブ ID、nonce の接尾辞（extranonce を除く）、ワーカートークンを返します。\n- その他: `mining.hashrate` による報告、`mining.noop`、`mining.reconnect`、`mining.bye`。\n\n## サンプルコード\n\n典型的なやり取り（1 行に 1 つの JSON オブジェクト）:\n\n```json\n{\"id\":0,\"method\":\"mining.hello\",\"params\":{\"agent\":\"ethminer-0.17\",\"host\":\"pool.example\",\"port\":\"4d2\",\"proto\":\"EthereumStratum/2.0.0\"}}\n{\"id\":0,\"result\":{\"proto\":\"EthereumStratum/2.0.0\",\"encoding\":\"plain\",\"resume\":\"1\",\"timeout\":\"b4\",\"maxerrors\":\"5\",\"node\":\"Geth/v1.8.18\"}}\n{\"id\":1,\"method\":\"mining.subscribe\"}\n{\"id\":2,\"method\":\"mining.authorize\",\"params\":[\"0xYourAccount.rig1\",\"x\"]}\n{\"id\":2,\"result\":\"w-123\"}\n{\"method\":\"mining.set\",\"params\":{\"epoch\":\"dc\",\"target\":\"0112e0be826d694b2e62d01511f12a6061fbaec8bc02357593e70e52ba\",\"algo\":\"ethash\",\"extranonce\":\"af4c\"}}\n{\"method\":\"mining.notify\",\"params\":[\"bf0488aa\",\"6526d5\",\"645cf20198c2f3861e947d4f67e3ab63b7b2e24dcc9095bd9123e7b33371f6cc\",\"0\"]}\n{\"id\":31,\"method\":\"mining.submit\",\"params\":[\"bf0488aa\",\"68765fccd712\",\"w-123\"]}\n{\"id\":31}\n```\n\nここで完全な nonce は、extranonce と送信された接尾辞を連結した `af4c68765fccd712` です。\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** です。プールとマイナーは、その後も複数の方言を混在させて使い続けました。\n- Ethereum のメインネットは The Merge（[EIP-3675](/eip-3675/)）でプルーフ・オブ・ワークの使用をやめたため、このプロトコルは Ethereum 自体にはもう関係ありません。Ethash ベースの他のチェーンには、今も関心があるかもしれません。\n- 以前の Stratum の方言と違い、クライアントが先に話します（`mining.hello`）。これは、サーバーがトラフィック増幅攻撃に利用されるのを防ぐためです。\n- extranonce は先頭のゼロを保持しなければなりません（`\"01ac\"` と `\"1ac\"` では nonce の範囲が異なります）。また、プールが使えるのは最大 16 進 6 文字までです。\n"},"ko":{"lang":"ko","tldr":"이더리움 작업 증명 채굴자와 채굴 풀을 위해 제안된, JSON over TCP 방식의 간결한 Stratum 프로토콜. 현재 쓰이는 서로 호환되지 않는 여러 Stratum 변종을 대체하는 것을 목표로 한다.","tags":["mining","stratum","pool","proof-of-work","protocol"],"related":[3675],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-1571/","markdown":"## 어떤 문제를 해결하나요?\n\n작업 증명 채굴자는 풀 노드를 직접 운영하는 일이 드물었고, 작업을 나눠 주고 결과를 모으는 채굴 풀에 접속했습니다. 풀은 \"Stratum\"을 사용했는데, 줄 단위 JSON 메시지를 주고받는 지속적인 TCP 연결입니다. 그러나 이더리움에는 공식 Stratum 명세가 한 번도 없었고, 그래서 풀마다 자기만의 방언을 썼으며 채굴 소프트웨어는 상대가 어떤 방언을 쓰는지 추측해야 했습니다.\n\n메시지도 장황했습니다. 명세서는 일반적인 `mining.notify`가 약 240바이트라고 추정하는데, 블록마다 작업 하나를 수만 개의 연결에 보내면 금세 쌓이고, 회선 상태가 나쁜 채굴자에게는 부담이 됩니다.\n\nEthereumStratum/2.0.0은 주로 NiceHash의 EthereumStratum/1.0.0을 바탕으로, 잘 정의되고 바이트를 아끼는 프로토콜 하나를 제안합니다.\n\n## 어떻게 동작하나요?\n\n- 메시지는 JSON-RPC 2.0이며 한 줄에 하나씩 `\\n`으로 끝나지만 줄여져 있습니다. `jsonrpc` 멤버는 항상 생략되고, `id`는 0~65535의 정수여야 하며, 숫자는 `0x`나 앞의 0 없이 소문자 16진수로 보냅니다.\n- **핸드셰이크:** 클라이언트가 `mining.hello`(agent, host, port, protocol)를 보냅니다. 서버는 자신의 프로토콜, 이후 모든 메시지를 gzip으로 압축할지 여부, 세션을 재개할 수 있는지, 유휴 타임아웃, 최대 오류 횟수를 응답합니다.\n- **세션:** `mining.subscribe`가 세션을 시작하거나 재개합니다. `mining.authorize`는 각 워커(`account.machine`)를 등록하고 이후 메시지에서 쓰는 짧은 토큰을 반환합니다.\n- **설정:** `mining.set`은 거의 바뀌지 않는 값을 보냅니다(시드 해시 대신 에포크 번호, 타깃, 알고리즘, 각 채굴자에게 고유한 nonce 범위를 주는 `extranonce` 접두사).\n- **작업:** `mining.notify`는 작업 ID, 블록 번호, 헤더 해시, \"이전 셰어는 오래됨(stale)\" 플래그를 보냅니다. `mining.submit`은 작업 ID, nonce 접미사(extranonce 제외), 워커 토큰을 반환합니다.\n- 기타: `mining.hashrate` 보고, `mining.noop`, `mining.reconnect`, `mining.bye`.\n\n## 샘플 코드\n\n일반적인 주고받기(한 줄에 JSON 객체 하나):\n\n```json\n{\"id\":0,\"method\":\"mining.hello\",\"params\":{\"agent\":\"ethminer-0.17\",\"host\":\"pool.example\",\"port\":\"4d2\",\"proto\":\"EthereumStratum/2.0.0\"}}\n{\"id\":0,\"result\":{\"proto\":\"EthereumStratum/2.0.0\",\"encoding\":\"plain\",\"resume\":\"1\",\"timeout\":\"b4\",\"maxerrors\":\"5\",\"node\":\"Geth/v1.8.18\"}}\n{\"id\":1,\"method\":\"mining.subscribe\"}\n{\"id\":2,\"method\":\"mining.authorize\",\"params\":[\"0xYourAccount.rig1\",\"x\"]}\n{\"id\":2,\"result\":\"w-123\"}\n{\"method\":\"mining.set\",\"params\":{\"epoch\":\"dc\",\"target\":\"0112e0be826d694b2e62d01511f12a6061fbaec8bc02357593e70e52ba\",\"algo\":\"ethash\",\"extranonce\":\"af4c\"}}\n{\"method\":\"mining.notify\",\"params\":[\"bf0488aa\",\"6526d5\",\"645cf20198c2f3861e947d4f67e3ab63b7b2e24dcc9095bd9123e7b33371f6cc\",\"0\"]}\n{\"id\":31,\"method\":\"mining.submit\",\"params\":[\"bf0488aa\",\"68765fccd712\",\"w-123\"]}\n{\"id\":31}\n```\n\n여기서 전체 nonce는 extranonce에 제출된 접미사를 붙인 `af4c68765fccd712`입니다.\n\n## 알아둘 점\n\n- 상태는 **Stagnant**입니다. 풀과 채굴자는 계속해서 여러 방언을 섞어 사용했습니다.\n- 이더리움 메인넷은 The Merge([EIP-3675](/eip-3675/))에서 작업 증명 사용을 멈췄으므로, 이 프로토콜은 이더리움 자체와는 더 이상 관련이 없습니다. Ethash 기반의 다른 체인에는 여전히 관심거리일 수 있습니다.\n- 이전 Stratum 변종과 달리 클라이언트가 먼저 말합니다(`mining.hello`). 서버가 트래픽 증폭 공격에 악용되는 것을 막기 위해서입니다.\n- extranonce는 앞의 0을 유지해야 하며(`\"01ac\"`와 `\"1ac\"`는 서로 다른 nonce 범위를 줍니다), 풀은 최대 16진수 6자까지만 사용할 수 있습니다.\n"},"zh":{"lang":"zh","tldr":"为以太坊工作量证明矿工和矿池提出的紧凑的、基于 TCP 的 JSON Stratum 协议，旨在取代目前使用的众多互不兼容的 Stratum 变体。","tags":["mining","stratum","pool","proof-of-work","protocol"],"related":[3675],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-1571/","markdown":"## 它解决什么问题？\n\n工作量证明的矿工很少运行完整节点；他们连接到矿池，由矿池分发任务并收集结果。矿池使用的是\"Stratum\"，这是一条持久的 TCP 连接，承载按行分隔的 JSON 消息。但以太坊从未有过官方的 Stratum 规范，因此每个矿池都说着自己的方言，挖矿软件只能猜测自己面对的是哪一种。\n\n这些消息也很冗长。规范估计，一条典型的 `mining.notify` 约为 240 字节，每个区块一个任务、面对数万个连接时，数量会迅速累积，对网络条件差的矿工也不利。\n\nEthereumStratum/2.0.0 提出了一个定义明确、节省字节的协议，主要基于 NiceHash 的 EthereumStratum/1.0.0 构建。\n\n## 它如何运作\n\n- 消息采用 JSON-RPC 2.0，每行一条，以 `\\n` 结尾，但做了精简：始终省略 `jsonrpc` 成员，`id` 必须是 0–65535 的整数，数字以不带 `0x` 和前导零的小写十六进制发送。\n- **握手：** 客户端发送 `mining.hello`（agent、host、port、protocol）。服务器回复其协议、是否对此后所有消息进行 gzip 压缩、会话是否可以恢复、空闲超时以及最大错误次数。\n- **会话：** `mining.subscribe` 开始或恢复会话；`mining.authorize` 注册每个工作者（`account.machine`），并返回一个在后续消息中使用的短令牌。\n- **设置：** `mining.set` 发送很少变化的值（用纪元编号代替种子哈希、目标值、算法，以及一个让每个矿工拥有各自 nonce 范围的 `extranonce` 前缀）。\n- **工作：** `mining.notify` 发送任务 ID、区块号、区块头哈希，以及一个\"之前的份额已过期（stale）\"标志。`mining.submit` 返回任务 ID、nonce 后缀（不含 extranonce）和工作者令牌。\n- 其他：`mining.hashrate` 上报、`mining.noop`、`mining.reconnect` 和 `mining.bye`。\n\n## 示例代码\n\n一次典型的交互（每行一个 JSON 对象）：\n\n```json\n{\"id\":0,\"method\":\"mining.hello\",\"params\":{\"agent\":\"ethminer-0.17\",\"host\":\"pool.example\",\"port\":\"4d2\",\"proto\":\"EthereumStratum/2.0.0\"}}\n{\"id\":0,\"result\":{\"proto\":\"EthereumStratum/2.0.0\",\"encoding\":\"plain\",\"resume\":\"1\",\"timeout\":\"b4\",\"maxerrors\":\"5\",\"node\":\"Geth/v1.8.18\"}}\n{\"id\":1,\"method\":\"mining.subscribe\"}\n{\"id\":2,\"method\":\"mining.authorize\",\"params\":[\"0xYourAccount.rig1\",\"x\"]}\n{\"id\":2,\"result\":\"w-123\"}\n{\"method\":\"mining.set\",\"params\":{\"epoch\":\"dc\",\"target\":\"0112e0be826d694b2e62d01511f12a6061fbaec8bc02357593e70e52ba\",\"algo\":\"ethash\",\"extranonce\":\"af4c\"}}\n{\"method\":\"mining.notify\",\"params\":[\"bf0488aa\",\"6526d5\",\"645cf20198c2f3861e947d4f67e3ab63b7b2e24dcc9095bd9123e7b33371f6cc\",\"0\"]}\n{\"id\":31,\"method\":\"mining.submit\",\"params\":[\"bf0488aa\",\"68765fccd712\",\"w-123\"]}\n{\"id\":31}\n```\n\n这里完整的 nonce 是 extranonce 加上提交的后缀：`af4c68765fccd712`。\n\n## 需要注意\n\n- 状态为 **Stagnant**。矿池和矿工继续混用多种方言。\n- 以太坊主网在 The Merge（[EIP-3675](/eip-3675/)）时停止使用工作量证明，因此该协议已与以太坊本身无关；它可能仍会让其他基于 Ethash 的链感兴趣。\n- 与早期的 Stratum 变体不同，由客户端先发言（`mining.hello`），以避免服务器被用于流量放大攻击。\n- extranonce 必须保留前导零（`\"01ac\"` 和 `\"1ac\"` 对应不同的 nonce 范围），矿池最多可使用 6 个十六进制字符。\n"}}}
