Bitcoin Script
The stack-based language that locks outputs and defines what a spender must provide to unlock them.
Basically
Bitcoin Script is a small rule language that says who may spend a coin and under what conditions. It is limited on purpose, so the rules stay safe and cheap to check.
Key Takeaways
- Bitcoin Script is a stack-based language that locks outputs and sets the conditions for spending them.
- It has no loops or randomness and uses bounded computation by design.
- It allows complex conditions, but not arbitrary programs.
What a script does
Every output carries a locking script that describes what you must provide to spend it, and every input carries the unlocking data. A node runs both on a stack and accepts the spend only if the program finishes with true. Bitcoin smart contracts rely entirely on this deliberately simple mechanism.
Bitcoin Script has no loops, a small instruction set and hard limits on sizes and counts. Every script therefore has bounded, predictable costs, so each node can validate a block without runaway computation.
What people build with it
People use Bitcoin Script for multisig, time-locked recovery paths, hash-locked swaps, vault-like constructions and the channels Lightning uses. Miniscript and descriptors are description layers on top, providing analysable composition and precise wallet restoration because raw script is hard to write and audit.
Expansion debates
Proposed opcodes like OP_CAT or OP_CTV would widen what scripts can express. They reopen the long-running argument over whether a deliberately restricted language is Bitcoin's strength or its ceiling.