What is a High Priority transaction?

Tara Annison
3 min readJan 5, 2021

--

When a transaction is created and broadcast it is saved in local storage to a node’s memory pool, often referred to as their “mempool” or “transaction pool”. This is a waiting room for transactions which haven’t yet been included in a block and miners will select transactions for their candidate blocks from this pool. (to read more about mempools: https://lnkd.in/df9hBfR)

As each block on the bitcoin blockchain is limited to 1MB in size this equates to roughly 2,500 transactions. However there are usually more transactions in a node’s mempool than space in the block, this means miners must select a subset to include in their next candidate block.

http://www.blockchain.com/charts/mempool-count

They typically select those with the highest transaction fee since, if they successful mine the block, then they will receive these transaction fees and the 6.25 newly mined bitcoin as a reward.

However, a little known fact is that the first 50kb in a block is reserved for ‘high priority’ transactions. These are defined as high value transactions which are spending the oldest UTXOs (unspent transaction outputs). The age of a UTXO is how many blocks have been built on top of the block it was created in, and this can be thought of as spending the older rustier coins in your purse rather than the newer shiny ones. This ensures that high value transactions spending older UTXOs are prioritised above newer value, smaller transactions; even if they have a zero value transaction fee.

The priority of a transaction is calculated as;

Priority = Sum (Value of input * Input Age) / Transaction Size

Where the value of the input is taken in the base unit of bitcoin, a satoshi (0.00000001 of a BTC) and the transaction size is measured in bytes with more complex transactions being heavier.

— — — — —

To be classified as ‘high priority’ the priority of a transaction must be greater than 57,600,000.

For the first transaction above (tx hash: 5e3bebc338…) as the value in satoshis is 5,995,035,278 and the size is 1,278 bytes, it only requires the input age to be at least 12 blocks (c2 hours) in order to be classified as high priority. Therefore assuming the user is happy to wait c2 hours (or the UTXO bc1qfpv… was created in a block at least 2 hours old) then they could have saved themselves the $37 transaction fee.

For the second transaction above (tx hash: 26d48d2bea…) as the value in satoshis is 2,458,228,464 but the size is much smaller at 223 bytes, it will be classified as high priority when the input age is just 5 blocks or older (c1 hour).

When a miner starts to assemble their candidate block they will first use this prioritisation formula to select 50kb worth of transactions from the mempool, regardless of transaction fees, and the remaining block capacity is then filled with transactions of their choosing — usually those with the highest fee, however a miner can decide their inclusion criteria as they see fit.

--

--

No responses yet