Opcodes · aritmética · habilitado

OP_MOD (0x97)

Apila el resto de dividir a entre b. El módulo por cero falla. Rehabilitado en BCH en mayo de 2018. Desde mayo de 2025, los números pueden tener hasta 10.000 bytes de longitud (BigInt).

Verificado
Pila: entrada → salida
a b → a%b
Costo
Base instruction cost 100, plus twice the result length, plus the product of the two input lengths to cover O(n²) work (2025 VM limits).
Estado en Bitcoin
Deshabilitado en Bitcoin (BTC)Disabled since 2010; an OP_SUCCESS code in Tapscript.

Ejemplo

OP_7 OP_2 OP_MOD OP_1 OP_EQUAL

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

Fuentes

  1. BCHN upgrade specs: Restore disabled script opcodes, May 2018
  2. CHIP-2021-05 VM Limits: Targeted Virtual Machine Limits
  3. CHIP-2024-07 BigInt: High-Precision Arithmetic