Pay to public key hash

P2PKH

The ordinary payment. The lock names a key by its hash, and only that key can spend it.

What it is

A P2PKH output locks sats to the hash of a public key. A Bitcoin address is that hash, written in Base58Check with a version byte in front. To spend the output, the owner shows the full public key and signs the spending transaction with it.

Script pattern

  1. OP_DUP Copies the public key the spender supplies.
  2. OP_HASH160 Hashes the copy with SHA-256, then RIPEMD-160.
  3. <pubkey hash> 20 bytes: the owner's key hash. This is the address.
  4. OP_EQUALVERIFY Stops unless the two hashes match.
  5. OP_CHECKSIG Checks the spender's signature against the key.

25 bytes in all.

How it is spent

A signature and the public key whose hash is in the lock: <signature> <public key>.

Background

P2PKH has been the standard payment since Bitcoin's first release in 2009. Locking to a hash rather than the key itself keeps the key private until the first spend, and makes addresses shorter. Wallets use it for payments and for change, so it is the most common output on chain by far.

First seen and adoption

First seen in block 728, on 2009-01-16. Its first transaction is 6f7cf9580f1c2dfb3c4d5d043cdbb128c640e3f20161245aa7372e9666168516.

Counts cover blocks 0 to 169755, every one verified complete and typed; the highest block we know is 974917. Blocks 169756 to 313024 are complete and not typed yet. A transaction with several types counts once under each. First seen means first seen in that range.

Transactions of this type per 10,000 blocks
From block Transactions
0 43
10,000 34
20,000 66
30,000 113
40,000 402
50,000 5,026
60,000 13,104
70,000 14,828
80,000 14,326
90,000 67,075
100,000 63,058
110,000 135,799
120,000 245,742
130,000 529,858
140,000 478,103
150,000 391,619
160,000 432,245

On chain

Transactions with an output of exactly this script shape, by template hash 09507a7ca50f… Transaction pages need sign-in.

Specification