Post
Topic
Board Bitcoin Discussion
Re: Algorithm for selecting a low-fee transaction from the mempool
by
tiCeR
on 19/05/2023, 19:22:42 UTC
So you say it is purely a greedy algorithm?
It's not that there's a certain algorithm which miners have to follow that.
Miners are free to include any valid transaction they want. They can even include a transaction with zero fee, but they include transactions with highest fee rates to maximize their profit.

So to be precise, I'm not saying what algorithm miners should follow. Of course miners are free to choose any transaction they want (or even censor specific ones, despite if this means a lower reward for them).

What I am asking is what algorithm miners/mining pools typically follow.

I have asked a very similar question here and o_e_l_e_o kindly answered in detail. If you read that post I think everything should be answered. Miners will process transactions paying the highest fees and they are constantly building a "candidate" block which is adjusted on a highest fee first principle until the next block gets mined. Even if you are part of the candidate block for a second, your tx will only confirm once it is part of the candidate block that then also gets mined. Until your tx could be dropped and another one paying a higher fee be included instead. This is why I thought broadcasting a tx when fees are low in a certain moment will also ensure that your tx gets processed, but that was wrong because it could still get dropped again if the block hasn't been mined and a higher fee tx gets preferred over yours.