4

If a transaction A enters the txpool at timepoint A', and then a second transaction B enters the txpool at timepoint B' at a location distant enough to have not received information about transaction A, how does the Monero protocol handle this double spend attempt?

Ginger Ale
  • 5,676
  • 2
  • 18
  • 46

1 Answers1

4

First one to get in a block wins, there can be no other way as far as I understand. I mean, who has the authority to say which one came first? For this, we have PoW and the blockchain - to avoid having to rely on "someone said this came first". Until it's mined, it's undefined.

JollyMort
  • 19,934
  • 3
  • 46
  • 105
  • "First one to get in a block wins" - right, but do they co exist in the txpool? And if they are both in the txpool, how does the daemon decide which to add to a block? – Ginger Ale Jul 02 '17 at 13:05
  • But TX pool is really local, each node for itself. They can't co-exist within a node, but they could co-exist on the network, as you said. The one to propagate faster will have a higher chance of getting mined. I tried to double-spend once with a higher fee during the time network was busy and the 2nd TX never showed in a block explorer. My own node rejected it until I flushed its TX pool, but stil it couldn't go any further than that. Might be interesting case for fluffyblocks btw. If a node rejects it, but there's a block mined with it, it won't have that TX in advance like others. – JollyMort Jul 02 '17 at 16:23
  • ok, so i guess thats thee answer. if a second transaction attempts to enter a nodes tx pool and theres already a tx that uses the same input, then the tx is banned from entering the nodes txpool. – Ginger Ale Jul 03 '17 at 11:33
  • Yup, but it must be the key image as the criteria, as a node can't tell which input is the real one. Might as well confirm all the above with mooo and edit the answer accordingly. – JollyMort Jul 03 '17 at 18:16