Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
LABS
Glossary

Block Template

A block template is a preliminary, unconfirmed block assembled by a miner or validator, containing selected transactions and a block header, which is then used to compete for block production in a proof-of-work or proof-of-stake system.
Chainscore © 2026
definition
BLOCKCHAIN CONSENSUS

What is a Block Template?

A block template is a preliminary, mutable data structure assembled by a node to propose the next block in a Proof-of-Work blockchain.

A block template is a partially constructed data package that a mining node or validator assembles to propose the next block in a Proof-of-Work (PoW) blockchain like Bitcoin. It contains all the necessary components—such as a list of pending transactions from the mempool, a reference to the previous block's hash, and a coinbase transaction—except for a valid nonce that satisfies the network's difficulty target. This template serves as the starting point for the computationally intensive mining process.

The construction of a block template is a critical step where the miner exercises discretion. Key decisions include transaction selection, which determines fee revenue and influences network congestion, and the setting of the coinbase reward address. Miners often use algorithms to prioritize transactions with the highest fees per byte (satoshis per vbyte). The template also includes a version field and a timestamp, and its header becomes the input for the hash function during the mining process.

Once assembled, the mining node iteratively modifies the block template by changing the nonce and potentially the extraNonce in the coinbase transaction, hashing the block header each time. This search continues until a hash is found that is below the current target difficulty. The first miner to find a valid solution broadcasts the completed block—now with the correct nonce—to the network for validation and addition to the blockchain, finalizing the template into an immutable block.

key-features
BLOCK PROPOSAL PRIMER

Key Features of a Block Template

A block template is a candidate block assembled by a node, containing the essential data structure that a miner or validator will attempt to finalize and add to the blockchain.

01

Header and Metadata

The template's core includes the block header, which contains cryptographic links to the previous block (parent hash), a timestamp, a nonce field for Proof-of-Work, and the Merkle root of all included transactions. This header is the primary data structure that gets hashed during mining or validation.

02

Transaction MemPool Selection

The node populates the template with transactions from its memory pool (mempool). Selection is typically based on:

  • Fee priority (fee per byte/gas)
  • Transaction validity and dependencies
  • Block size or gas limit constraints This creates a candidate set of transactions to be confirmed.
03

Coinbase Transaction

A special, first transaction in the template that creates new cryptocurrency (the block reward) and collects transaction fees from all other included transactions. It is payable to the miner or validator's address, serving as the economic incentive for block production.

04

Dynamic Target / Difficulty

For Proof-of-Work chains, the template includes the current network difficulty target. Miners repeatedly hash the block header, modifying the nonce, until they find a hash that is numerically lower than this target. The target adjusts periodically to maintain a consistent block time.

05

Template Finalization & Propagation

Once a valid proof (Proof-of-Work solution or validator signature) is found, the template is finalized into a complete block. The nonce and other header fields are updated, and the full block is broadcast to the peer-to-peer network for verification and addition to the canonical chain.

06

Consensus-Specific Fields

Templates include data required by the network's consensus mechanism:

  • PoW: Nonce, difficulty target.
  • PoS: Validator signature, stake-related data.
  • BFT: Pre-commit messages, validator set information. These fields ensure the block is valid under the specific protocol rules.
how-it-works
BLOCK PRODUCTION

How a Block Template is Created and Used

A block template is a preliminary, mutable data structure assembled by a node to propose the next block in a blockchain. This guide details its creation, composition, and critical role in consensus.

A block template is a preliminary, mutable data structure assembled by a node (typically a miner or validator) that serves as the proposed blueprint for the next block to be added to the blockchain. It contains all the necessary components—such as a header, a list of candidate transactions from the mempool, and other metadata—but lacks the final cryptographic proof required for network acceptance. The node creating the template acts as the block proposer for that round of consensus.

The creation process begins with the node selecting pending transactions from its mempool. This selection is governed by the protocol's rules and the proposer's strategy, often prioritizing transactions with the highest fees (in Proof-of-Work) or following specific scheduling algorithms (in Proof-of-Stake). The template's header includes critical fields: a reference to the previous block's hash, a timestamp, a nonce (for PoW), and the root of a Merkle tree summarizing the chosen transactions. This template is essentially a candidate block awaiting validation.

Once assembled, the block template is used differently depending on the consensus mechanism. In Proof-of-Work (e.g., Bitcoin), miners repeatedly hash the template's header while incrementing the nonce, searching for a value that produces a hash below the network's target difficulty. In Proof-of-Stake (e.g., Ethereum), the designated validator simply signs the completed template and broadcasts it. The template may also be shared with external mining hardware or staking pools, which perform the final computational or signing work.

The flexibility of the template is key to efficiency and decentralization. Miners can update the transaction set—adding new, higher-fee transactions or removing those that have been included elsewhere—without restarting the entire hashing process. This allows for optimal fee extraction and network responsiveness. In PoS systems, validators may have very little time to propose a block, making a pre-assembled template essential for timely execution.

