Skip to main content

What Is the General Algorithm Miners Use to Select Transactions for a Block?

Miners generally employ a greedy algorithm to select transactions, prioritizing those that offer the highest fee rate, typically measured in satoshis per virtual byte (sat/vbyte). They iterate through their mempool, selecting transactions from highest fee rate to lowest.

This process continues until the block is full, meaning the block size or weight limit is reached. The goal is to maximize the total transaction fees collected in the block, thereby maximizing the miner's profit from the block space.

How Do Transaction Size and Fee Relate to the ‘Fee Rate’?
What Is the Opportunity Cost of Including a Zero-Fee Transaction in a Full Block?
Why Do ATM Options Have the Highest Time Value?
How Do Full Nodes Share Mempool Data to Improve Network-Wide Fee Estimation?