Decoding #1: Standard VS non-Standard Scripts
- We're starting a series of posts to teach you about Bitcoin development. We'll be sharing them here. Tell us how we can make it better!
- If you prefer reading on the website, check 👉 https://bitcoindevs.xyz/decoding/standard-nonstandard
1- Standard Script
Standard scripts are predefined and widely accepted transaction scripts in Bitcoin.
- Key Features:
- Predefined templates (e.g., P2PKH, P2SH).
- Well-tested and quickly verified by nodes.
- Widely relayed and accepted on the network.
Below is a timeline of different output script types before and after SegWit.
NOTE: Relay Policy
Bitcoin Core will only relay transactions by default that pass the
IsStandardTx()
check. However, miners are still free to include (valid!) non-standard transactions in their blocks.2- Non-Standard Scripts
-
Non-standard scripts deviate from commonly used templates for transaction.
-
Standard scripts, such as P2PKH and P2SH, are widely recognized and accepted by nodes. Any script that deviates from these templates is considered non-standard and will not be relayed by the network.
-
They are valid but are not relayed by most nodes for safety reasons.
Remember this pls => Non-standard scripts are still VALID
Question: What if I want my Non-Standard Transaction Relayed and Mined?
find the answer here 👉 https://bitcoindevs.xyz/decoding/standard-nonstandard