Ultimately, when the required proof (a valid hash or signature) is found, the template is finalized into a complete block. The nonce or signature is inserted, the block is propagated to the peer-to-peer network, and other nodes verify its contents against the protocol rules. The block template, therefore, represents the crucial, mutable intermediate state between transaction selection and immutable block confirmation on the ledger.

components
BLOCK PROPOSAL BLUEPRINT

Core Components of a Block Template

A block template is a temporary, mutable data structure assembled by a node to propose the next block. It contains all the necessary components for a miner or validator to work on before finalization.

01

Block Header

The cryptographic summary of the block. It contains fields like the previous block hash, Merkle root of transactions, timestamp, difficulty target, and a nonce. Miners repeatedly hash this header, changing the nonce, to find a valid proof-of-work.

02

Transaction List (Mempool)

A set of unconfirmed transactions selected from the node's mempool. The template builder chooses transactions based on factors like:

  • Fee priority (fee per byte/gas)
  • Dependencies (parent transactions)
  • Total block size/gas limit This list is mutable until the block is mined.
03

Coinbase Transaction

The first transaction in any block template. It is a special transaction that:

  • Creates new coins (block reward).
  • Pays the miner's fee (sum of all transaction fees in the block).
  • Can include extra data via the coinbase field (e.g., extra nonce for mining).
04

Version & Consensus Rules

The block version number signals which set of consensus rules the proposer is following (e.g., for a soft fork). The template must be constructed according to the active consensus rules of the network, validating all included transactions and enforcing protocol limits.

05

Dynamic Fields (For Mining)

Fields that are continuously updated during the mining process:

  • Nonce: A 32-bit field iterated by miners.
  • ExtraNonce: In the coinbase transaction, allows for a larger search space.
  • Timestamp: Can be adjusted within limits.
  • Merkle Root: Changes if the transaction set is modified.
06

Related: Block vs. Block Template

A block template is a candidate; a block is the finalized result. Key differences:

  • Template: Mutable, has a placeholder for a valid hash.
  • Block: Immutable, contains a valid proof-of-work or proof-of-stake signature, and is broadcast to the network.
PROTOCOL COMPARISON

Block Template in PoW vs. PoS

A comparison of how block templates are constructed and used in Proof-of-Work and Proof-of-Stake consensus mechanisms.

FeatureProof-of-Work (PoW)Proof-of-Stake (PoS)

Primary Constructor

Miner

Validator / Proposer

Construction Trigger

Discovery of previous block

Assigned slot / epoch

Template Assembly

From mempool transactions

From mempool or execution payload

Core Computational Work

Finding a valid nonce (Hash)

Signing the block header

Resource Requirement

Hash rate (ASIC/GPU)

Staked capital (Bonded tokens)

Template Validity Window

Until a new block is found

For a specific slot (< 12 sec in Ethereum)

Reward Determinism

Probabilistic (based on hash share)

Deterministic (based on stake and selection)

Key Template Field

Nonce, nTime

Slot number, Signature

ecosystem-usage
BLOCK TEMPLATE

Ecosystem Usage and Protocols

A block template is a preliminary, mutable version of a block assembled by a node to propose to the network. It is the fundamental data structure that miners and validators work on before finalizing and broadcasting a new block.

01

Core Composition

A block template is a structured data object containing the essential components for a potential new block. Key elements include:

  • Block Header: Contains metadata like the previous block hash, timestamp, and Merkle root.
  • Candidate Transactions: A mempool selection, prioritized by fee and validity.
  • Coinbase Transaction: A special transaction awarding the block reward and fees to the miner/validator. The template is constantly updated with new transactions until it is finalized for proof-of-work or proof-of-stake consensus.
02

Role in Mining (Proof-of-Work)

In Proof-of-Work (PoW) systems like Bitcoin, the block template is the data structure that miners repeatedly hash. They increment the nonce and other fields in the header to find a hash below the network's target difficulty. The getblocktemplate RPC call is commonly used by mining pools to fetch updated templates from full nodes, ensuring miners are working on valid transactions and the latest chain state.

03

Role in Validation (Proof-of-Stake)

In Proof-of-Stake (PoS) networks like Ethereum, a validator selected to propose a block builds a block template. They select transactions from the mempool, execute them in the EVM to update state, and assemble the header. The template is then signed and broadcast. PoS block builders often optimize for Maximal Extractable Value (MEV) by ordering transactions to maximize profit from arbitrage and liquidations before finalizing the template.

04

Template Construction & Mempool

Block templates are built from a node's mempool (transaction pool). The constructing node selects transactions based on:

  • Gas/Fee Priority: Higher fee-per-gas transactions are typically included first.
  • Dependencies: Ensuring parent transactions are included before their children.
  • State Validity: Transactions must execute successfully against the current state. The template is dynamic; as new transactions arrive, they can be added to an unfinalized template to increase fee revenue.
