Post
Topic
Board Bitcoin Discussion
Re: Question about how miners treat unconfirmed double spend transactions
by
barbarousrelic
on 27/08/2014, 14:31:52 UTC
Bitcoin address X contains 1.06 bitcoin.

Let's say a miner sees two unconfirmed transactions broadcasted - the first one says to send 1 bitcoin from address X to address Y. The second transaction says to send 1 bitcoin from address X to address Z. Both transactions cannot be completed. This is a double spend.

My understanding is that Bitcoin miners can write their own miner software to choose which transaction to process in any way they wish. They could include in the next block whichever transaction has the higher fee, they could go with whichever transaction they received first, they could go with whichever one has more of the letter 'Q' in the destination address because they like the letter Q.

But in practice, how would this normally be handled by most miners' software?

In practice, most miners will only see one of the two transactions.  The nodes of the network will accept and relay the first transaction that they see.  They will refuse to relay the second one, so it won't propagate across the network.

If, on the other hand, you specifically connect directly to the larger mining pools, and send your transactions directly to them, then most mining pools will accept which ever transaction they receive first.  They will ignore the one they receive second.

Thank you for your answer.

One more question though. How reliable is it in practice that miners will receive transactions in the same order they occur?

Let's say one person has a habit of going out and making small Bitcoin purchases ten times a day, and receiving his goods with zero confirmations. And let's say every time he broadcasts his purchase transaction, he immediately broadcasts a second double spend transaction. Roughly how often will the second double spend transaction be confirmed in a block?

I wonder if the policy of not relaying duplicate transactions ever backfires, and one node receives the second one first, and that node relays it to numerous other nodes, and now the doublespend transaction blocks out the legitimate one.