# Gavin Andresen # 2012-04-10 18:37:37 # https://bitcointalk.org/index.php?topic=67739.msg845100#msg845100 @s{quotedtext} @s{quotedtext} In the long run, I think we have to assume that miners will do what is most profitable, and design escrow/payment protocols around that assumption. @p{par} Replacing non-final transactions in the memory pool potentially opens up a whole bucket of worms, but I think the short-term challenge is to figure out if we should change the rules we have now. If we do (I think we should), then I think it would be a mistake to do anything other than "create rules that will maximize miner profits." Because if we do something else, then sooner or later I believe there @p{(bf}will@p{bf)} be a "miners special" version of the code that has miner-friendly rules. @p{par} @p{hrule} If you agree with me that the default rules in the client should maximize miners' profits, then it seems to me there's one simple rule change we should make: @p{par} If you've got two otherwise equivalent transactions that spend the same input(s), keep the one with the most fees. @p{par} Right now, the rule is "keep the first one you see." @p{par} The bag of worms comes into play if you've got two transactions that spend the same input(s) that, for example, look like this: @p{par} Transaction 1: final transaction (can go into a block RIGHT NOW) that has a fee of 0.005 BTC @p{brk} Transaction 2: transaction that won't be final for 3 days that has a fee of 0.1 BTC @p{par} Should a miner put Transaction 1 into the block they're mining and take the smaller fee now, or not include it, hoping that nobody else mines Transaction 1 in the next 3 days so maybe they can mine Transaction 2 and get the bigger fee? @p{par} I'm not an expert in game theory, but I believe the winning strategy in the above situation, assuming everybody knows about both transactions, is to mine Transaction 1 right away (any economists reading who know a lot more about game theory than I do?). @p{par} That suggests the rules for transactions that spend the same inputs aught to be: @p{par} 1. If you have two free transactions, keep the first one you see. @p{brk} 2. If you have a free and a fee-paying transaction, always keep the fee-paying one. @p{brk} 3. If you have two final, fee-paying transactions, keep/mine/relay the one with the higher fee. @p{brk} 4. If one or both of the transactions is non-final, keep/relay the one that will become final first. @p{brk}