Blockchain/Level III · The network/3.2 Mining/Lesson 5
Block templates and Stratum V2
The header job, the template choice, and who holds the pen
MaterialsThe Stratum V2 specification (stratumprotocol.org)BIP22 and BIP23
Wonder
- Why does a miner with dedicated hardware still rely on a pool operator to decide which transactions enter a block?
- What lets a pooled miner choose the transactions in its own blocks while still sharing the pool’s rewards?
- How does the shift from JSON to binary protocols address both security and efficiency in high-speed mining operations?
Explore
- Since the protocol’s inception, every valid block requires a selection of transactions. In the early days, miners running full nodes chose these themselves. By 2012, with hardware becoming specialized and expensive, most joined pools. The Stratum protocol, introduced by Slush in that year, standardized how pool servers distributed work to their members. Pools had built the blocks since 2010; Stratum made the arrangement far more efficient and inherited its centralization of block construction.
- Under Stratum V1, the pool operator acts as the sole architect of each candidate block. The server aggregates transactions from its own mempool, and sends miners the pieces of a job: the two halves of the coinbase transaction, the Merkle branch, the previous block hash, the target and the time. The miner inserts its own extra-nonce, computes the Merkle root and searches for a valid hash, but has no say over which transactions are included.
- This architecture grants pool operators significant power over transaction selection. A pool controlling a substantial portion of the network’s hashrate can effectively censor transactions by simply excluding them from its templates. While this is rarely exercised, the structural capacity for it exists. It also means that if a pool server goes down or suffers a denial-of-service attack, all its connected miners are idle, creating a single point of failure for their revenue.
- In 2012, BIP22 and BIP23 introduced `getblocktemplate`, which let mining software request a complete block template from a node and was designed so that pool members could build their own blocks. Pools use getblocktemplate internally to fetch templates from their own nodes, but letting members build their own blocks complicated validation and share accounting, and few pools offered it (Eligius was an exception).
- Stratum V2, developed from 2019 onward by Braiins and Matt Corallo among others, redesigned the protocol to address these issues. It introduces a binary format for lower overhead and encryption for security. Crucially, it includes the Job Declaration Protocol. This allows a miner running their own full node to declare their own block template to the pool server. The pool then accepts shares from this custom job, splitting rewards according to its standard scheme, while the miner retains control over transaction inclusion.
- Alternative efforts like Ocean’s DATUM protocol (2024) pursue similar goals of decentralizing template construction. Read the Job Declaration section of the Stratum V2 specification and compare it with how a pool you know builds its templates. Where these protocols are adopted, the choice of transactions moves back toward the owners of the hardware.
Key facts
- Stratum V1, introduced by Slush in 2012, centralizes block template creation with pool operators.
- In Stratum V1, miners receive only header jobs and have no influence over transaction selection.
- BIP22/BIP23 (2012) defined getblocktemplate; few pools let members use it to build their own blocks.
- Stratum V2 (from 2019) uses a binary protocol with encryption for improved security and efficiency.
- The Job Declaration Protocol in Stratum V2 allows miners to submit their own block templates to the pool.
- Ocean’s DATUM protocol (2024) is another effort aimed at decentralizing transaction selection among pooled miners.
Exercise nine, six, three, one
9CollectList 9 decisions involved in producing a block (for example which transactions to include, the coinbase message, the timestamp, the nonce) and note who makes each under Stratum V1.
6ClusterGroup the 9 into 6 by who controls them: pool, miner, node software, consensus rules, chance, or other.
3DistillReduce the 6 categories to 3 core reasons why transaction selection power is economically and politically significant for block producers.
1CrystallizeWrite 1 sentence explaining how Job Declaration in Stratum V2 alters the balance of power between pool operators and individual miners.
Fact check
Dates, figures and claims checked against the published sources listed below.