I'm trying to implement a script evaluator and would like to get some real testing data from the blockchain (testnet or mainnet). Are there transactions whose input scriptSigs combined with the previous transaction's scriptPubKey use any/all of these op_codes? I'd like to compile a collection of such transactions as test vectors.

98: op_ver,
101: op_verif,
102: op_vernotif,
107: op_toaltstack,
108: op_fromaltstack,
109: op_2drop,
111: op_3dup,
112: op_2over,
113: op_2rot,
114: op_2swap,
115: op_ifdup,
116: op_depth,
119: op_nip,
120: op_over,
121: op_pick,
122: op_roll,
123: op_rot,
125: op_tuck,
139: op_1add,
140: op_1sub,
143: op_negate,
144: op_abs,
146: op_0notequal,
147: op_add,
148: op_sub,
154: op_booland,
155: op_boolor,
156: op_numequal,
157: op_numequalverify,
158: op_numnotequal,
159: op_lessthan,
160: op_greaterthan,
161: op_lessthanorequal,
162: op_greaterthanorequal,
163: op_min,
164: op_max,
165: op_within,
168: op_sha256,
170: op_hash256,
171: op_codeseparator,
  • Just to make sure I'm understanding, you'd like a compiled list of transactions which have these OP_ codes in their scriptPubKey? Would you prefer a spreadsheet and what info do you exactly need? TXID and ASM?
    – KappaDev
    Oct 22 '18 at 4:45
  • 1
    I would like transactions which spend utxos with these op codes either in the scriptPubKey or redeemScript.
    – Jimmy Song
    Oct 22 '18 at 14:19
  • I believe the early blocks of testnet contain a bunch of unusual transactions as a sort of test suite. So that might be one place to start looking. Oct 22 '18 at 14:40
  • 1
    @JimmySong I wrote this small PHP script which I believe should work, but after running this overnight for 12+ hours I quickly realized this is quite inefficient and will likely take too long. Perhaps someone with SQL knowledge can utilize this to obtain the required info?
    – KappaDev
    Oct 22 '18 at 21:30
  • 1
    @NateEldredge, I checked the first 400 or so blocks of testnet and did not find anything that uses any of these script codes.
    – Jimmy Song
    Oct 22 '18 at 21:59

I did some digging with a parser I wrote and found 6 transactions that test a lot of the op codes:


These are all on testnet and test a very large number of the OP_CODES I requested. Here are still ones I'm looking for:

  • 2
    That'll be hard. OP_RESERVED, OP_RESERVED1, OP_RESERVED2, OP_VER, OP_VERIF, OP_VERNOTIF all immediately cause the script to fail, so they can't occur (unless in an unexecuted IF branch) in a valid spend. OP_VERIF and OP_VERNOTIF even cause failure when in an unexecuted IF branch. Oct 23 '18 at 1:13
  • Thanks @PieterWuille, I was confused about that. So it's a lot like OP_RETURN but for IF branches? I guess I just need the last 4, then.
    – Jimmy Song
    Oct 23 '18 at 1:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.