Wiki/Native SegWit Outputs: P2WPKH and P2WSH
Native SegWit Outputs: P2WPKH and P2WSH - Biturai Wiki Knowledge
INTERMEDIATE | BITURAI KNOWLEDGE

Native SegWit Outputs: P2WPKH and P2WSH

P2WPKH and P2WSH represent the native SegWit output types, offering enhanced transaction efficiency and lower fees on the Bitcoin network. These address formats are crucial for modern Bitcoin transactions, distinguishing between simple

Biturai Knowledge
Biturai Knowledge
Research library
Updated: 6/26/2026
Technically checked

Structure, readability, internal linking, and SEO metadata were automatically checked. This article is continuously updated and is educational content, not financial advice.

Definition

P2WPKH (Pay-to-Witness-Public-Key-Hash) and P2WSH (Pay-to-Witness-Script-Hash) are the two primary native Segregated Witness (SegWit) output types on the Bitcoin blockchain. They represent the most efficient and modern ways to send and receive Bitcoin, distinguished by their bc1q address prefix. P2WPKH is designed for standard, single-signature transactions, similar to its predecessor P2PKH, but leverages SegWit to reduce transaction size and fees. P2WSH, on the other hand, is built for more complex multi-signature or time-locked transactions, where funds are locked to the hash of an arbitrary script, offering greater flexibility and advanced functionality.

These native SegWit outputs are a direct result of the SegWit upgrade, which fundamentally altered how transaction data, specifically signatures and public keys (the "witness" data), is stored. By segregating this data from the main transaction body, SegWit addresses enable a higher transaction throughput and lower costs for users. The adoption of these formats signifies a significant step forward in Bitcoin's scalability and efficiency, making them the preferred choice for most contemporary Bitcoin transactions.

Key Takeaway

The primary advantage of using native SegWit outputs like P2WPKH and P2WSH is the substantial reduction in transaction fees and an increase in transaction processing capacity on the Bitcoin network. By optimizing how transaction data is structured and stored, these address types allow more transactions to fit into each block, leading to lower costs for users and improved overall network efficiency. P2WPKH is ideal for everyday, straightforward payments, while P2WSH provides the necessary framework for sophisticated smart contract-like functionalities on Bitcoin.

Understanding the distinction between these two native SegWit types is essential for anyone interacting with Bitcoin, from casual users to advanced developers. Choosing the appropriate address type ensures optimal transaction efficiency and access to the full range of Bitcoin's capabilities, from simple transfers to complex multi-signature arrangements. Their widespread adoption by wallets and exchanges underscores their importance in the ongoing evolution of the Bitcoin protocol.

Mechanics

The core mechanic behind P2WPKH and P2WSH lies in Segregated Witness (SegWit), a protocol upgrade activated in 2017. SegWit separates the "witness" data (primarily signatures and public keys) from the main transaction data. This separation effectively reduces the "virtual size" of a transaction, as the witness data is counted differently towards the block weight limit, rather than the traditional block size limit. This innovation allows more transactions to be included in a single Bitcoin block, enhancing the network's overall throughput without increasing the actual block size.

For P2WPKH (Pay-to-Witness-Public-Key-Hash), the process is as follows: When a user wants to receive funds, they generate a public key hash. This hash is then encoded into a Bech32 address, which starts with bc1q. To spend these funds, the user must provide their public key and a valid digital signature. Crucially, both the public key and the signature are placed in the segregated witness part of the transaction. This differs from older P2PKH transactions where the public key and signature were part of the main transaction body, making them larger. By moving this data to the witness, P2WPKH transactions become significantly smaller in terms of virtual bytes, resulting in lower transaction fees. It essentially functions like a P2PKH transaction but with the efficiency benefits of SegWit.

P2WSH (Pay-to-Witness-Script-Hash) extends this concept to more complex scenarios. Instead of locking funds to a public key hash, P2WSH locks funds to the hash of an arbitrary script. This script can define various conditions for spending the funds, such as requiring multiple signatures (multi-sig), time locks, or other advanced cryptographic puzzles. When creating a P2WSH output, the hash of this complex script is embedded in the transaction output, and an address starting with bc1q is generated from it. To spend the funds, the full script, along with the necessary signatures and data to satisfy the script's conditions, must be provided in the witness section of the transaction. This allows for highly customizable and secure spending conditions while still benefiting from SegWit's fee reductions and malleability fixes. The flexibility of P2WSH makes it suitable for advanced applications like Lightning Network channels or sophisticated escrow services.

