Bitcoin Script Explained
A plain-language introduction to the simple scripting language behind Bitcoin transactions.
Jump to section
What to remember
- Bitcoin Script defines the spending conditions for every Bitcoin transaction.
- It's deliberately not Turing-complete, unlike Ethereum's smart contract language.
- Common script types include P2PKH, P2SH, and the newer Taproot-enabled P2TR.
- Limited expressiveness is a deliberate security and predictability trade-off.
What Bitcoin Script is
Bitcoin Script is the deliberately simple, limited scripting language used to define the conditions under which a Bitcoin transaction output can be spent. Every Bitcoin transaction is, underneath, a small script that must evaluate successfully for funds to move.
Why it's deliberately limited
Unlike Ethereum's Turing-complete smart contract language, Bitcoin Script is intentionally not Turing-complete — it lacks loops, for example — a deliberate design choice prioritizing predictability and security over general-purpose programmability.
Common script types
- Pay-to-Public-Key-Hash (P2PKH): the classic single-signature spending condition.
- Pay-to-Script-Hash (P2SH): allows more complex conditions, such as multisig, to be represented by a simpler hash.
- Pay-to-Taproot (P2TR): a newer format enabled by the Taproot upgrade, improving efficiency and privacy for complex conditions.
Simplicity is a deliberate security trade-off
Bitcoin Script's limited expressiveness reduces the surface area for the kind of complex smart contract bugs that have affected more expressive platforms — a direct trade-off of flexibility for predictability.
What to remember
- Bitcoin Script defines the spending conditions for every Bitcoin transaction.
- It's deliberately not Turing-complete, unlike Ethereum's smart contract language.
- Common script types include P2PKH, P2SH, and the newer Taproot-enabled P2TR.
- Limited expressiveness is a deliberate security and predictability trade-off.