Skip to content

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

Template Provider

Network & Protocol

Definition

A Template Provider is the Stratum V2 component that constructs candidate block templates from a node's mempool and serves them to mining software. It is the source of truth about what a block could contain, and in a self-hosted setup it runs as part of, or directly alongside, the miner's own Bitcoin full node. Running your own Template Provider is what makes genuine transaction selection possible: instead of trusting a remote pool's idea of which transactions belong in the next block, your node builds the template from your own mempool, under your own policy.

What it produces

The Template Provider speaks the Template Distribution Protocol, a small message set within Stratum V2. Its central message is NewTemplate, carrying a unique, strictly increasing template_id, the block version, coinbase details (prefix, input sequence, locktime), the satoshis remaining for the miner's outputs, the serialized pool outputs, and the merkle path needed to build a valid header. Before that, the downstream side declares via CoinbaseOutputDataSize how much additional coinbase space and sigop budget the pool will add, so every template reserves exactly the right room and the result is always consensus-valid. When a new best block arrives, the provider issues SetNewPrevHash, referencing a previously sent template and pointing the miner at the new previous-block hash, timestamp, difficulty bits, and target to mine against. Downstream software can also fetch a template's full transaction set with RequestTransactionData, and if a miner solves a block it returns the solution, with its complete coinbase, via SubmitSolution.

A push model, not polling

Unlike the old getblocktemplate RPC, where mining software repeatedly polls the node and hopes it asked at the right moment, a Template Provider proactively pushes updates at the moments they matter: a new block found, or a mempool shift that meaningfully changes fees. Templates can even be sent as future templates before the triggering block arrives, so the activating SetNewPrevHash is a tiny message and no time is wasted rebuilding work at the most valuable instant in mining. The specification also requires that a Template Provider attempt to broadcast any block mined from work it provided, so it tracks the work it has distributed rather than acting as a fire-and-forget feed.

Why it matters for decentralization

Template construction is where censorship would happen if it happened. When only pools build templates, a handful of operators decide which transactions the network confirms. The Template Provider inverts that: paired with the Job Declarator, a miner can build work from its own node and declare it to the pool, keeping pooled payouts while reclaiming transaction selection. In a fully sovereign deployment the Template Provider, the Job Declarator client, and the mining device run under one operator's roof, one more layer of mining brought back under the miner's own keys and policy. For the wire format itself, see the Template Distribution Protocol; for the negotiation that carries self-built work to a pool, see the Job Declaration Protocol.

Adoption is still early, and honesty about that helps: most pooled hashrate today mines pool-built templates, and running the full sovereign chain, node, Template Provider, Job Declarator, SV2 firmware, remains an enthusiast's discipline rather than a default. But the direction matters. Every miner who builds work from a local node converts censorship from a policy decision at a handful of companies into something that must defeat thousands of independent operators, and the protocol machinery described above exists precisely so that choice costs the miner almost nothing in revenue. Decentralizing template construction is not a feature of Stratum V2; it is the point of it.

In Simple Terms

A Template Provider is the Stratum V2 component that constructs candidate block templates from a node’s mempool and serves them to mining software. It is…

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