Home › Glossary › P2PKH

P2PKH

Also called: Pay to Public Key Hash, pay-to-pubkey-hash, legacy address, 1 address, P2PKH address.

P2PKH (Pay to Public Key Hash) is Bitcoin's original single-key output type: coins locked to a public key hash, with addresses starting with 1.

P2PKH, Pay to Public Key Hash, is the original standard way of sending bitcoin to a single key. Its addresses start with 1 and are now usually called "legacy" addresses.

How it works

The output script locks coins to a 20-byte hash of a public key (HASH160: RIPEMD-160 of SHA-256):

OP_DUP OP_HASH160 <20-byte pubkey hash> OP_EQUALVERIFY OP_CHECKSIG

To spend, the owner puts a signature and the full public key in the scriptSig. The script checks that the key hashes to the stored value, then verifies the ECDSA signature with OP_CHECKSIG. The address is the hash in Base58Check with version byte 0, which is why it starts with 1. On testnet, P2PKH addresses start with m or n.

P2PKH predates the BIP process, so no BIP introduced it, but several shape how it's used: BIP 44 defines its derivation path (m/44'/0'/0'), BIP 66 requires strictly DER-encoded signatures, and BIP 13 reused the same Base58Check scheme for P2SH addresses.

P2PKH vs newer address types

Because the signature and key sit in the scriptSig, they count fully toward transaction size, and before SegWit third parties could alter them (transaction malleability). SegWit moved them into the witness: according to BIP 141, the equivalent P2WPKH output is 3 bytes smaller, and spending it costs fewer vbytes. Its bc1q address uses Bech32.

P2PKH remains valid, and every wallet can still send to it. Compare all the types in the address types guide or identify one with the address checker.

BIPs that define P2PKH

Related terms

  • P2WPKH: P2WPKH (Pay to Witness Public Key Hash) is the native SegWit single-key output type. Its bc1q addresses are always 42 characters long.
  • Base58Check: Base58Check is the original text encoding for Bitcoin addresses and keys: Base58 characters plus a 4-byte checksum from double SHA-256.
  • Public key: A public key is a point on the secp256k1 curve derived from a private key. Others use it to verify your signatures, and addresses are built from it.
  • ECDSA: ECDSA (Elliptic Curve Digital Signature Algorithm) is the signature scheme Bitcoin has used since 2009, over secp256k1, for all pre-Taproot outputs.
  • P2SH: P2SH (Pay to Script Hash), defined in BIP 16, locks bitcoin to the hash of a script. Its addresses start with 3, and it carried most early multisig.

Learn more

Guides