How can an output be spent while the transaction is in mempool

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.

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

  2. 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

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


  1. Part of what might be causing confusion is the definition of “spent” on the block explorer – when it claims an output is spent does this equate to “there exists a transaction at least in mempool that uses the output as an input”?
  2. 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?
  3. Rule 9 & 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?
  4. It is my belief that full nodes keep a “UTXO” set for validating some of these criterium – is the UTXO set updated once a transaction hits mempool (i.e not waiting for a confirmation)?
  5. 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 “their” mempool, or is there somehow a “central mempool” that any validated transaction can get sent to.
  6. 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 “permissible behavior” within the bitcoin protocol.