Opcodes · crypto · enabled

OP_RIPEMD160 (0xa6)

Replaces the top item with its RIPEMD-160 hash (20 bytes).

Verified
Stack in → out
x → hash(x)
Since
Original Bitcoin script
Cost
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).
Bitcoin status
Same in Bitcoin (BTC)

Example

<'abc'> OP_RIPEMD160 <0x8eb208f7e05d987a9b044a8e98c6b087f15a0bfc> OP_EQUAL
Step Stack after (top on the right) What happens
<'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.

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

Where OP_RIPEMD160 is used

Sources

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