Understanding Bitcoin Address Types: A Complete Guide
Understanding Bitcoin Address Types: A Complete Guide
Bitcoin addresses are like email addresses for money—unique identifiers that tell the network where to send your bitcoin. But unlike email, Bitcoin has evolved through four distinct generations of address formats, each introducing new capabilities and trade-offs.
Understanding these generations helps you make informed decisions about security, fees, and functionality.
The Four Generations at a Glance
| Generation | Type | Prefix | Public Key Exposure | Script Capability |
|---|---|---|---|---|
| Gen 1 (2009) | P2PKH | 1... | Hidden until spend | No |
| Gen 2 (2012) | P2SH | 3... | Hidden until spend | Yes (hash-locked) |
| Gen 3 (2017) | P2WPKH / P2WSH | bc1q... | Hidden until spend | Yes (witness-based) |
| Gen 4 (2021) | P2TR | bc1p... | Exposed on receive | Yes (key + script paths) |
Key Security Insight: Generations 1-3 all use a "hash-locked" model where your public key stays hidden until you spend. Generation 4 (Taproot) made a deliberate trade-off, exposing the public key immediately in exchange for efficiency and privacy benefits. This has implications for quantum resistance.
Generation 1: P2PKH — The Original (2009)
Pay-to-Public-Key-Hash addresses launched with Bitcoin itself. They established the fundamental security model that protected public keys until spending.
Example Address
1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2
How It Works
- Your wallet generates a private key
- The private key derives a public key
- The public key is hashed (SHA-256 + RIPEMD-160)
- The hash becomes your address
Security Model: Your public key remains hidden behind a cryptographic hash until you spend. This provides a layer of protection—even if someone could reverse the public key to get the private key, they'd first need to reverse the hash to get the public key.
Characteristics
| Property | Value |
|---|---|
| Prefix | 1 (mainnet), m/n (testnet) |
| Length | 26-35 characters |
| Encoding | Base58Check |
| Public Key | Hidden until spend |
| Script Support | No |
| BIP Reference | Original protocol |
What It Introduced
- First practical Bitcoin address format
- Hash-based security model (public key hidden)
- Human-readable addresses (vs raw public keys)
Limitations
- No support for complex spending conditions
- Largest transaction size (highest fees)
- Single signature only
Current Status
- ~35% of UTXOs, holding ~6.5M BTC
- Trend: Declining as users migrate to newer formats
- Recommendation: Avoid for new wallets
Generation 2: P2SH — Programmable Money (2012)
Pay-to-Script-Hash introduced Bitcoin's first major upgrade: the ability to lock funds with arbitrary conditions, not just a single signature.
Example Address
3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy
How It Works
- Create a script defining spending conditions (e.g., "2 of 3 signatures required")
- Hash the script
- The hash becomes your address
- To spend, reveal the script and satisfy its conditions
The Innovation: P2SH separates "what conditions must be met" from "proving you met them." The address hides the complexity—a 2-of-3 multisig address looks identical to a simple address until funds are spent.
Characteristics
| Property | Value |
|---|---|
| Prefix | 3 (mainnet), 2 (testnet) |
| Length | 26-35 characters |
| Encoding | Base58Check |
| Public Key | Hidden until spend |
| Script Support | Yes (hash-locked) |
| BIP Reference | BIP 16 |
What It Introduced
- Multi-signature wallets: Require M-of-N signatures to spend
- Time-locked transactions: Funds locked until a specific time/block
- Atomic swaps: Trustless cross-chain exchanges
- Wrapped SegWit: P2SH-P2WPKH for backward compatibility
Limitations
- Script complexity revealed when spending (privacy leak)
- Variable transaction sizes depending on script
- Still uses Base58Check encoding
Current Status
- ~15% of UTXOs, holding ~3M BTC
- Trend: Stable, still essential for specific use cases
- Recommendation: Use for multi-sig when compatibility is priority
Generation 3: P2WPKH/P2WSH — The SegWit Revolution (2017)
Segregated Witness was Bitcoin's most significant upgrade, fundamentally changing how transactions are structured. It introduced two address types: P2WPKH (single-sig) and P2WSH (script-based).
Example Addresses
P2WPKH (42 characters):
bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq
P2WSH (62 characters):
bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3
How It Works
The key innovation is "segregating" (separating) the witness data (signatures) from the transaction data:
- Transaction data goes in the main block
- Witness data goes in a separate structure
- Witness data is "discounted" in fee calculations
Why "Segregated Witness"? By moving signatures outside the transaction, SegWit fixed transaction malleability (a long-standing bug), enabled the Lightning Network, and reduced effective transaction sizes by ~38%.
Characteristics
| Property | P2WPKH | P2WSH |
|---|---|---|
| Prefix | bc1q (42 chars) | bc1q (62 chars) |
| Encoding | Bech32 | Bech32 |
| Public Key | Hidden until spend | Hidden until spend |
| Script Support | No (single-sig only) | Yes (witness-based) |
| Fee Savings | ~38% vs P2PKH | ~38% vs P2SH |
| BIP References | BIPs 141, 143, 173 | BIPs 141, 143, 173 |
What It Introduced
- Lower fees: ~38% reduction through witness discount
- Fixed malleability: Enabled Layer 2 solutions like Lightning
- Better encoding: Bech32 is lowercase-only, better error detection
- Block capacity increase: Effective ~2MB blocks via witness discount
Limitations
- Not supported by very old wallets (pre-2017)
- Two similar-looking prefixes (bc1q) for different types
- Script still revealed when spending (P2WSH)
Current Status
- P2WPKH: ~40% of UTXOs, holding ~7.5M BTC (largest share)
- P2WSH: ~5% of UTXOs, holding ~1M BTC
- Trend: P2WPKH is the current standard
- Recommendation: Excellent choice for most users
Generation 4: P2TR — Taproot's Trade-off (2021)
Pay-to-Taproot represents a philosophical shift in Bitcoin address design. It prioritizes efficiency and privacy for complex transactions, but makes a notable trade-off on public key exposure.
Example Address
bc1p5cyxnuxmeuwuvkwfem96lqzszd02n6xdcjrs20cac6yqjjwudpxqkedrcr
How It Works
Taproot combines two spending paths in one address:
Key Path (simple case):
- Spend directly with a single signature
- Most efficient, looks like any other Taproot spend
- Public key is exposed in the address itself
Script Path (complex case):
- Reveal and satisfy one of multiple possible scripts
- Uses Merkle trees to hide unused conditions
- Only reveals the path actually used
Critical Security Change: Unlike all previous generations, Taproot addresses expose the public key when you receive funds—not when you spend. This is a deliberate design choice with implications for quantum resistance.
Characteristics
| Property | Value |
|---|---|
| Prefix | bc1p (mainnet), tb1p (testnet) |
| Length | 62 characters |
| Encoding | Bech32m (improved) |
| Public Key | Exposed on receive |
| Script Support | Yes (key path + script path) |
| Fee Savings | ~40% vs P2PKH |
| BIP References | BIPs 340, 341, 342 |
What It Introduced
Schnorr Signatures (BIP 340):
- More efficient than ECDSA
- Enable key aggregation (multiple keys → one key)
- Support batch verification
MAST — Merkelized Alternative Script Trees (BIP 341):
- Hide unused script conditions
- Only reveal the spending path used
- Complex transactions look simple
Privacy Breakthrough:
- Multi-sig transactions look identical to single-sig
- Time-locks, escrows, and simple payments all look the same
- Observers can't distinguish transaction types
The Quantum Trade-off
Previous generations kept your public key hidden behind a hash until you spent funds. Taproot deliberately exposes it:
| Generation | Public Key Visible | Quantum Attack Window |
|---|---|---|
| Gen 1-3 (P2PKH, P2SH, SegWit) | Only after spending | Between broadcast and confirmation |
| Gen 4 (Taproot) | Immediately on receive | Entire time funds are held |
Why This Matters: A sufficiently powerful quantum computer could theoretically derive private keys from public keys. For Gen 1-3 addresses with unspent funds, an attacker would need to break the hash first. For Taproot, the public key is already visible.
However, this is a future concern—no such quantum computer exists today, and Bitcoin developers are actively researching post-quantum solutions including a proposed BIP-360 that would add a quantum-safe Taproot variant.
Current Status
- ~5% of UTXOs, holding ~1M BTC
- Trend: Growing rapidly
- Recommendation: Best for privacy-focused use cases; consider Gen 3 for long-term cold storage if quantum concerns you
Evolution Summary: What Each Generation Changed
| Generation | Key Innovation | Trade-off |
|---|---|---|
| Gen 1: P2PKH | Hash-protected public keys | No programmability |
| Gen 2: P2SH | Programmable spending conditions | Script revealed on spend |
| Gen 3: SegWit | 38% fee reduction, fixed malleability | Required network upgrade |
| Gen 4: Taproot | Privacy for complex transactions | Public key exposed early |
Transaction Fee Comparison
The practical impact of each generation on your wallet:
| Type | Typical Size | At 10 sat/vB | At 50 sat/vB | Savings vs Gen 1 |
|---|---|---|---|---|
| Gen 1: P2PKH | ~225 vB | 2,250 sats | 11,250 sats | Baseline |
| Gen 2: P2SH-P2WPKH | ~166 vB | 1,660 sats | 8,300 sats | ~26% |
| Gen 3: P2WPKH | ~140 vB | 1,400 sats | 7,000 sats | ~38% |
| Gen 4: P2TR | ~135 vB | 1,350 sats | 6,750 sats | ~40% |
Wallet Compatibility
| Wallet Era | Gen 1 (1...) | Gen 2 (3...) | Gen 3 (bc1q...) | Gen 4 (bc1p...) |
|---|---|---|---|---|
| Pre-2017 | Yes | Yes | Maybe | No |
| 2017-2021 | Yes | Yes | Yes | Maybe |
| 2021+ | Yes | Yes | Yes | Yes |
Recommendations by Use Case
Daily Spending Wallet
Recommendation: Gen 3 (P2WPKH) or Gen 4 (P2TR)
- Best fee efficiency
- Wide compatibility
- Quick transactions
Long-term Cold Storage
Recommendation: Gen 3 (P2WPKH)
- Public key stays hidden until you spend
- Excellent fee savings when you eventually move funds
- Well-supported by hardware wallets
If quantum computing concerns you for very long-term storage (10+ years), Gen 3's hash-protected public keys offer an additional security layer compared to Taproot.
Multi-signature Security
Recommendation: Gen 4 (P2TR) or Gen 3 (P2WSH)
- P2TR: Best privacy (multi-sig looks like single-sig)
- P2WSH: More established, hash-protected keys
Maximum Compatibility
Recommendation: Gen 2 (P2SH-P2WPKH)
- "Wrapped SegWit" works with virtually all wallets
- Still provides ~26% fee savings
- Good middle ground
Key Takeaways
Summary: Choosing Your Address Type
-
Understand the generations: Each solved specific problems while introducing new trade-offs.
-
Public key exposure matters: Gen 1-3 hide your public key until spending; Gen 4 exposes it immediately. This affects long-term quantum resistance.
-
Gen 3 (bc1q) is the current sweet spot: Best combination of security model, fee savings, and compatibility for most users.
-
Gen 4 (bc1p) excels at privacy: Complex transactions become indistinguishable from simple ones—valuable for multi-sig and smart contracts.
-
Gen 1 (1...) is obsolete: Higher fees, no benefits. Migrate when practical.
Technical Appendix
Address Encoding Formats
| Encoding | Used By | Character Set | Error Detection |
|---|---|---|---|
| Base58Check | Gen 1, Gen 2 | Alphanumeric (no 0, O, I, l) | 4-byte checksum |
| Bech32 | Gen 3 | Lowercase alphanumeric | BCH code |
| Bech32m | Gen 4 | Lowercase alphanumeric | Modified BCH (improved) |
Identifying Address Types in Code
function identifyAddressGeneration(address: string): string {
// Mainnet addresses
if (address.startsWith('1')) {
return 'Gen 1: P2PKH (Legacy)';
}
if (address.startsWith('3')) {
return 'Gen 2: P2SH (may wrap SegWit)';
}
if (address.startsWith('bc1q')) {
return address.length === 42
? 'Gen 3: P2WPKH (Native SegWit)'
: 'Gen 3: P2WSH (Native SegWit Script)';
}
if (address.startsWith('bc1p')) {
return 'Gen 4: P2TR (Taproot)';
}
// Testnet addresses
if (address.startsWith('m') || address.startsWith('n')) {
return 'Testnet Gen 1: P2PKH';
}
if (address.startsWith('2')) {
return 'Testnet Gen 2: P2SH';
}
if (address.startsWith('tb1q')) {
return 'Testnet Gen 3: SegWit';
}
if (address.startsWith('tb1p')) {
return 'Testnet Gen 4: Taproot';
}
return 'Unknown address format';
}
Further Reading
Disclaimer: This article is for educational purposes only. Address formats, network statistics, and security considerations evolve over time. Always verify current best practices before making significant decisions about Bitcoin storage.