All opcodes are declared in the script.h file in the Bitcoin reference client source code.
This can be accessed from the link at https://github.com/bitcoin/bitcoin/blob/master/src/script/script.h under the following comment: /** Script opcodes */ A description of the most commonly used opcodes is listed here.
The Programmable Logic Behind Every Transaction (Part 2)
This table is taken from the Bitcoin developer’s guide: Opcode Description This takes a public key and signature and validates the signature of the hash of the OP_CHECKSIG transaction.
If it matches, then TRUE is pushed onto the stack; otherwise, FALSE is pushed.
OP_EQUAL This returns 1 if the inputs are exactly equal; otherwise, 0 is returned.
OP_HASH160 The input is hashed twice, first with SHA-256 and then with RIPEMD-160.
OP_VERIFY This marks the transaction as invalid if the top stack value is not true.
OP_EQUALVERIFY This is the same as OP_EQUAL, but it runs OP_VERIFY afterwards.
Why This Matters for Blockchain Technology
This takes the first signature and compares it against each public key until a match is found OP_CHECKMULTISIG and repeats this process until all signatures are checked.
If all signatures turn out to be valid, then a value of 1 is returned as a result; otherwise, 0 is returned.
Key Points to Remember
- Commonly used opcodes All opcodes are declared in the script.h file in the Bitcoin reference client source code.
- This can be accessed from the link at https://github.com/bitcoin/bitcoin/blob/master/src/script/script.h under the following comment: /** Script opcodes */ A description of the most commonly used opcodes is listed here.
- This table is taken from the Bitcoin developer’s guide: Opcode Description This takes a public key and signature and validates the signature of the hash of the OP_CHECKSIG transaction.
- If it matches, then TRUE is pushed onto the stack; otherwise, FALSE is pushed.
Conclusion
Commonly used opcodes represents one of the many innovative layers that make blockchain technology so powerful and transformative. As distributed systems continue to evolve, a solid understanding of these core concepts becomes increasingly valuable — not just for developers, but for anyone building, investing in, or working alongside blockchain-powered systems.
Whether you are just starting your blockchain journey or deepening existing expertise, mastering these fundamentals gives you the tools to think clearly about decentralized systems and make smarter decisions in this rapidly evolving space.