7
2
I understand there are a couple things that need to be checked for a transaction to be valid - the previous transaction had to be correct, no OP can invalidate the transaction, etc, but is there a complete list on what one needs to check in order to know if a transaction is valid?
For example, does the transaction need to have a specific structure in order to be spent, like the script from TxIn needs to compile to the encoded message, and the TxOut script needs to properly run OP_Checksig on that particular message? If not, one could simply drop the message from TxIn, push their own malicious message and run OP_Checksig on that.
What steps does the protocol require a client to go through to check if the transaction is valid?
It's not clear what you're asking. By "valid" do you just mean that the client won't consider a block invalid if it contains that transaction? Or by "valid" do you mean the default client will include that transaction in blocks it generates? Or by "valid" you mean the default client will relay it to other nodes? Or something else? There are different checks on transactions to decide if they are "valid" for a number of different purposes. For example, consider a transaction that spends coins not yet available but that could become available. In some senses, that's valid. In some, not yet. – David Schwartz – 2012-01-05T02:21:33.267
@DavidSchwartz I suppose all of the above would be useful, but mainly I was thinking about including the transactions in the block. – ThePiachu – 2012-01-05T10:51:51.480