Opcodes · splice · enabled

OP_BIN2NUM (0x81)

Converts a byte string to the minimally encoded number it represents. It uses the byte of the disabled OP_RIGHT.

Verified
Stack in → out
bin → n
Cost
Base instruction cost 100 plus result length (2025 VM limits).
Bitcoin status
Not in Bitcoin (BTC)0x81 is the disabled OP_RIGHT in BTC; an OP_SUCCESS code in Tapscript.

Example

<0x02000000> OP_BIN2NUM OP_2 OP_EQUAL

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

Sources

  1. BCHN upgrade specs: Restore disabled script opcodes, May 2018
  2. Libauth BCH_2023_05 opcodes (bch-2023-opcodes.ts)
  3. BIP-342: Validation of Taproot Scripts