Stratum v1

From claude-dev-suite/claude-dev-suite · View interactive version

Stratum v1 is an AI agent skill from the GitHub repository claude-dev-suite/claude-dev-suite. Stratum V1: TCP/JSON protocol between mining pool and miners. Subscribe, authorize, mining.notify, mining.submit. Most-used protocol but security/decentralization weaknesses. USE WHEN: integrating mining hardware, building pool / proxy software, debugging hash submission.

How to use this skill

Skill file

Stratum V1

The dominant protocol between pool servers and mining hardware

(ASIC). Plain TCP, line-based JSON-RPC. Ad-hoc spec; no formal RFC.

Connection

[Miner] ──── TCP connect ────► [Pool]
       ──── mining.configure ─►   (optional, BIP 310)
       ◄── extension results ──
       ──── mining.subscribe ──►
       ◄── subscription_id ────
       ──── mining.authorize ─►
       ◄── true ─────────────
       ◄── mining.set_difficulty ─
       ◄── mining.notify ────────
       ──── mining.submit ────►
       ◄── true ─────────────

Key methods

`mining.configure` (BIP 310)

Feature negotiation, specified by BIP 310 "Stratum protocol

extensions" (Informational, assigned 10 March 2018, still Draft as of

September 2026). It SHOULD be the miner's first message. Its

Specification section lists three extension codes - version-rolling,

minimum-difficulty, subscribe-extranonce - and a fourth, info,

gets a section of its own.

{"method": "mining.configure", "id": 1,
 "params": [["version-rolling"],
            {"version-rolling.mask": "1fffe000",
             "version-rolling.min-bit-count": 2}]}

The pool answers with the intersection server_mask & miner_mask.

Once version-rolling is active:

nVersion = (job_version & ~last_mask) | (version_bits & last_mask).

immediately.

Which bits a pool may offer tracks the reserved nVersion range:

BIP 320 reserves bits 13-28 (0x1fffe000, 16 bits); BIP 323 (assigned

22 April 2026, Replaces: 320) reserves bits 5-28 (0x1fffffe0,

24 bits). Both are still Draft as of September 2026.

Without version rolling a miner can only roll the 32-bit nonce plus

extranonce2; BIP 320's motivation notes hardware exhausts the nonce

field in under 200 ms, which is why the extension exists.

`mining.subscribe`

Initial handshake. Miner gets:

`mining.authorize`

Miner sends username (typically wallet_address.worker_name).

`mining.set_difficulty`

Pool tells miner the share difficulty. Lower than actual block

difficulty so miners find shares frequently and pool can track

contribution.

`mining.notify` (push)

[
    "<job_id>",
    "<prev_hash>",
    "<coinbase_part_1>",
    "<coinbase_part_2>",
    [<merkle_branches>],
    "<version>",
    "<nbits>",
    "<ntime>",
    <clean_jobs>     // boolean
]

Miner builds:

bits where version-rolling was negotiated.

`mining.submit`

When miner finds valid share:

mining.submit(["<worker>", "<job_id>", "<extranonce2>", "<ntime>", "<nonce>"])

With version-rolling negotiated, a 6th parameter version_bits

follows <nonce> (BIP 310).

Pool verifies; rewards miner per share.

Pool decides everything

The fundamental issue: pool constructs the coinbase (including

which transactions to include in the block). Miner just hashes what

the pool sends. This means:

Pool fraud risks

Miner endpoint config

stratum+tcp://pool.example.com:3333
username: <wallet>.<worker>
password: anything (typically "x")

Status

endpoint at essentially every pool and on every shipping ASIC; no

published measurement pins the exact share down.

See also

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.