Pay-to-Public-Key-Hash (P2PKH)

Pay-to-Public-Key-Hash (P2PKH) is the standard way bitcoin is sent and received on the Bitcoin network. Instead of sending coins directly to someone’s public key, the sender uses a shortened version—a hash—of that public key as the destination, known as a Bitcoin address. This approach not only makes addresses easier to handle and share, but also adds an extra layer of security; the public key itself isn’t revealed until the coins are later spent.

With P2PKH, the recipient generates an address from their wallet and shares it with the sender. When the sender creates the transaction, they use this address. To later spend these coins, the recipient must provide both their public key (which must hash to the address used) and a digital signature created with their matching private key. This process ensures only the rightful owner can spend the bitcoin.

P2PKH is defined in the Bitcoin scripting language as a kind of ScriptPubKey. It is the most widely used format for Bitcoin transactions. For comparison, older Pay-to-Public-Key (P2PK) transactions locked coins directly to a public key, but P2PKH improves privacy and efficiency by locking them to its hash instead.