OttoAllmendinger/haskoin — pull request #2 by lornap (2014-06-26 02:29:40+00:00)
Title: OP_CODESEPARATOR and OP_CHECK(MULTI)SIG logic

Hey Otto,

Here's some code that seems to be handling `OP_CODESEPARATOR` and `OP_CHECK(MULTI)SIG`.

One requirement to make this work is that the redeemScript and the input script should be run separately, passing only the stack from input script execution to redeem script execution. Otherwise the hashOps will contain input script ops.

From what I've read elsewhere, separate execution is the intended way to do verification since things like If-statements shouldn't cross the two scripts and it helps prevent nefarious input scripts.

For now, you can make the code work by artificially placing a `OP_CODESEPARATOR` between the input and redeem scripts.

Let me know if this is inline with what you had in mind.

-Lorne