Suppose A spends a UTXO of 5 BTC. The transaction is sent to the mempool. Will the 5 BTC UTXO be instantly deleted from the UTXO set? If no, can this UTXO still in the UTXO set be used to make another transaction? Can this UTXO be used while it is in the mempool (unconfirmed transaction)?
1 Answer
For nodes that maintain their own mempool there really are two "UTXO sets", one that only considers confirmed transactions and one that also considers mempool transactions. UTXOs that are spent by a yet unconfirmed transaction can be spent in a different transaction, provided some rules are met (e.g. the transaction fee is increased, see BIP125 for more details), in which case the previous transaction is replaced.