Nested vs. Native SegWit
Nested vs. Native SegWit: P2SH-P2WPKH vs. Bech32
To ensure smooth adoption across the global Bitcoin network, developers created two separate formats of SegWit addresses: Nested SegWit (for immediate backward compatibility) and Native SegWit (the optimal, standard format).
🗺️ Structural Comparison
| Feature | Nested SegWit (P2SH-P2WPKH) | Native SegWit (P2WPKH / Bech32) |
|---|---|---|
| Address Starts With | 3... |
bc1q... |
| BIP Standard | BIP 141 | BIP 173 / BIP 350 |
| Encoding | Base58Check | Bech32 (Lowercase) |
| Encoding Case | Case-Sensitive (mix of upper/lower) | Case-Insensitive (strictly lowercase) |
| Wrapper Overhead | Yes (Wrapped inside a P2SH script) | No (Direct native output) |
| Fee Efficiency | ~20% cheaper than legacy P2PKH | ~38% cheaper than legacy P2PKH |
📦 1. Nested SegWit: The Compatibility Bridge
When SegWit activated, many legacy wallets and exchanges could not immediately upgrade their systems to recognize or send to brand-new native addresses starting with bc1q.
To prevent network fragmentation, Nested SegWit (P2SH-P2WPKH) was introduced:
- The P2SH Envelope: Upgraded wallets wrap a native SegWit output inside a legacy Pay-to-Script-Hash (P2SH) container.
- Legacy Compliance: To any legacy wallet, this address looks identical to a standard multi-sig address starting with
3. It sends funds to the address without error. - The Redemption Step: When spending the funds, the upgraded wallet reveals the P2SH redeemScript, which contains the SegWit instruction (
OP_0 <20-byte-key-hash>). - The Cost: Because of the P2SH envelope wrapper, Nested SegWit transactions carry a small payload overhead, making them about 10% more expensive in transaction fees compared to Native SegWit.
🎯 2. Native SegWit: Optimal Bech32 Efficiency
Native SegWit (P2WPKH) completely discards the legacy P2SH wrapper, sending funds directly to the SegWit output. It uses the modern Bech32 address format.
🛡️ Core Benefits of Bech32:
- Strict Error Correction (BCH Code): Bech32 uses a mathematical Bose-Chaudhuri-Hocquenghem (BCH) checksum code. If a user mistypes up to 4 characters in their address, the wallet will instantly detect the error and block the transaction, preventing coins from being sent to a dead address. It can even locate and correct a single-character typo automatically.
- Case-Insensitive lowercase: Bech32 consists entirely of lowercase letters and numbers.
- This makes the address much easier to read aloud or transcribe manually.
- It optimizes QR codes: lowercase-only character sets fit into simpler, denser QR patterns, making them significantly faster and more reliable to scan with mobile cameras.
- Maximum Fee Savings: By stripping the wrapping code, Native SegWit has the smallest transaction footprint of any Version 0 transaction format, yielding the lowest possible on-chain network fees.
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: