Opcodes · apilamiento · habilitado

OP_0 (0x00)

Apila una cadena de bytes vacía, que la VM interpreta como el número 0 y como falso.

Verificado
Pila: entrada → salida
∅ → 0
Desde
Script original de Bitcoin
Costo
Base instruction cost 100; pushes 0 bytes.
Estado en Bitcoin
Igual en Bitcoin (BTC)
También conocido como
OP_FALSE

Ejemplo

OP_0 OP_IF <0x01> OP_ELSE <0x02> OP_ENDIF <0x02> OP_EQUAL
Paso Pila después (cima a la derecha) Qué ocurre
OP_0 0x Pushes an empty item: the number 0, and false.
OP_IF ∅ Pops the false item and skips to OP_ELSE; <0x01> never runs.
<0x02> 0x02 The OP_ELSE branch runs.
OP_ENDIF 0x02 Closes the conditional.
<0x02> 0x02 0x02
OP_EQUAL 1 The ELSE branch ran, so the script ends true.

Recórrelo opcode por opcode en Bitauth IDE, el depurador de la VM de BCH en el navegador.

Dónde se usa OP_0

Fuentes

  1. Libauth BCH_2023_05 opcodes (bch-2023-opcodes.ts)
  2. CHIP-2021-05 VM Limits: Targeted Virtual Machine Limits