datadictionary.org
Script Template locking_script

P2PKH

Pay to public key hash. The default Bitcoin output type — roughly 95% of all transactions. Funds are locked to the hash of a public key; the spender reveals the key and signs.

name p2pkh
category locking_script
family payment
status stable

ASM Pattern

OP_DUP OP_HASH160  OP_EQUALVERIFY OP_CHECKSIG

Hex Pattern

76 a9 14 <20-bytes> 88 ac

Fields

Name Type Size Description
pubkey_hash bytes 20 HASH160 (RIPEMD160(SHA256(pubkey))) of the recipient public key.

Detector

method opcode_sequence
rule script.length == 25 && script[0] == 0x76 # OP_DUP && script[1] == 0xa9 # OP_HASH160 && script[2] == 0x14 # push 20 && script[23] == 0x88 # OP_EQUALVERIFY && script[24] == 0xac # OP_CHECKSIG
confidence high

Unlocking script

<signature> <pubkey>

The spender provides a signature over the transaction and the public key whose HASH160 matches pubkey_hash.

References

  • sCrypt by example: https://by-example.scrypt.io/p2pkh/
  • BSV reference: OP_DUP, OP_HASH160, OP_EQUALVERIFY, OP_CHECKSIG