Getblocktemplate
The mining protocol that hands miners a full block template so they can build their own blocks rather than trusting the pool.
Basically
A mining protocol that hands a miner a skeleton block so it can assemble and choose the contents itself.
Key Takeaways
- Gets the network away from pools dictating what goes into blocks.
- A template carries the previous hash, target, coinbase rules, transaction data and a long-poll for updates.
- It is the basis of solo mining and of pools that let miners pick their own transactions.
The Problem It Solves
Early pool protocols sent a nearly finished block header and hash range, so the pool chose the transactions. Miners were hashing whatever they were told, which concentrated power over the mempool and over soft forks.
GetBlockTemplate, defined in BIP 22 and 23, sends the whole template instead. The miner fills in the coinbase itself, selects transactions, and returns a solved block.
How It Works
The server sends a template with the previous block hash, the target, the coinbase value and the list of transactions, then the miner constructs a block and grinds nonces against it.
Long-polling keeps templates fresh, so a miner learns about a new tip immediately instead of building on a stale parent.
Who Uses It
Solo miners and decentralised pools rely on it, and pools that support it let members set their own transaction selection.
Its weakness is bandwidth: templates are large and chatty, which is why hashing-farm protocols compress the work.