-
Bitcoin
$106,754.6083
1.33% -
Ethereum
$2,625.8249
3.80% -
Tether USDt
$1.0001
-0.03% -
XRP
$2.1891
1.67% -
BNB
$654.5220
0.66% -
Solana
$156.9428
7.28% -
USDC
$0.9998
0.00% -
Dogecoin
$0.1780
1.14% -
TRON
$0.2706
-0.16% -
Cardano
$0.6470
2.77% -
Hyperliquid
$44.6467
10.24% -
Sui
$3.1128
3.86% -
Bitcoin Cash
$455.7646
3.00% -
Chainlink
$13.6858
4.08% -
UNUS SED LEO
$9.2682
0.21% -
Avalanche
$19.7433
3.79% -
Stellar
$0.2616
1.64% -
Toncoin
$3.0222
2.19% -
Shiba Inu
$0.0...01220
1.49% -
Hedera
$0.1580
2.75% -
Litecoin
$87.4964
2.29% -
Polkadot
$3.8958
3.05% -
Ethena USDe
$1.0000
-0.04% -
Monero
$317.2263
0.26% -
Bitget Token
$4.5985
1.68% -
Dai
$0.9999
0.00% -
Pepe
$0.0...01140
2.44% -
Uniswap
$7.6065
5.29% -
Pi
$0.6042
-2.00% -
Aave
$289.6343
6.02%
What is Bitcoin P2SH address? Difference between P2SH and P2PKH
P2SH addresses enable complex Bitcoin transactions like multi-signature wallets and smart contracts by allowing funds to be sent to a script hash instead of a public key hash.
Jun 16, 2025 at 09:49 pm

