Bitcoin.com

What Is the Bitcoin Script Language?

Bitcoin Script language controls every BTC transaction. Learn how opcodes, locking scripts, and Taproot work, explained in plain English.

Last Updated
Published
Reading Time3 min read
Written By
Neil Author
Neill Velardo
Crypto content specialist since 2017; reviews iGaming platforms firsthand
Reviewed By
Graham Stone Author Image
Graham Stone
Journalism graduate covering Bitcoin and crypto since 2017
What is the Bitcoin Script Language?

Frequently Asked Questions

What does Bitcoin Script actually do?
Bitcoin Script defines the spending conditions attached to every transaction output on the network. When you receive bitcoin, the transaction includes a locking script specifying what must be provided to spend those funds. When you spend them, your wallet produces an unlocking script satisfying those conditions. Every full node validates this independently.
Why doesn't Bitcoin Script have loops?
Loops were excluded so every script terminates in bounded time. A script that can loop indefinitely is a denial-of-service risk: a single malicious transaction could force every node to do unbounded work. Bitcoin solves this structurally rather than through computation metering. Every script is guaranteed to halt.
What is the difference between ScriptSig and ScriptPubKey?
ScriptPubKey is the locking script attached to a transaction output, defining the conditions for spending. ScriptSig is the unlocking script provided by the spender and must satisfy those conditions. In SegWit and Taproot transactions, unlocking data lives in a separate witness field, but the validation logic is identical.
How did Taproot change Bitcoin Script?
Taproot (November 2021) introduced three upgrades: Schnorr signatures enabling key aggregation and improved privacy; Pay-to-Taproot (P2TR) with MAST so only the spending path actually used is revealed on-chain; and Tapscript as an updated scripting language with cleaner opcode design and OP_SUCCESS opcodes creating a clean path for future soft forks.
Can Bitcoin do smart contracts?
Bitcoin supports conditional spending rules, a limited form of smart contract, but not stateful general-purpose contracts like Ethereum's. Layer-2 protocols such as Lightning, DLCs, and Ark extend what is possible above the base layer. Covenant opcodes like OP_CTV and OP_CAT could expand Script further, but none have activated on mainnet.
What are Bitcoin covenant opcodes?
Covenant opcodes would let a script constrain what the spending transaction must look like, not just who signs it. Use cases include vaults, more efficient Lightning channels, and multi-stage financial instruments. The leading proposals are OP_CTV (BIP-119) and OP_CAT (BIP-347). Neither has activated on Bitcoin mainnet as of September 2026.
What is a UTXO and how does it relate to Bitcoin Script?
A UTXO (Unspent Transaction Output) is a discrete chunk of bitcoin that exists on-chain and has not been spent. Every UTXO carries a locking script defining the conditions for spending it. When you hold bitcoin, you hold UTXOs with locking scripts only you can satisfy. Bitcoin Script defines and enforces those conditions.
What is Miniscript?
Miniscript is a structured way of writing a subset of Bitcoin Script that is automatically analyzable and composable. Where raw Script is difficult to audit, Miniscript policies can be verified for correctness by software and used to generate valid scripts across different wallet implementations. It does not extend what Script can do but makes existing capabilities far more accessible to developers.

Start investing safely with the Bitcoin.com Wallet

Over 85M+ wallets created so far. Everything you need to buy, sell, trade, and invest your Bitcoin and cryptocurrency securely.

A screenshot of the Bitcoin.com Wallet app

Scan to Download the Bitcoin.com Wallet

Scan this QR code with your mobile device, you will be automatically redirected to the correct store page.