Does more fees means quicker transaction ?

0

1

lets say hypothetically , two persons having access to same private key. makes a transaction with 1 input and 1 output.

person 1 sets fees = 500 sat/Byte
person 2 sets fees = 10 sat/Byte

case 1 :

both the persons broadcasts transaction at the exact same time.

Which transaction goes through and which gets marked as double spend ?


case 2:

person 2 (with lower fees) broadcasts at 0 second while person 1 (with higher fees) broadcasts at 1 second

Which transaction goes through and which gets marked as double spend ?

AMB

Posted 2017-08-13T01:00:49.387

Reputation: 292

Answers

2

There is no definitive answer. Each miner can make their own decision to include either of the two transactions (or neither) in either case. Whichever miner is lucky enough to find the next winning nonce, their decision determines which transaction is confirmed. (If that miner chose neither transaction, then the can is kicked down the road.)

In practice, a miner's "decision" depends on the algorithm used by their mining software. A "greedy" algorithm might choose the higher-fee transaction in all cases; if they get the lower-fee transaction first, they would initially include it in their candidate blocks, but then replace it with the higher-fee one if that one arrives later.

A "naive" algorithm might just choose the first transaction which is seen by the miner, and not replace it by a later transaction, even if the fee is higher. (Even if they are sent at the same time, the miner has to process one of them first; this might come down to infinitesimal differences in network propagation, and make the choice practically random.)

You could also imagine more perverse algorithms that always choose the lower fee, or the later arrival, or make the choice in some other bizarre way.

There's also the possibility that a miner receives one of the transactions, adds it to their candidate block, but finds a winning nonce for that block before the second transaction arrives. In that case, they would presumably already have published their winning block, so they can't do anything with the second transaction even if they want to.

I don't know whether there are any statistics as to what fraction of miners use which algorithm.

Nate Eldredge

Posted 2017-08-13T01:00:49.387

Reputation: 21 420