2

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. – Nate Eldredge 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
1

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

efdf1b981d7bba9c941295c0dfc654c4b5e40d7b9744819dd4f78b8e149898e1
9aa3a5a6d9b7d1ac9555be8e42596d06686cc5f76d259b06c560a207d310d5f5
c5d4b73af6eed28798473b05d2b227edd4f285069629843e899b52c2d1c165b7
74ea059a63c7ebddaee6805e1560b15c937d99a9ee9745412cbc6d2a0a5f5305
e335562f7e297aadeed88e5954bc4eeb8dc00b31d829eedb232e39d672b0c009
dc3aad51b4b9ea1ef40755a38b0b4d6e08c72d2ac5e95b8bebe9bd319b6aed7e

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:

op_reserved
op_reserved1
op_reserved2
op_ver
op_verif
op_vernotif
op_2rot
op_2swap
op_1add
op_codeseparator
  • 1
    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. – Pieter Wuille 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.