Max Hillebrand on Nostr: Your node defines the rules of what constitutes an unspent coin, a coin is initially ...
Your node defines the rules of what constitutes an unspent coin, a coin is initially created in a valid blocks first transaction, and spent by a transaction with a valid witness to a new coin with a locking script and amount.
For any transaction, your node checks that the inputs are valid previous transaction outputs that have not been spent, simply by looking if the coin ID (prev TX hash + output index) is in the utxo list, if not: invalid double spending transaction, if yes: valid transaction in block, and remove coin ID from utxo set.
For any transaction, your node checks that the inputs are valid previous transaction outputs that have not been spent, simply by looking if the coin ID (prev TX hash + output index) is in the utxo list, if not: invalid double spending transaction, if yes: valid transaction in block, and remove coin ID from utxo set.