Skip to content

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

Block Template

Advanced Network & Protocol

Also known as: Block candidate, Work unit

Definition

A block template is the complete block candidate a miner hashes against: the 80-byte block header fields plus the ordered set of transactions (including the coinbase) that would be committed if a valid solution is found. It is the unit of work that turns raw hashrate into a potential new block on the Bitcoin chain.

Every share your ASIC submits and every block the network discovers traces back to a template. Whoever builds that template decides which transactions get into the next block, which makes template construction one of the quietest but most important levers of decentralization in the entire mining stack.

What a block template actually contains

A template carries two things: the data needed to assemble the block header, and the transaction set that header commits to. The header is a fixed 80 bytes, laid out as version, previous block hash, Merkle root, ntime (timestamp), nbits (the encoded difficulty target), and the nonce. The Merkle root is not stored loose; it is computed by folding the coinbase transaction hash together with a list of Merkle branches that summarize all the other transactions in the block.

That coinbase transaction is the heart of the template. It is the first transaction in the block, it has no inputs, and it pays the block subsidy plus the total transaction fees to an address the template builder chooses. Because the coinbase commits to a payout address, control over the template ultimately means control over where freshly mined bitcoin lands.

How templates reach your ASIC

In conventional pooled mining over the Stratum protocol (Stratum V1), the pool builds the template and pushes it to your hardware in a mining.notify message. That message does not send the whole template down the wire — it sends the pieces a miner needs to vary its work: a job ID, the previous-block hash, two coinbase halves (coinb1 and coinb2), the Merkle branches, the version, nbits, ntime, and a clean-jobs flag.

Your miner reconstructs the full coinbase locally by concatenating coinb1 || extranonce1 || extranonce2 || coinb2, where extranonce1 is assigned by the pool during mining.subscribe and extranonce2 is a value the miner is free to choose. Hashing the assembled coinbase and folding it through the Merkle branches yields the Merkle root, which slots into the header. The ASIC then builds a midstate from the first 64 bytes of that 80-byte header and grinds the nonce — and, on modern hardware, rolls the version bits within a pool-negotiated mask — searching for a hash at or below the target.

This split design is efficient: the pool sends one compact job, and each miner can generate an enormous search space by varying extranonce2, the nonce, version bits, and ntime, all without the pool resending a fresh template for every attempt.

Who controls the template, and why it matters

Under standard Stratum V1, the pool selects the transactions, so the pool effectively decides what the network confirms next. That centralizes a meaningful amount of power in a handful of large pools. Two protocol directions push template-building back toward the miner:

  • Stratum V2 extended channels and job declaration. An extended channel lets the miner control the coinbase and extranonce and supply its own Merkle path, so the miner can construct its own block template rather than blindly hashing the pool’s. The pool still handles payout accounting and difficulty, but transaction selection can move to the miner.
  • DATUM (OCEAN). Rather than replacing Stratum, DATUM is an overlay on Stratum V1. The miner runs a local gateway alongside a full node, builds its own template from its own mempool view via the node’s getblocktemplate RPC, and the pool sees only Merkle branches instead of the full template. If the miner finds a block, the miner broadcasts it.

In solo mining — including a hobby rig like a Bitaxe pointed at your own node — there is no pool in the loop at all. Your node hands a template to the miner directly, you choose the transactions, and you keep the full reward if you win. That is the most sovereign form of template construction available.

Practical notes for operators

The version, nbits, and previous-block hash in a template change roughly when the network finds a new block, which is why a fresh mining.notify with the clean-jobs flag set tells your miner to drop stale work immediately and start hashing the new template. The transaction set inside a template is normally ordered by fee rate to maximize the fees captured in the coinbase, so template quality has a direct effect on revenue when the mempool is congested. Whether you run firmware capable of self-built templates is a question of proof-of-work philosophy as much as economics — building your own templates is one more layer of the network you no longer have to trust someone else to handle.

If you want the kind of setup where you build your own templates against your own node — solo mining a Bitaxe, or running a sovereignty-minded home rig — explore the open-source and small-scale mining hardware in our Bitaxe hub to see what fits your goals.

