💡 The Plain-English Definition
Bitcoin Script is a simple programming language that sets the conditions under which bitcoin can be spent, and opcodes are the individual commands in that language. Together they let Bitcoin enforce complex spending rules — multiple required signatures, time delays, secret-based locks — without needing a general-purpose computer to run arbitrary programs.
🤔 But Why Though?
Every Bitcoin transaction output — each chunk of bitcoin a transaction creates — is locked by a script, a set of conditions that must be met to spend it. The simplest script says, in effect, “whoever can produce a valid signature for this public key can spend these funds.” More complex scripts add conditions: “two of these three keys must sign,” or “this can’t be spent until block 900,000,” or “the spender must know the secret that produces this hash.”
Bitcoin Script is a stack-based language, meaning its instructions work on a stack — a list where items are added to and removed from the top. Each opcode is a single instruction: OP_ADD adds two numbers, OP_CHECKSIG verifies a signature, OP_IF handles an if/then choice.
The most consequential design decision is what Script deliberately can’t do. It has no loops and very little memory. It isn’t Turing-complete — that’s the property of a language that can compute anything computable, including running forever in an infinite loop. Satoshi chose this on purpose. A Turing-complete scripting language would let arbitrary programs run on every node, which would open the door to denial-of-service attacks — flooding the network with scripts that are hugely expensive to run — and would make it impossible to guarantee a script ever finishes. By keeping Script to simple programs that always finish, Bitcoin makes validating any transaction fast and predictable.
This is why Bitcoin can’t run Ethereum-style smart contracts directly: the language simply doesn’t allow that much complexity. What it does allow is multisig (several required signatures), timelocks (funds locked until a certain block or time), and hash locks (spending requires knowing a specific secret) — plus the combinations of these that power the Lightning Network’s HTLCs, the Hash Time-Locked Contracts that let Lightning payments route without trusting the middlemen.
🌍 The Real-World Analogy
Bitcoin Script is like a vending machine’s logic — a limited, predictable set of rules that always finish. Insert coin, press button, receive item. The machine can’t run a video game or browse the internet; it does exactly what it was designed to do, predictably, every time. A Turing-complete language is more like an open-ended computer that can run anything — powerful, but impossible to guarantee it’ll finish or won’t be exploited. Bitcoin chose the vending machine on purpose.
⚡ So What?
Understanding Bitcoin Script explains why Bitcoin can do less than “smart contract” platforms — and why Bitcoiners treat that limit as a feature, not a flaw. Its predictability, how easy it is to audit, and its resistance to exploits all come from staying simple. The Lightning Network builds enormous functionality out of just timelocks and hash locks, which shows how much can be built on a few simple, safe building blocks.
