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 rather than trusting a remote pool's idea of which transactions belong in the block.
What it produces
The Template Provider builds a NewTemplate message containing a unique template_id, version bits, coinbase details, the value available for outputs, and the merkle path. It reserves blockspace for the header, the transaction count, fixed coinbase fields, and variable pool outputs so the result is always consensus-valid. When a new best block arrives it issues SetNewPrevHash, pointing the miner at the previous block hash, timestamp, difficulty bits, and target to mine against.
A push model, not polling
Unlike the old getblocktemplate RPC where mining software repeatedly polls the node, a Template Provider proactively pushes updates at the moments they matter, such as when a new block is found or the mempool shifts materially. The specification also requires that a Template Provider attempt to broadcast any block mined from work it provided, so it must track the work it has distributed.
In a fully sovereign deployment the Template Provider, the Job Declarator client, and the mining device run under one operator. For the wire format that carries templates from node to miner, see the Template Distribution Protocol.
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…
