How can an output be spent while the transaction is in mempool I have seen transactions on a block explorer where the transaction is in  mempool (unconfirmed) but one of the outputs already appears as spent, I am curious how this works. This question is a duplicate of this question, but the answer there doesn't quite satisfy my confusion. I am thinking about how this process is permissible in conjunction with the protocol rules for 'tx' messages listed here, particularly rule 9, 10, 12.


For each input, if the referenced output exists in any other tx in the pool, reject this transaction.

For each input, look in the main branch and the transaction pool to find the referenced output transaction. If the output transaction
is missing for any input, this will be an orphan transaction. Add to
the orphan transactions, if a matching transaction is not in there
already.



For each input, if the referenced output does not exist (e.g. never existed or has already been spent), reject this transaction


Questions:

Part of what might be causing confusion is the definition of &quot;spent&quot; on the block explorer - when it claims an output is spent does this equate to &quot;there exists a transaction at least in mempool that uses the output as an input&quot;?
The ability to broadcast a tx message that uses the output of an unconfirmed tx as an input seems to explicitly violate rule 9. Does it not?
Rule 9 &amp; 10 seem to be at odds with each other. Rule 9 says to reject if the output is in a tx in mempool, rule 10 says to check mempool for the output (as though it is permissible). Are they not?
It is my belief that full nodes keep a &quot;UTXO&quot; set for validating some of these criterium - is the UTXO set updated once a transaction hits mempool (i.e not waiting for a confirmation)?
Is mempool relative to one node? I.e, if I broadcast a transaction and a node accepts it as valid does it then pass the transaction around so that other nodes can add it to &quot;their&quot; mempool, or is there somehow a &quot;central mempool&quot; that any validated transaction can get sent to.
Is it possible to cancel a tx message that has been added to mempool? I am not asking if typical software has this feature - but is it theoretically possible for a power user or is it &quot;permissible behavior&quot; within the bitcoin protocol.
There is no rule requiring a transaction to have a confirmation before being spent.

Yes, the mempool matters. That's also how double-spends are detected. So it's crucial nodes check the mempool and not just previous blocks.
No it does not violate the rule, they are referring to double-spends being rejected if the SAME output exists in the mempool.
IDK, maybe ask the original poster what they meant?
Yes, no need for any confirmations to become an unspent transaction output.
Mempools from node-to-node are not always identical. For example, some nodes have different minimum relay rules that may include extremely low fee transactions. There is no central mempool.
Not really. I haven't done it recently but lets say you broadcast a transaction with a 0 fee. The transaction would likely get stuck in the mempool and not get confirmed. After 14 days if it doesn't get included in a block it &quot;expires&quot;. Once expired/dropped I could craft a new transaction using the same UTXOs that I used in the original.

Here's a related question that you will probably find interesting:
What happens to transactions in the mempool when their parent transaction expires?