P2SH-HL

Pay to Script Hash (HashLock)

A Pay-to-Script-Hash (HashLock) script is a P2SH output that includes a hash-based condition in its redeemScript. The funds can only be spent by providing a secret value that, when hashed, matches a predefined hash. This is commonly used in atomic swaps and other cryptographic protocols.

OP_Code(s) Review

P2SH-HashLock combines the P2SH structure with a hash verification step. The redeemScript includes hashing the provided secret, comparing it to a predefined hash, and then verifying a signature.

# WitnessScript

<signature>

<secret>

<redeemScript>

# RedeemScript

OP_HASH160

<hashOfSecret>

OP_EQUALVERIFY

<publicKey>

OP_CHECKSIG

Step 1

Push <signature> onto the stack