Pay-to-Script-Hash (P2SH)
Pay-to-Script-Hash (P2SH) is a type of ScriptPubKey which allows for the spending of bitcoin based on the satisfaction of the script whose hash is specified within the transaction.
Pay-to-Script-Hash (P2SH) is a type of ScriptPubKey which allows for the spending of bitcoin based on the satisfaction of the script whose hash is specified within the transaction. A P2SH transaction is a transaction whose inputs were locked using a P2SH ScriptPubKey. For example, if Alice sends Bob 1 BTC in a P2SH transaction, she includes the hash of the script required to spend the bitcoin in the transaction.
This script can require signatures by Bob’s private keys and/or many other qualifications. When Bob wants to spend the bitcoin he has received from Alice, he reconstructs the script whose hash Alice used to send the bitcoin, and signs the transaction with any private keys required by the script. P2SH is extremely flexible because it allows users to construct arbitrary scripts.
P2SH is used to enable backwards compatibility with new transaction types, including SegWit. Additionally, the sender of the transaction does not need to known what script type they are sending to. In the example above, Bob can privately construct his desired script and only send Alice the hash of that script, preserving more privacy for Bob.
Pay-to-Script-Hash (P2SH) is a Bitcoin protocol specification that defines technical standards for how Bitcoin software operates. Onramp's Bitcoin glossary provides detailed educational resources on Pay-to-Script-Hash (P2SH) and other protocol-level concepts to help investors understand the technology underpinning their Bitcoin holdings.
Frequently Asked Questions
What is Pay-to-Script-Hash (P2SH)?
Pay-to-Script-Hash (P2SH) is a technical standard in the Bitcoin protocol that specifies how certain operations or data structures should be implemented. It helps ensure interoperability between different Bitcoin software implementations.
Why is Pay-to-Script-Hash (P2SH) important for Bitcoin?
Pay-to-Script-Hash (P2SH) improves Bitcoin's functionality, security, or efficiency. Technical standards like this ensure that all participants in the Bitcoin network follow consistent rules, maintaining network consensus.
How does Pay-to-Script-Hash (P2SH) affect Bitcoin investors?
While Pay-to-Script-Hash (P2SH) operates at the protocol level, Onramp ensures that clients benefit from these technical improvements through secure, up-to-date infrastructure for Bitcoin custody and transactions.
