Opcodes · splice · enabled

OP_REVERSEBYTES (0xbc)

Reverses the byte order of the top item. Useful for switching between little-endian and big-endian data, such as hashes shown in explorers.

Verified
Stack in → out
x → reverse(x)
Cost
Base instruction cost 100 plus the byte length of the pushed result (2025 VM limits).
Bitcoin status
Not in Bitcoin (BTC)In Tapscript (BIP-342) this byte is an OP_SUCCESSx code reserved for future soft forks.

Example

<0x112233> OP_REVERSEBYTES <0x332211> OP_EQUAL

Step through it opcode by opcode in Bitauth IDE, the in-browser BCH VM debugger.

Sources

  1. BCHN upgrade specs: OP_REVERSEBYTES
  2. Libauth BCH_2023_05 opcodes (bch-2023-opcodes.ts)
  3. BIP-342: Validation of Taproot Scripts