06

Builder-Blocker-Separator (PBS) Model

In advanced PoS ecosystems, the role of creating the block template has been specialized. Proposer-Builder Separation (PBS) is a design where:

  • Builders (specialized nodes) compete to create the most valuable block template, optimizing for MEV.
  • Proposers (validators) simply select the highest-paying template from a builder marketplace. This model, implemented via protocols like mev-boost on Ethereum, reduces centralization risks and MEV-related inefficiencies for validators.
security-considerations
BLOCK TEMPLATE

Security and Manipulation Risks

A block template is a proposed block structure assembled by a miner or validator. While essential for consensus, its creation and propagation are vulnerable to several security and manipulation vectors that can impact network fairness and integrity.

01

Block-Withholding Attacks

A malicious miner discovers a valid block but withholds its propagation to the network. This can be used in selfish mining strategies to gain an unfair advantage or in time-bandit attacks to attempt chain reorganizations. The withheld block template becomes a private asset for manipulation.

  • Goal: To orphan honest blocks or increase the attacker's relative revenue.
  • Impact: Reduces network security and trust in block finality.
02

Transaction Censorship

The entity creating the block template has unilateral power to include, exclude, or order transactions. This can be used to:

  • Censor specific addresses or smart contract interactions.
  • Implement Maximal Extractable Value (MEV) strategies like frontrunning and sandwich attacks by reordering transactions for profit.
  • Centralization Risk: If template creation is dominated by a few large pools, they can enforce network-wide censorship policies.
03

Template Poisoning & Spam

An attacker can fill a block template with invalid or spam transactions before broadcasting it to other miners/validators.

  • Waste Resources: Forces peers to waste computational power validating a doomed block.
  • Delay Propagation: Slows down the honest network, increasing the attacker's chance of winning the next block.
  • This is a form of Denial-of-Service (DoS) attack against the peer-to-peer layer.
04

Stake-Grinding in PoS

In Proof-of-Stake systems, the right to create a block template is often determined by a verifiable random function (VRF). Stake-grinding is an attempt to manipulate this randomness by iterating through minor changes to the block template (e.g., nonce, transaction order) to unfairly influence future validator selection.

  • Goal: Gain a higher probability of being selected as a proposer in subsequent slots.
  • Mitigation: Requires robust, unbiasable randomness beacons.
05

Centralization of Template Creation

In both Proof-of-Work and Proof-of-Stake, the process of building the optimal block template (for fees or MEV) is computationally intensive. This leads to:

  • Specialized Software: Dominance of builders like mev-boost in Ethereum.
  • Centralized Builders: A few entities may control the most profitable template construction, creating a single point of failure and censorship.
  • This separates block proposal from block building, introducing new trust assumptions.
06

Data Availability Withholding

A proposer broadcasts a block template header but withholds the corresponding transaction data (the block body). Peers see a valid header but cannot verify the transactions within.

  • Core Attack: Enables invalid state transitions to be accepted, breaking security if not caught.
  • Mitigation: Addressed by Data Availability Sampling (DAS) and erasure coding in modular blockchain designs (e.g., danksharding).
DEBUNKED

Common Misconceptions About Block Templates

Block templates are a core concept for miners and validators, but several persistent myths obscure their true function and importance. This section clarifies the most frequent misunderstandings.

No, a block template is a proposal for a block, not the final, cryptographically signed block itself. It is a mutable data structure created by a node that contains a set of candidate transactions, a reference to the previous block, and a placeholder for the nonce and timestamp. Miners or validators work on this template, performing proof-of-work or constructing a proof-of-stake signature, to finalize it into a valid block that can be propagated and added to the blockchain. The template is the starting point; the finalized block is the result.

BLOCK TEMPLATE

Frequently Asked Questions (FAQ)

A block template is a preliminary data structure used by miners and validators to construct a new block. This section answers common questions about its purpose, components, and role in blockchain consensus.

A block template is a preliminary, mutable data structure that a mining node or validator assembles to define the contents of a potential new block before it is cryptographically sealed. It serves as a blueprint containing the candidate block header, a list of pending transactions from the mempool, and other necessary metadata. The miner's primary task is to repeatedly modify a specific field in this template—typically the nonce or extraNonce—and hash it to find a valid proof-of-work solution. Once a valid hash is discovered, the finalized template becomes the official next block in the chain. In proof-of-stake systems, validators use similar templates, but the selection and finalization process is based on stake and cryptographic randomness rather than computational work.

ENQUIRY

Get In Touch
today.

Our experts will offer a free quote and a 30min call to discuss your project.

NDA Protected
24h Response
Directly to Engineering Team
10+
Protocols Shipped
$20M+
TVL Overall
NDA Protected direct pipeline