In Simple Terms

A candidate block that miners hash. Contains selected transactions and metadata ready for mining.

A block template is the complete block candidate a miner hashes against: the 80-byte block header fields plus the ordered set of transactions (including the coinbase) that would be committed if a valid solution is found. It is the unit of work that turns raw hashrate into a potential new block on the Bitcoin chain.

Every share your ASIC submits and every block the network discovers traces back to a template. Whoever builds that template decides which transactions get into the next block, which makes template construction one of the quietest but most important levers of decentralization in the entire mining stack.

What a block template actually contains

A template carries two things: the data needed to assemble the block header, and the transaction set that header commits to. The header is a fixed 80 bytes, laid out as version, previous block hash, Merkle root, ntime (timestamp), nbits (the encoded difficulty target), and the nonce. The Merkle root is not stored loose; it is computed by folding the coinbase transaction hash together with a list of Merkle branches that summarize all the other transactions in the block.

That coinbase transaction is the heart of the template. It is the first transaction in the block, it has no inputs, and it pays the block subsidy plus the total transaction fees to an address the template builder chooses. Because the coinbase commits to a payout address, control over the template ultimately means control over where freshly mined bitcoin lands.

How templates reach your ASIC

In conventional pooled mining over the Stratum protocol (Stratum V1), the pool builds the template and pushes it to your hardware in a mining.notify message. That message does not send the whole template down the wire — it sends the pieces a miner needs to vary its work: a job ID, the previous-block hash, two coinbase halves (coinb1 and coinb2), the Merkle branches, the version, nbits, ntime, and a clean-jobs flag.

Your miner reconstructs the full coinbase locally by concatenating coinb1 || extranonce1 || extranonce2 || coinb2, where extranonce1 is assigned by the pool during mining.subscribe and extranonce2 is a value the miner is free to choose. Hashing the assembled coinbase and folding it through the Merkle branches yields the Merkle root, which slots into the header. The ASIC then builds a midstate from the first 64 bytes of that 80-byte header and grinds the nonce — and, on modern hardware, rolls the version bits within a pool-negotiated mask — searching for a hash at or below the target.

This split design is efficient: the pool sends one compact job, and each miner can generate an enormous search space by varying extranonce2, the nonce, version bits, and ntime, all without the pool resending a fresh template for every attempt.

Who controls the template, and why it matters

Under standard Stratum V1, the pool selects the transactions, so the pool effectively decides what the network confirms next. That centralizes a meaningful amount of power in a handful of large pools. Two protocol directions push template-building back toward the miner:

  • Stratum V2 extended channels and job declaration. An extended channel lets the miner control the coinbase and extranonce and supply its own Merkle path, so the miner can construct its own block template rather than blindly hashing the pool's. The pool still handles payout accounting and difficulty, but transaction selection can move to the miner.
  • DATUM (OCEAN). Rather than replacing Stratum, DATUM is an overlay on Stratum V1. The miner runs a local gateway alongside a full node, builds its own template from its own mempool view via the node's getblocktemplate RPC, and the pool sees only Merkle branches instead of the full template. If the miner finds a block, the miner broadcasts it.

In solo mining — including a hobby rig like a Bitaxe pointed at your own node — there is no pool in the loop at all. Your node hands a template to the miner directly, you choose the transactions, and you keep the full reward if you win. That is the most sovereign form of template construction available.

Practical notes for operators

The version, nbits, and previous-block hash in a template change roughly when the network finds a new block, which is why a fresh mining.notify with the clean-jobs flag set tells your miner to drop stale work immediately and start hashing the new template. The transaction set inside a template is normally ordered by fee rate to maximize the fees captured in the coinbase, so template quality has a direct effect on revenue when the mempool is congested. Whether you run firmware capable of self-built templates is a question of proof-of-work philosophy as much as economics — building your own templates is one more layer of the network you no longer have to trust someone else to handle.

If you want the kind of setup where you build your own templates against your own node — solo mining a Bitaxe, or running a sovereignty-minded home rig — explore the open-source and small-scale mining hardware in our Bitaxe hub to see what fits your goals.

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