Skip to content

Bitcoin accepted at checkout  |  Ships from Laval, QC, Canada  |  Expert support since 2016

Stratum Protocol

Intermediate Network & Protocol

Also known as: Stratum, Stratum v1, Stratum v2

Definition

Stratum is the protocol that lets a mining device talk to a mining pool: the pool hands out work, the miner returns valid partial solutions (shares), and the pool tracks contribution and pays out. It replaced the older HTTP-based getwork polling with a persistent, push-based connection. It is also known as Stratum, Stratum v1, and Stratum v2.

Stratum v1 is the current real-world standard. It runs JSON-RPC 2.0 over a long-lived TCP socket, with every message newline-terminated. The connection follows a fixed lifecycle: an optional mining.configure (used to negotiate extensions), then mining.subscribe, then mining.authorize. After authorization the pool pushes work down the same socket — mining.set_difficulty sets the target, and mining.notify delivers the actual job: a job ID, previous block hash, the two halves of the coinbase transaction, the merkle branches, the block version, nBits, nTime, and a clean-jobs flag. The miner then returns results with mining.submit (worker name, job ID, extranonce2, nTime, nonce).

How Stratum touches the metal

On a real ASIC, the firmware on the control board is the Stratum client. It maintains the TCP connection, parses each mining.notify, reconstructs the 80-byte block header, and streams work down to the hashboards. The board’s chips iterate the nonce space looking for a hash at or below the pool target, and any hit is sent back up as a share. The pool target is derived from the value in mining.set_difficulty (roughly target = 2^256 / (65536 × difficulty)), so the same protocol message that arrives over the wire ultimately decides how often a given board reports a result.

Two practical extensions matter on most modern hardware. The first is BIP320 version-rolling, negotiated through mining.configure: the pool hands back a version mask, and the miner is allowed to roll bits in the block version field — this is what enables overt ASICBoost. The mask must always come from the pool’s configure reply and is never hardcoded, because it varies by pool. The second is the set of Bitmain v1 extensions widely supported by Antminer-class firmware, including mining.extranonce.subscribe (opt in to extranonce changes mid-session, sent only after authorize succeeds) and pool-pushed messages like client.reconnect and client.show_message.

Stratum v2 and self-sovereign templates

Stratum v2 is the upgraded protocol. It swaps JSON text for a compact binary framing (a 6-byte header of extension type, message type, and length, followed by the body) and wraps the whole session in the Noise protocol for authenticated encryption — closing the door on the share-stealing and credential-sniffing that plagued plaintext v1. Its most consequential feature is moving block-template construction toward the miner. Instead of blindly accepting whatever transaction set the pool chooses, a miner using the appropriate channel type can build its own coinbase and select transactions, with the pool providing only difficulty accounting. That is a direct decentralization win, because it removes the pool’s ability to silently censor transactions — one more layer of the system pushed back toward the people running the hardware.

There is a hardware caveat worth knowing. Stratum v2 Standard Channels let the pool assign the extranonce and pick the work, which works for newer chips but can starve older designs. On an S9-class machine, the BM1387’s 32-bit nonce combined with the small work-id field exhausts the search space in a couple of seconds and the board effectively stalls. The fix is to stay on v1, or to use v2 Extended Channels, where the miner controls its own coinbase and extranonce2 and can keep the hashboards fed. This is the kind of detail that separates a spec on paper from firmware that actually keeps a fleet hashing.

A related family of protocols, such as OCEAN’s DATUM, reaches the same goal — miner-built templates — while staying on the familiar Stratum v1 wire format, so existing firmware can participate with smaller changes.

  • v1: JSON-RPC over TCP, universally supported, pool builds the template.
  • v2: binary + encrypted, miner can build its own template via the right channel type.
  • Pool failover: good firmware keeps an ordered pool list and switches on disconnects, share-reject streaks, or a stalled work feed.

If you are choosing or repairing hardware, Stratum behavior is part of the spec sheet that never makes the spec sheet — it decides which firmware and pools a given board can run cleanly. You can compare the gear we stock on the miners overview or browse the full shop, and dig into related plumbing through Mining Pool, Block Template, and Getwork, the polling scheme Stratum replaced.

In Simple Terms

The protocol miners use to communicate with pools. Stratum v2 adds encryption and miner-selected transactions.

