If someone broadcasts a transaction 1 from an unspent txo to an address 1 and then, let's say after 10 minutes without a new block, they broadcast a new transaction 2 using the same unspent txo to an address 2, how do miners handle these? (Both transactions don't use RBF 'Replace By Fee')
EDIT:
I tested it ...
1. transferred 12,000 satoshi to the address 1PCPavJ1zyYn9rCu2p1e47vMPC11NWRCm9
relevant for the test: tx hash e0af61939fa152f941e3b6f80fb3662dbb1d7d6895542824df36ded40b5d1bf9 vout 0
2. after block 734,778 created two transactions using the same UTXO (tx hash e0af61939fa152f941e3b6f80fb3662dbb1d7d6895542824df36ded40b5d1bf9 vout 0):
(a) send 11,770 satoshi to the address 1AR7Ei6GVDxWPUyZ94pmUo6UNDSiVq5Qk1 (230 satoshi fee -> ~1 sat/byte)
(b) send 10,000 satoshi to the address 1Ba6okpMikNQRTaTifoKYc6z3m8gKfqXQ4 (2000 satoshi fee -> ~10 sat/byte)
3. broadcast transaction (a) via
https://blockchair.com -> got the message:
Thanks, your transaction has been broadcast to the Bitcoin blockchain, its hash:
2c88d249902586908e55116527ff8cb4c14975bd233cb93a2b759db43a3fe358
4. waited ~1 minute, then broadcast transaction (b) via different providers:
https://blockchain.inforesult: Code: -26, Error: txn-mempool-conflict
https://blockstream.inforesult: sendrawtransaction RPC error: {"code":-26,"message":"txn-mempool-conflict"}
https://btc.networkresult: Not a valid transaction hash!
https://bitaps.comresult: Mempool accept test failed: txn-mempool-conflict
... and others gave the same error code 26.
Transaction (a) has been confirmed in block 734,779 and transaction (b) rejected by all providers.
Then I found this:
source
https://bitcoin.stackexchange.com/questions/58188/validation-error-error-26-258-txn-mempool-conflictQuestion:
I am getting this error message. What does it mean? Validation Error: Error #-26: 258: txn-mempool-conflict
Answer (by JBaczuk):
This error means that you're trying to spend the same transaction output more than once.
More specifically, when you submit a transaction, a check is done (on the node) against the previous outputs of your new transaction to see if they are already trying to be spent by a transaction in the memory pool.
The check is in validation.cpp in the bitcoin source.
EDIT (2):
Tested it!
Fun experiment, with the expected outcome.
Yes, and that it is working and the broadcast transactions are being checked before the confirmation on the block, there is another proof:
I broadcast transaction (b) after transaction (a) had been confirmed. The nodes gave the error code -25 (missingorspent) instead of error code -26 (txn-mempool-conflict).