Understanding Bitcoin P2SH Addresses
A Pay-to-Script-Hash (P2SH) address in the Bitcoin network is a type of address that allows users to send funds to a script hash rather than directly to a public key hash, as seen in earlier address formats. This innovation was introduced through BIP 16, enhancing flexibility and enabling more complex transaction types without burdening the sender with the details of the redemption script.
When using a P2SH address, the recipient provides a script hash instead of a public key hash. The sender only needs to know this hash to create a valid transaction. The actual redeem script, which defines the conditions under which the funds can be spent, is revealed only when the recipient spends the coins.
One major benefit of P2SH addresses is their ability to support multi-signature wallets, time-locked contracts, and other advanced smart contract functionalities on Bitcoin's blockchain. These features allow for more secure and sophisticated use cases compared to traditional single-key transactions.
Structure of a P2SH Address
The structure of a P2SH address differs from standard P2PKH (Pay-to-Public-Key-Hash) addresses. A P2SH address starts with the number "3" or "bc1..." in some SegWit implementations, while P2PKH addresses typically begin with a "1" or "bc1..." for native SegWit versions.
To generate a P2SH address, the process involves:
- Creating a custom redeem script that defines spending conditions.
- Hashing the redeem script using RIPEMD-160 after SHA-256.
- Prepending a version byte (usually 0x05 for mainnet).
- Applying Base58Check encoding to produce the final address.
This structure ensures backward compatibility and enables the Bitcoin network to validate transactions without knowing the full script until it’s spent.
What is a P2PKH Address?
A Pay-to-Public-Key-Hash (P2PKH) address is one of the earliest and most basic forms of Bitcoin addresses. It represents a hashed version of a user’s public key and is used for simple, single-signature transactions.
In a P2PKH transaction, the sender creates an output locked to a public key hash. When the recipient wants to spend these funds, they must provide both the corresponding public key and a valid digital signature proving ownership.
P2PKH addresses are widely supported across wallets and exchanges due to their simplicity and long-standing presence in the ecosystem. However, they lack the flexibility offered by newer address types like P2SH and SegWit-based formats.
The steps to generate a P2PKH address include:
- Generating a private key.
- Deriving the public key from the private key.
- Hashing the public key using SHA-256 followed by RIPEMD-160.
- Adding a version byte (0x00 for mainnet).
- Performing Base58Check encoding to get the final address.
Key Differences Between P2SH and P2PKH
While both P2SH and P2PKH are valid Bitcoin address types, several differences set them apart:
- Transaction Flexibility: P2SH supports complex scripts, including multi-signature transactions, whereas P2PKH only allows for single-signature spending.
- Cost Efficiency: In many cases, P2SH transactions may incur higher fees because the redemption script data is stored on-chain when the funds are spent. P2PKH transactions have simpler structures and often lower on-chain data requirements.
- Address Format: P2SH addresses usually start with "3", while P2PKH addresses typically start with "1".
- Responsibility of Script Data: With P2SH, the complexity of the script is moved to the receiver, reducing the sender’s burden. In contrast, P2PKH requires no additional script logic beyond public key verification.
These distinctions make P2SH a preferred choice for advanced users and institutions requiring enhanced security and control over funds.
Use Cases for P2SH Addresses
P2SH addresses enable various advanced use cases that go beyond simple peer-to-peer transactions:
- Multi-Signature Wallets: Require multiple parties to sign off before funds can be moved, enhancing security for organizations and shared accounts.
- Escrow Services: Allow third-party arbitration in transactions by embedding escrow logic into the script.
- Time-Locked Contracts: Enable conditional spending based on block height or timestamp, useful for delayed releases of funds.
- Smart Contracts: Although limited compared to Ethereum, Bitcoin can still implement basic smart contracts via P2SH scripts.
Each of these scenarios benefits from the flexible scripting system enabled by P2SH, allowing users to define custom rules for fund access without altering the base protocol.
How to Identify P2SH and P2PKH Addresses
Identifying whether an address is P2SH or P2PKH can be done by examining its format and decoding its components:
- Check the prefix:
- P2SH: Starts with "3" or sometimes "bc1..." depending on SegWit implementation.
- P2PKH: Begins with "1" or "bc1..." in native SegWit form.
- Use a block explorer to look up the address and see if it's associated with multi-signature or script-based transactions.
- Decode the Base58Check or Bech32 encoded string to view the embedded hash and determine the address type.
Tools such as Bitcoin explorers and address validation APIs can automate this process and provide detailed insights into the nature of the address and its underlying script structure.
Frequently Asked Questions
Q: Can I convert a P2PKH address to a P2SH address?
No, you cannot directly convert an address type. You need to generate a new wallet or script that produces a P2SH address and then transfer your funds to that new address.
Q: Are P2SH addresses compatible with all wallets?
Most modern wallets support P2SH addresses, especially those that handle multi-signature transactions. However, older or minimalist wallets might not fully support them.
Q: Why do P2SH transactions sometimes cost more in fees?
Because P2SH transactions often carry larger script data when being spent, they occupy more space on the blockchain, leading to higher fees based on data size.
Q: Is P2SH still relevant with the advent of SegWit?
Yes, P2SH remains relevant, especially for wrapped SegWit addresses that maintain backward compatibility. While native SegWit (Bech32) offers efficiency improvements, P2SH compatibility ensures broader adoption during the transition phase.
Disclaimer:info@kdj.com
The information provided is not trading advice. kdj.com does not assume any responsibility for any investments made based on the information provided in this article. Cryptocurrencies are highly volatile and it is highly recommended that you invest with caution after thorough research!
If you believe that the content used on this website infringes your copyright, please contact us immediately (info@kdj.com) and we will delete it promptly.
- 2025-W Uncirculated American Gold Eagle and Dr. Vera Rubin Quarter Mark New Products
- 2025-06-13 06:25:13
- Ruvi AI (RVU) Leverages Blockchain and Artificial Intelligence to Disrupt Marketing, Entertainment, and Finance
- 2025-06-13 07:05:12
- H100 Group AB Raises 101 Million SEK (Approximately $10.6 Million) to Bolster Bitcoin Reserves
- 2025-06-13 06:25:13
- Galaxy Digital CEO Mike Novogratz Says Bitcoin Will Replace Gold and Go to $1,000,000
- 2025-06-13 06:45:13
- Trust Wallet Token (TWT) Price Drops 5.7% as RWA Integration Plans Ignite Excitement
- 2025-06-13 06:45:13
- Ethereum (ETH) Is in the Second Phase of a Three-Stage Market Cycle
- 2025-06-13 07:25:13
Related knowledge

Which Bitcoin hardware wallet is better? Comparison of mainstream hardware devices
Jun 16,2025 at 02:08am
What Is a Bitcoin Hardware Wallet?A Bitcoin hardware wallet is a physical device designed to securely store the private keys associated with your cryptocurrency holdings. Unlike software wallets, which are more vulnerable to online threats, hardware wallets keep private keys offline, significantly reducing the risk of unauthorized access. These devices ...

What are Bitcoin non-custodial wallets? Self-controlled private key recommendation
Jun 16,2025 at 11:29pm
Understanding Bitcoin Non-Custodial WalletsA Bitcoin non-custodial wallet is a type of digital wallet where users retain full control over their private keys. Unlike custodial wallets, which are managed by third-party services such as exchanges, non-custodial wallets ensure that only the user can access and manage their funds. This means no intermediary...

