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 Does a Miner Decide Which Transactions to Include in a Block?
What Criteria Do Miners/validators Use to Select Transactions from the Mempool?
What Is a ‘Virtual Byte’ (Vbyte) in Bitcoin Transaction Sizing?
What Is a “Fee Rate” (Sat/vb) and How Is It Calculated?
What Is the ‘Mempool’ in the Context of Cryptocurrency Mining?
What Is a “Sat” (Satoshis) and What Is Its Significance?
How Does ‘Price-Time Priority’ in an Order Book Compare to Fee-Based Priority in a Mempool?
What Is a “Mempool” in the Context of a Cryptocurrency Network?

Glossar