Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: brian_armstrong on January 10, 2012, 08:17:24 AM



Title: Are transactions with the extra OP_NOP on the end still valid?
Post by: brian_armstrong on January 10, 2012, 08:17:24 AM
I noticed this tx in the main chain has an extra OP_NOP on the end:

http://blockexplorer.com/tx/5492a05f1edfbd29c525a3dbf45f654d0fc45a805ccd620d0a4dff47de63f90b

Is this still considered valid if it were to reappear today or is this an exception sort of like the OP_CHECKSIG abuse transactions from a while back? (that would no longer be accepted)
https://en.bitcoin.it/wiki/Incidents#OP_CHECKSIG_abuse

I could probably answer this by reading the code in the official client that checks whether a tx is valid, but I wasn't able to find it just by poking around GitHub.  If someone has a link that would be great.  Thanks!


Title: Re: Are transactions with the extra OP_NOP on the end still valid?
Post by: Stefan Thomas on January 10, 2012, 03:03:35 PM
This transaction would still be valid if it appeared in a block today.

As a loose transaction however, it would be rejected. There are stricter rules for what transactions an unmodified clients will relay and include in its own blocks vs. what it will accept inside of other people's blocks.


Title: Re: Are transactions with the extra OP_NOP on the end still valid?
Post by: etotheipi on January 10, 2012, 08:01:25 PM
If a transaction shows up in a block that uses an arbitrarily complex, non-standard script (but doesn't use any disabled op-codes), it will be accepted by all the nodes as long as it is a valid script (and if it's a TxIn script, that it evaluates to true with the TxOut script being spent).

However, the act of getting such a script into the blockchain is fairly difficult, because no Satoshi-based nodes will relay transactions with such scripts, and no miners will include those transactions into the blocks they are producing.

What this means is that, you can use all the advanced scripting capability that isn't specifically disabled, under two conditions:
(1) The scripts are ultimately valid
(2) You mine them into a block, yourself

In other words: no one will help you put those scripts into the blockchain, you have to do it yourself by solving your own block.  But those blocks will be accepted as part of the longest chain once it's there.


Title: Re: Are transactions with the extra OP_NOP on the end still valid?
Post by: brian_armstrong on January 11, 2012, 07:28:02 AM
Ok great - this makes sense about the higher threshold for relaying, but it will still get saved in a block.

Thanks for the help!