Trading Relevance

The adoption of native SegWit outputs, P2WPKH and P2WSH, holds significant trading relevance primarily through their impact on transaction costs and network efficiency. For active traders, especially those engaging in frequent transfers between exchanges or managing multiple wallets, lower transaction fees directly translate into reduced operational overhead. The fee savings, which can be substantial compared to legacy P2PKH transactions, improve the profitability of trading strategies, particularly for smaller trades where fees can disproportionately eat into margins. This efficiency gain encourages more fluid movement of capital within the crypto ecosystem, supporting a more dynamic trading environment.

Furthermore, the increased transaction capacity facilitated by SegWit indirectly contributes to a more stable and responsive trading environment. By allowing more transactions per block, SegWit helps mitigate network congestion during periods of high demand, potentially leading to faster confirmation times for transactions. While confirmation times are also influenced by miner fees, the underlying capacity improvement provided by SegWit reduces the overall pressure on the network. This can be particularly beneficial during volatile market conditions when swift execution of trades and transfers is paramount. Traders benefit from a more predictable and less costly transaction landscape, enabling them to react more effectively to market movements without being unduly penalized by high network fees.

Risks

While native SegWit outputs offer substantial advantages, certain risks and considerations remain. One primary concern, particularly in the early days of SegWit adoption, was wallet and exchange compatibility. Although most major platforms now fully support bc1q addresses, some older or less-maintained wallets and services might still lack native SegWit support. Sending funds from a native SegWit address to an unsupported legacy address, or vice-versa, typically results in the transaction being processed correctly due to backward compatibility mechanisms (like wrapped SegWit), but it can lead to confusion or higher fees if not handled optimally. Users must always verify that their chosen wallet or exchange fully supports native SegWit for both sending and receiving to ensure the best experience and lowest fees.

Another risk stems from user error and misunderstanding of the different address types. Accidentally sending funds to an incorrect address format, while often recoverable if the address is valid for another type, can cause delays and necessitate complex recovery procedures. More critically, a fundamental misunderstanding of P2WPKH versus P2WSH could lead to incorrect setup of complex transactions. For instance, attempting to implement a multi-signature scheme using a P2WPKH address, which is designed for single public key hashes, would be impossible or result in lost funds. Users must educate themselves on the specific use cases for each native SegWit type to avoid operational mistakes that could compromise their funds or transaction intent. The complexity of managing various address types requires a diligent approach to ensure security and efficiency.

History and Examples

The journey to native SegWit outputs began with the activation of Segregated Witness (SegWit) on the Bitcoin network in August 2017, following a long and often contentious debate within the community. The proposal, primarily outlined in BIPs (Bitcoin Improvement Proposals) 141, 143, 144, and 145, aimed to address two critical issues: transaction malleability and network scalability. Transaction malleability, a long-standing vulnerability, meant that a transaction's ID could be altered before confirmation, posing challenges for advanced protocols like the Lightning Network. SegWit fixed this by moving the witness data outside the transaction ID calculation. Simultaneously, by effectively increasing the block weight limit, SegWit allowed for more transactions per block, alleviating network congestion.

Initially, many wallets and exchanges adopted P2SH-P2WPKH (Pay-to-Script-Hash-Pay-to-Witness-Public-Key-Hash), often referred to as "wrapped SegWit." These addresses start with 3 and allowed SegWit transactions to be sent from wallets that only understood the P2SH format, acting as a compatibility layer. However, these wrapped SegWit transactions still carried a slightly higher fee burden than native SegWit. The introduction of native SegWit addresses, specifically P2WPKH and P2WSH, marked the full realization of SegWit's benefits. These addresses, encoded in the Bech32 format and starting with bc1q, offer the maximum fee savings and are fully optimized for the SegWit structure.

Example for P2WPKH: Imagine a user, Alice, wants to receive a standard Bitcoin payment. She generates a native SegWit address, which will look something like bc1q.... When Bob sends funds to this address, the transaction output specifies that the funds are locked to the hash of Alice's public key, and the spending conditions (Alice's public key and signature) will reside in the witness section. This results in a smaller transaction size and lower fees compared to sending to an older P2PKH address.

