Post
Topic
Board Development & Technical Discussion
Re: What's happening to a new transaction that was created with the existing txid?
by
Lattice Labs
on 30/04/2023, 18:57:21 UTC
I know, that LevelDB stores information about all UTXOs. The pairs in there are key + value, where keys is txid + number of vout.
But if one man has some UTXOs and has lost his password, then these UTXOs will be in the DB forever? If i have created a new tx with the same txid that this man had, then my transaction won't be added to the blockchain ever?


If someone loses their password and can't access their UTXOs, those UTXOs will remain in the LevelDB UTXO set indefinitely. However, just because those UTXOs are still in the UTXO set doesn't mean they can be spent by someone else.

When a transaction spends a UTXO, it includes a reference to the previous transaction output, which includes the transaction ID and output index of the UTXO being spent. So if someone else tries to spend the same UTXO by creating a new transaction with the same transaction ID and output index, it won't be added to the blockchain because it conflicts with the existing transaction that spends that UTXO.

In other words, if someone else creates a new transaction with the same transaction ID and output index as the UTXOs owned by the person who lost their password, the network will reject that transaction because it conflicts with the existing transaction that spends those UTXOs. The UTXOs owned by the person who lost their password will remain unspent in the UTXO set until they are spent by a valid transaction that includes a reference to them