Expand description
Block Template Assembly — Transaction Selection and Template Construction
This module implements the BlockTemplateProvider port trait, assembling
block templates from mempool transactions for mining. It corresponds to
Bitcoin Core’s BlockAssembler (in node/miner.cpp).
§Strategy
- Query the mempool for transactions sorted by ancestor fee rate (CPFP-aware).
- Fill the block up to
MAX_BLOCK_WEIGHT(4,000,000 weight units / BIP 141). - Build a coinbase transaction with the correct subsidy + collected fees.
- Compute the merkle root and assemble the header.
The resulting BlockTemplate is ready for nonce-grinding by the miner.
Structs§
- Block
Assembler - Block template assembler.