Example for P2WSH: Consider a scenario where a company, "Biturai Corp," wants to set up a multi-signature wallet requiring 2 out of 3 directors to approve any spending. They would create a script defining this 2-of-3 multi-signature condition. The hash of this script would then be used to generate a P2WSH address, also starting with bc1q. When funds are sent to this address, they are locked by the script hash. To spend, two of the three directors must provide their signatures, and the full script along with these signatures would be included in the witness data, satisfying the spending conditions efficiently and securely. This demonstrates P2WSH's power for complex, programmable transactions.

Common Misunderstandings

One prevalent common misunderstanding revolves around the distinction between native SegWit (P2WPKH/P2WSH) and wrapped SegWit (P2SH-P2WPKH). Many users incorrectly assume that any address starting with 3 (P2SH) is a native SegWit address, or that all SegWit addresses offer the same benefits. In reality, 3-prefixed addresses often represent P2SH-P2WPKH, which is a "nested" SegWit type designed for backward compatibility. While it offers some fee savings over legacy P2PKH, it is less efficient than native SegWit addresses (starting with bc1q). Native SegWit provides the full benefits of SegWit, including the lowest transaction fees and optimal block weight utilization. Users should prioritize using bc1q addresses whenever possible to maximize efficiency and minimize costs.

Another frequent misconception is that SegWit, and by extension native SegWit outputs, are solely about reducing transaction fees. While fee reduction is a significant and tangible benefit for users, the underlying motivation for SegWit was also to fix transaction malleability. This technical fix was crucial for enabling advanced layer-2 protocols like the Lightning Network, which relies on the immutability of transaction IDs. Without SegWit, the development and widespread adoption of such scaling solutions would have been significantly hampered. Therefore, viewing native SegWit outputs merely as a cost-saving measure overlooks their fundamental role in enhancing Bitcoin's protocol robustness and enabling future innovation. Understanding this broader context highlights the strategic importance of P2WPKH and P2WSH beyond just economic advantages.

Furthermore, some users mistakenly believe that bc1q addresses are inherently less secure or more experimental than older address types. This is incorrect. Bech32 encoding, used for native SegWit addresses, actually offers improved error detection compared to Base58Check (used for P2PKH and P2SH addresses), making it harder to accidentally send funds to a mistyped address. The security of the underlying cryptographic primitives (public key cryptography, hashing) remains the same. The "witness" data separation does not compromise security; instead, it enhances the protocol's efficiency and resilience. The perception of bc1q as "new" or "different" should not be conflated with a lack of security or stability; they are the most advanced and recommended address types for Bitcoin transactions.

Summary

Native SegWit outputs, specifically P2WPKH (Pay-to-Witness-Public-Key-Hash) and P2WSH (Pay-to-Witness-Script-Hash), represent the pinnacle of efficiency and flexibility in Bitcoin transaction processing. Activated through the SegWit upgrade, these address types, identifiable by their bc1q prefix, fundamentally optimize how transaction data is handled. P2WPKH streamlines standard single-signature payments by segregating witness data, leading to significantly lower transaction fees and improved network throughput. P2WSH extends this efficiency to complex, script-based transactions, enabling advanced functionalities like multi-signature schemes and time locks with similar cost benefits.

The widespread adoption of P2WPKH and P2WSH is crucial for the ongoing scalability and robustness of the Bitcoin network. They not only reduce operational costs for users and traders but also provide the foundational improvements necessary for layer-2 solutions like the Lightning Network. While understanding the nuances between native and wrapped SegWit, and the specific applications of P2WPKH versus P2WSH, is important, their overall impact is overwhelmingly positive, solidifying their role as the preferred and most forward-looking address formats for Bitcoin transactions.

OKX · Official Biturai Partner

OKX

Explore the current OKX offering through the official Biturai partner link. Products and availability may vary by country.

Explore OKX

Partner link · Biturai may receive compensation when it is used · not investment advice

OKX

Disclaimer

This article is for informational purposes only. The content does not constitute financial advice, investment recommendation, or solicitation to buy or sell securities or cryptocurrencies. Biturai assumes no liability for the accuracy, completeness, or timeliness of the information. Investment decisions should always be made based on your own research and considering your personal financial situation.

Transparency

Biturai may use AI-assisted tools to research, structure, or update Wiki articles. Editorially reviewed articles are marked separately; all content remains educational and does not replace your own review.