Opcodes · criptografía · habilitado
OP_RIPEMD160 (0xa6)
Reemplaza el elemento superior por su hash RIPEMD-160 (20 bytes).
Verificado
- Pila: entrada → salida
- x → hash(x)
- Desde
- Script original de Bitcoin
- Costo
- Base instruction cost 100 plus result length, plus 192 per hash digest iteration under relay policy (64 under consensus); digest iterations also count toward the per-input hashing limit (2025 VM limits).
- Estado en Bitcoin
- Igual en Bitcoin (BTC)
Ejemplo
<'abc'> OP_RIPEMD160 <0x8eb208f7e05d987a9b044a8e98c6b087f15a0bfc> OP_EQUAL | Paso | Pila después (cima a la derecha) | Qué ocurre |
|---|---|---|
<'abc'> | 616263 | The three ASCII bytes of abc. |
OP_RIPEMD160 | 8eb208f7…0bfc | The RIPEMD-160 test vector for abc. |
<0x8eb2…0bfc> | 8eb208f7…0bfc 8eb208f7…0bfc | The expected hash. |
OP_EQUAL | 1 | The hashes match. |
Recórrelo opcode por opcode en Bitauth IDE, el depurador de la VM de BCH en el navegador.
Dónde se usa OP_RIPEMD160
- Contratos CashScript ripemd160() : The built-in ripemd160(x) compiles to OP_RIPEMD160 and returns 20 bytes.
- Contratos P2PKH and P2SH20 addresses, through OP_HASH160 : OP_HASH160 runs RIPEMD-160 over a SHA-256 hash in one opcode. Every P2PKH and P2SH20 address is that 20-byte result.
- CHIP VM Limits: Targeted Virtual Machine Limits : Charges each hash digest iteration against a per-input hashing limit, and adds it to the operation cost.