# Script opcodes

Opcodes are Bitcoin Script's instructions: duplicate, hash, compare, check signatures and times. A clear reference to the opcodes you will see most.

Canonical page: https://mybitcoinexplorer.com/learn/opcodes
Topic: Bitcoin Script
Published: 2026-10-29
Updated: 2026-10-30


## The everyday set
| Opcode | Byte | What it does |
|---|---|---|
| `OP_DUP` | 0x76 | Copies the top item |
| `OP_HASH160` | 0xa9 | Replaces the top item with its [HASH160](https://mybitcoinexplorer.com/learn/hash160-and-ripemd160) |
| `OP_EQUAL` | 0x87 | Pushes TRUE if the top two items are equal |
| `OP_EQUALVERIFY` | 0x88 | Same, but fails immediately if they're not |
| `OP_CHECKSIG` | 0xac | Checks a signature against a public key and the transaction |
| `OP_CHECKMULTISIG` | 0xae | Checks m signatures against n public keys |
| `OP_CHECKLOCKTIMEVERIFY` | 0xb1 | Fails if the transaction's locktime is too early |
| `OP_CHECKSEQUENCEVERIFY` | 0xb2 | Fails if the relative timelock isn't met |
| `OP_RETURN` | 0x6a | Marks the output as unspendable, used for data |
| `OP_0` to `OP_16` | 0x00, 0x51–0x60 | Push small numbers |

## "VERIFY" versions
> Diagram: Two opcodes in action: OP_DUP copies the top item, OP_HASH160 hashes the copy — <pubkey → :pubkey;OP_DUP:pubkey,pubkey;OP_HASH160:pubkey,hash

Opcodes ending in `VERIFY` check something and **stop the script** with failure if it's false, instead of pushing FALSE. That keeps scripts short.

## Disabled opcodes
Early on, Satoshi disabled opcodes such as `OP_CAT` and `OP_MUL` after bugs were found. Any script using a disabled opcode fails. Re-enabling some of them is a regular topic of Bitcoin proposals, which would need a [soft fork](https://mybitcoinexplorer.com/learn/soft-forks-and-hard-forks).

## Reading a real script
~~~
OP_DUP OP_HASH160 <20-byte hash> OP_EQUALVERIFY OP_CHECKSIG
76     a9         14 <…20 bytes…>   88             ac
~~~
That's the classic [Pay to public key hash (P2PKH)](https://mybitcoinexplorer.com/learn/p2pkh) lock. The `14` means "push the next 20 bytes".


## Opcodes added by soft forks
| Opcode | Added | Purpose |
|---|---|---|
| OP_CHECKLOCKTIMEVERIFY | 2015, BIP 65 | Absolute timelocks |
| OP_CHECKSEQUENCEVERIFY | 2016, BIP 112 | Relative timelocks |
| OP_CHECKSIGADD | 2021, BIP 342 | Efficient multisig in Tapscript |

New opcodes are added by redefining "no-op" opcodes, so old nodes still accept the scripts, which keeps upgrades as soft forks.

## OP_SUCCESS in Tapscript
Taproot reserved many unused opcode numbers as `OP_SUCCESSx`, which make a script succeed today. Future soft forks can give them real meanings safely.


## Key takeaways

- Opcodes are single-byte instructions in Script.
- VERIFY variants fail immediately instead of pushing false.
- Some opcodes were disabled early for safety.

## Common questions

### What does OP_CHECKSIG actually sign?

A hash of the spending transaction, built according to the signature's sighash flag.

### Are there opcodes for loops?

No. Script has conditionals (OP_IF) but no loops.

### How many opcodes does Bitcoin have?

Around 100 are defined and usable; several more are disabled or reserved.

### Can new opcodes be added?

Yes, through soft forks that redefine reserved opcodes, as with CLTV and CSV.

## Related lessons

- [Bitcoin Script](https://mybitcoinexplorer.com/learn/bitcoin-script)
- [The stack](https://mybitcoinexplorer.com/learn/the-stack)
- [Pay to public key hash (P2PKH)](https://mybitcoinexplorer.com/learn/p2pkh)
- [OP_RETURN data outputs](https://mybitcoinexplorer.com/learn/op-return)
