Stratum v2
Stratum V2
Stratum V2 (often abbreviated SV2) is an open mining protocol for Bitcoin. It is the successor to the original Stratum protocol (retroactively called Stratum V1), which was introduced in 2012 and became the de facto standard for communication between mining hardware and mining pools despite never being formally designed as one. Stratum V2 was designed by Jan Čapek and Pavel Moravec together with Matt Corallo, and is maintained by an independent open-source community. It aims to make mining more efficient, secure, and decentralized.
The most significant change from V1 is that Stratum V2 lets individual miners choose the set of transactions they mine, rather than leaving that choice entirely to the pool operator. This is intended to improve the censorship resistance and decentralization of the network. The protocol also replaces V1's verbose JSON-RPC messaging with a compact binary format, adds an encrypted and authenticated transport, and natively supports features such as version rolling.
Improvements over Stratum V1
Stratum V2 was designed to address a number of long-standing issues with V1:
- Binary protocol. V1 used human-readable JSON, which is bandwidth-heavy and imprecise. V2 uses a compact, precisely specified binary format, reportedly reducing bandwidth by roughly 60% for pools and 70% for miners while also lowering CPU load.
- Encryption and authentication. V2 connections use an authenticated encryption scheme based on the Noise Protocol Framework, protecting against eavesdropping and hashrate hijacking, which plaintext V1 connections were vulnerable to.
- Transaction selection by miners. Through a dedicated sub-protocol, miners can build and declare their own block templates instead of relying on the pool.
- Native version rolling. Support for rolling the block header version bits (as defined in BIP320, e.g. for version-rolling AsicBoost) is a first-class part of the protocol.
- Header-only mining. Where possible, mining devices can work without touching the coinbase transaction, reducing on-device complexity and network traffic.
- Reduced stale shares and more precise hashrate measurement through efficiency improvements.
- Optional telemetry for farm monitoring, without forcing miners to give up privacy.
- Connection aggregation and multiple jobs over a single connection, with a clean extension mechanism for vendor-specific features.
Sub-protocols
Stratum V2 is composed of three distinct sub-protocols:
- Mining Protocol — the main protocol and direct successor to V1. It carries mining jobs and share submissions between a mining device and its upstream node, pool, or proxy. It is required in all configurations; when transaction selection is not used, it is the only protocol needed.
- Job Declaration Protocol (JD) — lets a miner or mining farm declare a self-chosen block template to a pool. A single declaration can be reused across many mining connections, so it is kept separate from share submission and can run on separate infrastructure. (In earlier drafts this was called the Job Negotiation Protocol.)
- Template Distribution Protocol — an efficient replacement for Bitcoin Core's
getblocktemplatefor obtaining information about the next block from a full node.
Roles
The specification defines five roles that software or hardware can implement (a single piece of software may fill more than one):
- Mining Device — the hardware that actually computes hashes.
- Pool Service — produces jobs, validates shares, and propagates found blocks.
- Mining Proxy (optional) — sits between mining devices and a pool, aggregating connections for efficiency and optionally adding monitoring or custom work.
- Job Declarator (optional) — split into a Job Declarator Client (miner side) and Job Declarator Server (typically pool side), used to declare custom templates via the Job Declaration Protocol.
- Template Provider — generates custom block templates, usually a Bitcoin Core full node.
Message framing
Stratum V2 uses fixed-length message framing. Every message begins with a six-byte header consisting of an extension_type (U16), a msg_type (U8), and a msg_length (U24), followed by a variable-length payload. Multibyte integers are serialized little-endian. The framing and an extensible Type-Length-Value (TLV) model allow the protocol to be extended without breaking compatibility, with extension identifiers allocated through stratumprotocol.org.
Reference implementation (SRI)
The Stratum Reference Implementation (SRI) is a community-maintained, open-source implementation written in Rust. It is organized across multiple repositories:
- stratum-mining/stratum — the low-level protocol libraries (encoding/decoding, framing, Noise encryption, channels, and the sub-protocol definitions).
- sv2-apps — the application-level roles, such as the pool, translation proxy, and job declarator (currently in alpha).
Because mining hardware still overwhelmingly speaks V1, SRI also provides a Translation Proxy (tProxy) that translates between V1 mining devices and a V2 upstream, allowing existing hardware to connect to V2 pools without firmware changes. This can optionally be combined with a Job Declarator so that a farm running V1 firmware can still declare its own block templates to a V2 pool.
For current build and configuration instructions, which change as the software evolves, see the official documentation.