Post
Topic
Board Development & Technical Discussion
Merits 3 from 2 users
Re: What's happening to a new transaction that was created with the existing txid?
by
odolvlobo
on 18/04/2023, 10:48:59 UTC
⭐ Merited by ETFbitcoin (2) ,vapourminer (1)
It is possible that there could be a txid collision (and in fact they have occurred in the past due to a specific oversight in the protocol), but normally they are extremely unlikely because like private keys, they are effectively 256-bit random numbers. However, collisions are avoided by rejecting new txids duplicating txids of any transactions with unspent outputs (see BIP-30).

Are these transactions actually rejected and deleted from mempool or these transactions are skipped and still waiting for the moment when the previous transaction with the same txid will be deleted from LevelDB?

I'm actually asking this question cause I've seen somewhere that when the UTXO is spent, it would be deleted from DB, am I right about it?

If a transaction's output is spent, it is no longer a UTXO and so it must be removed from the UTXO set, however that is organized. I don't know the details about the various node implementations, but I would guess that transactions with duplicated txids would be rejected and not stored in the mempool and not forwarded to other nodes.