The First P2PKH Output

← Back to Chapter 5
January 16, 2009 — Block 728. Thirteen days after genesis, someone created a transaction that spent two P2PK coinbase outputs (2 × 50 BTC) and consolidated them into a single output of a type the network had never seen: Pay to Public Key Hash. The scriptPubKey no longer contained a raw public key. Instead, it contained a 20-byte hash — and with it, the first Bitcoin address.
Raw Transaction 258 bytes · txid: 6f7cf958…68516
Version Count ScriptSig Value Opcodes Pubkey Hash Locktime
The transition in one transaction: The two inputs are P2PK — their scriptSigs contain only a DER signature (73 bytes each). No public key in the scriptSig because P2PK puts the key in the output. The single output is P2PKH — the scriptPubKey contains a 20-byte hash instead of a 65-byte key. This is the old world funding the new.
P2PKH ScriptPubKey — Byte by Byte 25 bytes
76
OP_DUP
Duplicate the top stack item (the public key provided by the spender)
a9
OP_HASH160
Pop, compute SHA-256 then RIPEMD-160, push the 20-byte result
14
OP_PUSHBYTES_20
Push the next 20 bytes onto the stack
12ab8dc5 88ca9d57 87dde7eb 29569da6 3c3a238c
Pubkey Hash
The 20-byte Hash160 that defines this address — the expected fingerprint of the spender's public key
88
OP_EQUALVERIFY
Compare the computed hash with the stored hash — abort if they differ
ac
OP_CHECKSIG
Verify the ECDSA signature against the public key — push TRUE or FALSE
From Hash to Address — Base58Check Encoding Live computation