Stratum is the protocol that lets a mining device talk to a mining pool: the pool hands out work, the miner returns valid partial solutions (shares), and the pool tracks contribution and pays out. It replaced the older HTTP-based getwork polling with a persistent, push-based connection. It is also known as Stratum, Stratum v1, and Stratum v2.

Stratum v1 is the current real-world standard. It runs JSON-RPC 2.0 over a long-lived TCP socket, with every message newline-terminated. The connection follows a fixed lifecycle: an optional mining.configure (used to negotiate extensions), then mining.subscribe, then mining.authorize. After authorization the pool pushes work down the same socket — mining.set_difficulty sets the target, and mining.notify delivers the actual job: a job ID, previous block hash, the two halves of the coinbase transaction, the merkle branches, the block version, nBits, nTime, and a clean-jobs flag. The miner then returns results with mining.submit (worker name, job ID, extranonce2, nTime, nonce).

How Stratum touches the metal

On a real ASIC, the firmware on the control board is the Stratum client. It maintains the TCP connection, parses each mining.notify, reconstructs the 80-byte block header, and streams work down to the hashboards. The board's chips iterate the nonce space looking for a hash at or below the pool target, and any hit is sent back up as a share. The pool target is derived from the value in mining.set_difficulty (roughly target = 2^256 / (65536 × difficulty)), so the same protocol message that arrives over the wire ultimately decides how often a given board reports a result.

Two practical extensions matter on most modern hardware. The first is BIP320 version-rolling, negotiated through mining.configure: the pool hands back a version mask, and the miner is allowed to roll bits in the block version field — this is what enables overt ASICBoost. The mask must always come from the pool's configure reply and is never hardcoded, because it varies by pool. The second is the set of Bitmain v1 extensions widely supported by Antminer-class firmware, including mining.extranonce.subscribe (opt in to extranonce changes mid-session, sent only after authorize succeeds) and pool-pushed messages like client.reconnect and client.show_message.

Stratum v2 and self-sovereign templates

Stratum v2 is the upgraded protocol. It swaps JSON text for a compact binary framing (a 6-byte header of extension type, message type, and length, followed by the body) and wraps the whole session in the Noise protocol for authenticated encryption — closing the door on the share-stealing and credential-sniffing that plagued plaintext v1. Its most consequential feature is moving block-template construction toward the miner. Instead of blindly accepting whatever transaction set the pool chooses, a miner using the appropriate channel type can build its own coinbase and select transactions, with the pool providing only difficulty accounting. That is a direct decentralization win, because it removes the pool's ability to silently censor transactions — one more layer of the system pushed back toward the people running the hardware.

There is a hardware caveat worth knowing. Stratum v2 Standard Channels let the pool assign the extranonce and pick the work, which works for newer chips but can starve older designs. On an S9-class machine, the BM1387's 32-bit nonce combined with the small work-id field exhausts the search space in a couple of seconds and the board effectively stalls. The fix is to stay on v1, or to use v2 Extended Channels, where the miner controls its own coinbase and extranonce2 and can keep the hashboards fed. This is the kind of detail that separates a spec on paper from firmware that actually keeps a fleet hashing.

A related family of protocols, such as OCEAN's DATUM, reaches the same goal — miner-built templates — while staying on the familiar Stratum v1 wire format, so existing firmware can participate with smaller changes.

  • v1: JSON-RPC over TCP, universally supported, pool builds the template.
  • v2: binary + encrypted, miner can build its own template via the right channel type.
  • Pool failover: good firmware keeps an ordered pool list and switches on disconnects, share-reject streaks, or a stalled work feed.

If you are choosing or repairing hardware, Stratum behavior is part of the spec sheet that never makes the spec sheet — it decides which firmware and pools a given board can run cleanly. You can compare the gear we stock on the miners overview or browse the full shop, and dig into related plumbing through Mining Pool, Block Template, and Getwork, the polling scheme Stratum replaced.

Explore the Full Glossary

Browse all Bitcoin mining terms from A to Z. Whether you are a beginner or expert, deepen your understanding of the mining ecosystem.

Mining Glossary

ASIC Miner Database

Compare 500+ miners with real-time profitability data, home mining scores, and detailed specs.

Compare Miners