<p>I don't think this is possible. Most, if not all, block explorers and blockchain indexers do not completely disassemble scripts and index them so that they are searchable. No software or service I know of allows you to search by opcode use in a transaction. It would be pretty useless for a service to provide this as probably no one would actually use it and having such an index would be a huge resource cost.</p>

<p>I think the best you will be able to do is to do write a program to look through every single transaction's scriptSig and looking for the opcodes that you want. However, be careful that you don't interpret random bytes as being opcodes. You will need to have something that can disassemble scripts and check the disassembled scripts for the opcodes that you want. Furthermore, such disassemblers won't be able to disassemble a redeemScript which is the actual script where opcodes will actually be for P2SH inputs.</p>

<hr>

<p>Instead of searching for an example of an opcode which probably hasn't been used, just try using it yourself. I recommend that you read <a href="https://en.bitcoin.it/wiki/Script" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Script</a> to get an idea of how the opcode works. Then you can use a tool like <a href="https://github.com/kallewoof/btcdeb" rel="nofollow noreferrer">https://github.com/kallewoof/btcdeb</a> to execute and debug your script. This way you can learn how the opcode works through experimentation and see exactly how a script interpreter will execute the script.</p>

CC BY-SA 4.0
2019-03-28T11:44:43.020Z
What about http://blockchainsql.io which inlude Opcode searching in transactions by ɪᴅ (though I have too limited knwolwedge to write the request) ? I only need basic dissaembly, not full.For trying, I don’t know how to compile a script nor I know how to convert an address into a hash for Scripting nor I know how to broadcast a transaction on Bitcoin testnet (I’m not aware of any online services allowing that). What I need is to verify some opcodes don’t create a new virtual address in block explorer (I mean that the money appear to be received to everyone).Hence the need for a block explorer.
user2284570
CC BY-SA 4.0
2019-03-28T14:26:45.557Z
AFAICT blockchainsql.io does not allow searching by opcode. It has a table which has all of the opcodes, but that does not mean that you can search for a transaction containing an opcode as the fields for transactions do not contain any reference to their opcodes table. Instead of trying to do something that you do not understand, why not simply ask exactly what it is that you want to understand and people here can help you. You are asking a question that you think will help you understand something you don't, so just ask the thing that you don't understand.
Ava Chow
CC BY-SA 4.0
2019-03-28T16:12:25.507Z
Ah yes… Correct, but asking directly is something [I did already](https://bitcoin.stackexchange.com/q/85688/64911).
user2284570
CC BY-SA 4.0
2019-03-28T22:47:31.033Z
Ok, then this exactly what I said since the beginning, I definitely need a real world example of `OP_CHECKLOCKTIMEVERIFY` for starting because as I understand, I need to construct signing in the transaction script manually which means there’s simply too much too do for just seeing the result in a block explorer anyway whatever happends.
user2284570
CC BY-SA 4.0
2019-03-28T03:08:02.863Z
2019-03-28T03:08:02.863Z
Ava Chow
<p><a href="https://bitdb.network/" rel="nofollow noreferrer">BitDB</a> is an API to access (unfortunately) Bitcoin SV transactions. You can find instructions for opcode search if you scroll down at <a href="https://docs.bitdb.network/docs/indexer#level-2-script" rel="nofollow noreferrer">https://docs.bitdb.network/docs/indexer#level-2-script</a></p>

CC BY-SA 4.0
2020-02-15T16:00:36.970Z
I don't think this deserved the downvote! I gave a +1 just now! I saw that you committed to "Bitcoin Cash". Since you've been active on Chemistry and Quantum Computing and Mathematics too, could you consider committing also to [Materials Modeling](https://area51.stackexchange.com/proposals/122958/materials-modeling?referrer=NzliMzcwYWZiYTY1YWYyNDc0OGZhZGFlYWUwZjVjMDYzMmYyOWFiMDI0NjI3MTE5YWMzZTdhN2QwNTRmNGJjOdatQ-XZ8bEc4lCfnvtnMk3DKjWaJd2FG62dzoX6Nf7r0) which covers design of materials for solar cells, photo-voltaics, energy storage materials, new developments in batteries, and lighter or
user1271772
CC BY-SA 4.0
2020-02-15T16:00:49.860Z
stronger materials for cars, airplanes, spaceships, etc. It would be very lovely to have you in the Private Beta! Please commit if you don't think it would be inconvenient!
user1271772
CC BY-SA 4.0
2019-03-28T04:07:24.530Z
2019-03-28T04:07:24.530Z
MCCCS
<p>I have several OPCODES where I need real worlds examples…</p>

<p>However they are rarely used. So how to search and disassemble an existing mined transaction using it ?</p>

CC BY-SA 4.0
2019-03-28T02:23:41.700Z
I can't a provide a full answer right now due to my lack of SQL skills, but maybe someone can pick it up from that: http://blockchainsql.io/Query/Template/14
Tiago Loriato Simões
<transactions><script>
How to search for a transaction using a specifc OPCODE?
user2284570
# How to search for a transaction using a specifc OPCODE?

(Asked by: username_0 on 2019-03-28)

I have several OPCODES where I need real worlds examples…

However they are rarely used. So how to search and disassemble an existing mined transaction using it ?

**Tags:** transactions, script

> **Comments:**
> **username_1**: I can't a provide a full answer right now due to my lack of SQL skills, but maybe someone can pick it up from that: http://blockchainsql.io/Query/Template/14  

---

## 2 answers

### Answer by username_2 on 2019-03-28. Score: 2

I don't think this is possible. Most, if not all, block explorers and blockchain indexers do not completely disassemble scripts and index them so that they are searchable. No software or service I know of allows you to search by opcode use in a transaction. It would be pretty useless for a service to provide this as probably no one would actually use it and having such an index would be a huge resource cost.

I think the best you will be able to do is to do write a program to look through every single transaction's scriptSig and looking for the opcodes that you want. However, be careful that you don't interpret random bytes as being opcodes. You will need to have something that can disassemble scripts and check the disassembled scripts for the opcodes that you want. Furthermore, such disassemblers won't be able to disassemble a redeemScript which is the actual script where opcodes will actually be for P2SH inputs.

---

Instead of searching for an example of an opcode which probably hasn't been used, just try using it yourself. I recommend that you read <https://en.bitcoin.it/wiki/Script> to get an idea of how the opcode works. Then you can use a tool like <https://github.com/kallewoof/btcdeb> to execute and debug your script. This way you can learn how the opcode works through experimentation and see exactly how a script interpreter will execute the script.

> **Comments:**
> **username_0**: What about http://blockchainsql.io which inlude Opcode searching in transactions by ɪᴅ (though I have too limited knwolwedge to write the request) ? I only need basic dissaembly, not full.For trying, I don’t know how to compile a script nor I know how to convert an address into a hash for Scripting nor I know how to broadcast a transaction on Bitcoin testnet (I’m not aware of any online services allowing that). What I need is to verify some opcodes don’t create a new virtual address in block explorer (I mean that the money appear to be received to everyone).Hence the need for a block explorer.  
> **username_2**: AFAICT blockchainsql.io does not allow searching by opcode. It has a table which has all of the opcodes, but that does not mean that you can search for a transaction containing an opcode as the fields for transactions do not contain any reference to their opcodes table. Instead of trying to do something that you do not understand, why not simply ask exactly what it is that you want to understand and people here can help you. You are asking a question that you think will help you understand something you don't, so just ask the thing that you don't understand.  
> **username_0**: Ah yes… Correct, but asking directly is something [I did already](https://bitcoin.stackexchange.com/q/85688/64911).  
> **username_0**: Ok, then this exactly what I said since the beginning, I definitely need a real world example of `OP_CHECKLOCKTIMEVERIFY` for starting because as I understand, I need to construct signing in the transaction script manually which means there’s simply too much too do for just seeing the result in a block explorer anyway whatever happends.  

---

### Answer by username_3 on 2019-03-28. Score: 1

[BitDB](https://bitdb.network/) is an API to access (unfortunately) Bitcoin SV transactions. You can find instructions for opcode search if you scroll down at <https://docs.bitdb.network/docs/indexer#level-2-script>

> **Comments:**
> **username_4**: I don't think this deserved the downvote! I gave a +1 just now! I saw that you committed to "Bitcoin Cash". Since you've been active on Chemistry and Quantum Computing and Mathematics too, could you consider committing also to [Materials Modeling](https://area51.stackexchange.com/proposals/122958/materials-modeling?referrer=NzliMzcwYWZiYTY1YWYyNDc0OGZhZGFlYWUwZjVjMDYzMmYyOWFiMDI0NjI3MTE5YWMzZTdhN2QwNTRmNGJjOdatQ-XZ8bEc4lCfnvtnMk3DKjWaJd2FG62dzoX6Nf7r0) which covers design of materials for solar cells, photo-voltaics, energy storage materials, new developments in batteries, and lighter or  
> **username_4**: stronger materials for cars, airplanes, spaceships, etc. It would be very lovely to have you in the Private Beta! Please commit if you don't think it would be inconvenient!  

---

