Web3 Learning

What Is a P2SH Address?

By Safeheron Team

A P2SH (Pay-to-Script-Hash) address is a Bitcoin address starting with 3 that locks funds not to a single public key but to the hash of a script. To spend from it, the spender must reveal that script and meet the conditions it sets, such as signatures from any two of three keys. P2SH was activated in 2012 and is mainly used for multisig wallets and wrapped SegWit.

What Problem Does P2SH Solve?

Multisig was possible before P2SH, but the payer had to write the full multisig script, including every public key, into the transaction output. This meant the payer paid extra fees for the recipient’s complex script, and there was no short address the recipient could hand out.

P2SH compresses the script into a 20-byte hash inside the address. The payer simply sends funds as they would to any ordinary address, and the cost and complexity of the script shift to the recipient at spending time.

How Is a P2SH Address Spent?

The script that gets hashed is called the redeem script. To spend, the transaction must provide both the redeem script and the data that satisfies it, such as enough signatures. Nodes first check that the hash of the redeem script matches the address, then run the script to verify the signatures.

So before the first spend, outsiders see only a hash and cannot tell whether it is multisig or some other script; after it is spent, the full script is public on-chain. Looking at the redeem script in a transaction an address has spent from is one way to check whether a wallet is multisig.

What Is P2SH Used For?

The main use is multisig, such as 2-of-3 or 3-of-5 enterprise wallets and custody setups. The second is wrapped SegWit: when SegWit first launched, many wallets and exchanges did not yet recognize bc1 addresses. Placing a SegWit script inside P2SH let users receive funds at a 3-prefixed address that older systems understood, while still getting part of the fee discount.

Today, new multisig setups more often use native SegWit P2WSH addresses. These lengthen the script hash from 20 bytes to 32 bytes, improving collision resistance in multi-party settings, and also have lower fees.

What Should Businesses Watch for When Using P2SH Multisig?

The most commonly overlooked risk is backup. Spending funds at a P2SH address requires the complete redeem script, meaning all the public keys, their order and the threshold. If each party backs up only its own private key but the other signers’ public keys or the wallet configuration are lost, the funds cannot be spent even with enough signatures.

In addition, the number and structure of multisig signers are fixed in the script, so changing a signer requires generating a new address and migrating the funds. This is a key difference between multisig and an MPC wallet.

Conclusion

P2SH compresses complex spending conditions into an ordinary address starting with 3, which helped multisig and SegWit gain wide adoption. Businesses that use it should back up the redeem script carefully and be aware that changing signers means migrating to a new address. Safeheron’s MPC Wallet-as-a-Service provides businesses with MPC key management and a policy engine.

Want to adjust approvers and thresholds without migrating addresses?

Contact Safeheron’s Sales Team to Book a 1:1 Demo

Share

Looking for a secure way to manage digital assets?

Talk to our experts and find the right solution for your business.

Request a Demo