What is Bitcoin BIP44 standard? Multi-currency wallet path specification
Jun 15,2025 at 04:08pm
Understanding the BIP44 Standard in Bitcoin and CryptocurrencyThe BIP44 standard, which stands for Bitcoin Improvement Proposal 44, is a widely adopted hierarchical deterministic wallet structure used across various cryptocurrencies. It defines a structured path format that enables wallets to support multiple currencies while maintaining consistency and...

What is Bitcoin HD wallet? Advantages of layered deterministic wallets
Jun 16,2025 at 03:56pm
Understanding Bitcoin HD WalletsA Bitcoin HD wallet, or Hierarchical Deterministic wallet, is a type of cryptocurrency wallet that generates multiple keys and addresses from a single seed phrase. Unlike traditional wallets that create random private keys for each transaction, an HD wallet follows a structured hierarchy to derive keys in a deterministic ...

Is Bitcoin zero-confirmation transaction risky? Zero-confirmation usage scenarios
Jun 15,2025 at 03:57am
Understanding Zero-Confirmation Transactions in BitcoinBitcoin zero-confirmation transactions, often referred to as 'unconfirmed transactions,' are those that have been broadcast to the network but have not yet been included in a block. This means they have not received any confirmations from miners. While these transactions can be useful in certain con...

What is Bitcoin P2SH address? Difference between P2SH and P2PKH
Jun 16,2025 at 09:49pm
Understanding Bitcoin P2SH AddressesA Pay-to-Script-Hash (P2SH) address in the Bitcoin network is a type of address that allows users to send funds to a script hash rather than directly to a public key hash, as seen in earlier address formats. This innovation was introduced through BIP 16, enhancing flexibility and enabling more complex transaction type...

Which Bitcoin hardware wallet is better? Comparison of mainstream hardware devices
Jun 16,2025 at 02:08am
What Is a Bitcoin Hardware Wallet?A Bitcoin hardware wallet is a physical device designed to securely store the private keys associated with your cryptocurrency holdings. Unlike software wallets, which are more vulnerable to online threats, hardware wallets keep private keys offline, significantly reducing the risk of unauthorized access. These devices ...

What are Bitcoin non-custodial wallets? Self-controlled private key recommendation
Jun 16,2025 at 11:29pm
Understanding Bitcoin Non-Custodial WalletsA Bitcoin non-custodial wallet is a type of digital wallet where users retain full control over their private keys. Unlike custodial wallets, which are managed by third-party services such as exchanges, non-custodial wallets ensure that only the user can access and manage their funds. This means no intermediary...

What is Bitcoin BIP44 standard? Multi-currency wallet path specification
Jun 15,2025 at 04:08pm
Understanding the BIP44 Standard in Bitcoin and CryptocurrencyThe BIP44 standard, which stands for Bitcoin Improvement Proposal 44, is a widely adopted hierarchical deterministic wallet structure used across various cryptocurrencies. It defines a structured path format that enables wallets to support multiple currencies while maintaining consistency and...

What is Bitcoin HD wallet? Advantages of layered deterministic wallets
Jun 16,2025 at 03:56pm
Understanding Bitcoin HD WalletsA Bitcoin HD wallet, or Hierarchical Deterministic wallet, is a type of cryptocurrency wallet that generates multiple keys and addresses from a single seed phrase. Unlike traditional wallets that create random private keys for each transaction, an HD wallet follows a structured hierarchy to derive keys in a deterministic ...

Is Bitcoin zero-confirmation transaction risky? Zero-confirmation usage scenarios
Jun 15,2025 at 03:57am
Understanding Zero-Confirmation Transactions in BitcoinBitcoin zero-confirmation transactions, often referred to as 'unconfirmed transactions,' are those that have been broadcast to the network but have not yet been included in a block. This means they have not received any confirmations from miners. While these transactions can be useful in certain con...

What is Bitcoin P2SH address? Difference between P2SH and P2PKH
Jun 16,2025 at 09:49pm
Understanding Bitcoin P2SH AddressesA Pay-to-Script-Hash (P2SH) address in the Bitcoin network is a type of address that allows users to send funds to a script hash rather than directly to a public key hash, as seen in earlier address formats. This innovation was introduced through BIP 16, enhancing flexibility and enabling more complex transaction type...
See all articles
