Witness Script
The Witness Script is the script which outlines the requirements to spend a Pay-to-Witness-Script-Hash (P2WSH) output.
The Witness Script is the script which outlines the requirements to spend a Pay-to-Witness-Script-Hash (P2WSH) output. Most commonly, Witness Scripts define the setup of a SegWit multisig wallet.
A P2WSH output is a SegWit scriptPubKey which contains the hash of the Witness Script. In order to spend a P2WSH output, the owner must produce the Witness Script whose hash matches the hash provided in the scriptPubKey as well as the signatures and public keys required by the Witness Script. The Witness Script is the SegWit equivalent of the redeemScript in a P2SH transaction.
However, while the redeemScript of a P2SH transaction is included in the ScriptSig, the Witness Script is included in the Witness field, making P2WSH inputs cheaper to spend than P2SH inputs. The Witness Script should not be confused with the Script Witness. The Script Witness contains the Witness data of any SegWit input.
In fact, the Script Witness is not a form of Script; it is simply data used by the script. On the other hand, the Witness Script is the script which defines the spending conditions of a P2WSH input, and the Witness Script is a form of Script.
Witness Script is a Bitcoin protocol specification that defines technical standards for how Bitcoin software operates. Onramp's Bitcoin glossary provides detailed educational resources on Witness Script and other protocol-level concepts to help investors understand the technology underpinning their Bitcoin holdings.
Frequently Asked Questions
What is Witness Script?
Witness Script 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 Witness Script important for Bitcoin?
Witness Script 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 Witness Script affect Bitcoin investors?
While Witness Script 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.
