P2PK (Pay-to-Public-Key): The Anchor Guide to Bitcoin's First Script
P2PK (Pay-to-Public-Key): The Anchor Guide to Bitcoin's First Script
Executive Summary: Pay-to-Public-Key (P2PK) was the original locking script used in the earliest versions of Bitcoin. Unlike modern transactions that send funds to a "hash" of a key (an address), P2PK locks coins directly to the raw bytes of a public key. While largely obsolete for daily use, P2PK remains historically significant as it secures the Genesis Block and the earliest mining rewards from Satoshi Nakamoto.
🔍 Why This Module Matters
To understand where Bitcoin is going, you must understand where it started. P2PK is the "Primal" script of the network. It represents a simpler time before the complexity of Base58 addresses and P2SH nested scripts. This module will deconstruct the "Raw Key" locking mechanism, explain why Satoshi eventually moved toward hashing (P2PKH), and analyze the security trade-offs of exposing public keys directly on the ledger. Understanding P2PK is essential for any blockchain historian or technical auditor.
🏛️ The Logic of the Raw Lock: Key vs. Hash
In modern Bitcoin, we use "Addresses" as a layer of abstraction. In P2PK, there is no abstraction.
1. Direct Ownership
In P2PK, the "Lock" (ScriptPubKey) contains the actual public key of the owner.
-
The Script:
<Public Key> OP_CHECKSIG -
The Verification: The network doesn't have to check a hash; it simply checks if the signature provided in the input matches the public key in the output.
2. The Identity Problem
Because P2PK locks to the raw key, there is no "Address."
-
Legacy Workflow: If you wanted to receive a P2PK payment in 2009, you had to give the sender your full 65-byte uncompressed public key.
-
Modern Workflow: You give them a 34-character Bech32 or Base58 address.
⚙️ Why P2PK Was Phased Out (The Move to P2PKH)
Within the first year, Satoshi introduced P2PKH (Pay-to-Public-Key-Hash). This upgrade was driven by three critical engineering factors:
1. Blockspace Efficiency
-
P2PK: Requires storing a 65-byte (uncompressed) or 33-byte (compressed) public key in the UTXO set for every output.
-
P2PKH: Only requires a 20-byte hash. This reduces the "RAM bloat" for full nodes significantly.
2. Typo Protection (Checksums)
Raw public keys are just strings of hex. If a user mistyped one character in a 65-byte key, the coins would be lost forever. By creating the "Address" standard (Base58Check), Bitcoin added a 4-byte checksum that catches human errors instantly.
3. Quantum Resistance (The "Hash" Shield)
In P2PK, your public key is published the moment you receive funds.
-
The Risk: A sufficiently powerful quantum computer could theoretically derive a private key from a public key.
-
The Shield: In P2PKH, your public key is hidden behind a double-hash (SHA-256 + RIPEMD-160). Your public key is only revealed to the network for a few seconds when you spend the coins, making a quantum attack exponentially more difficult.
🛠️ The Legacy of the Genesis Block
The most famous P2PK script in existence is the Coinbase of the Genesis Block.
-
Public Key:
04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f -
Status: These 50 BTC are locked in a P2PK script. Because they have never been spent, this public key has been sitting on the public ledger for over 15 years.
| Metric | P2PK | P2PKH (Modern) |
|---|---|---|
| Lock Target | Raw Bytes | 20-Byte Hash |
| Visibility | Public Key is always exposed. | Public Key is hidden until spend. |
| Safety | High risk of manual typos. | High safety (Base58 Checksums). |
| Usage | Mining rewards (v0.1 - v0.3). | Default for 99% of legacy transactions. |
🎯 Learning Objectives for this Module
By the end of this module, you will be able to:
-
Define P2PK and its role as the first Bitcoin script type.
-
Describe the physical difference between locking to a key vs. a hash.
-
Identify three reasons why the network moved from P2PK to P2PKH.
-
Understand the "Quantum Shield" property of hashed addresses.
-
Locate the Genesis Block public key and explain its significance.
🗺️ Module Roadmap: What's Next?
Now that we've seen the "Primitive" lock, we will explore the math of the modern lock:
-
P2PK Script Structure: A byte-level breakdown of the
OP_CHECKSIGcommand. -
The Move to P2PKH: How Base58Check addresses were invented.
-
Quantum Security Deep Dive: Why hashing protects against future threats.
-
Comparing Script Types: P2PK vs. P2PKH vs. P2SH.
🎓 Summary
P2PK is the "First Draft" of Bitcoin sovereignty. It demonstrated that money could be locked to a mathematical identity without a bank. While we have since developed more efficient and secure ways to transact, P2PK remains the bedrock upon which the entire history of the blockchain is built.
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation: