8
3
Looking at the bitcoin source (https://github.com/bitcoin/bitcoin/blob/v0.9.3/src/script.cpp#L843-L847, specifically), I ran into the the use of the OP_CODESEPARATOR. Am I right in interpreting this code that it is not always the case that the whole scriptPubKey is signed, but really just the part that is later than the most recent OP_CODESEPARATOR? What happens if an OP_IF causes an OP_CODESEPARATOR to be skipped?
It seems strange to me that the entire scriptPubKey isn't used for signing in all cases, so I'm guessing there is some use case for this that I haven't thought of. Does anyone know what this use case is?
I've read through this bitcointalk thread, but didn't really find any conclusion there.
Fast forward five years later and https://www.youtube.com/watch?v=mxPFvRTT4Eg So much about script experts out there.
– mpapec – 2019-07-09T18:38:10.6704The really telling thing about the usefulness of OP_CODESEPARATOR is that all of the results in Google are people asking what it's used for. ;) – Nick ODell – 2014-12-13T03:19:24.907