Opcodes · pila · habilitado

OP_ROLL (0x7a)

Saca n y luego mueve al tope el elemento que está n posiciones más abajo.

Verificado
Pila: entrada → salida
… x … n → … … x
Desde
Script original de Bitcoin
Costo
Base instruction cost 100 plus bytes pushed plus the roll depth. For example, rolling a 1-byte item from depth 2 makes the OP_ROLL itself cost 103 (2025 VM limits).
Estado en Bitcoin
Igual en Bitcoin (BTC)

Ejemplo

<'a'> <'b'> <'c'> OP_2 OP_ROLL

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

Fuentes

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