💡 The Plain-English Definition
Bitcoin Script is a simple programming language that defines the conditions under which Bitcoin can be spent. Opcodes are the commands in that language. Together they make it possible for Bitcoin to enforce complex spending rules — multisig, timelocks, hash locks — without requiring a general-purpose computer to run arbitrary programs.
🤔 But Why Though?
Every Bitcoin transaction output is locked by a script — a set of conditions that must be satisfied to spend those funds. The simplest script says “the person who can produce a valid signature for this public key can spend these funds.” More complex scripts add additional conditions: “two of these three keys must sign,” or “this can only be spent after block 900,000,” or “the spender must know the preimage of this hash.”
Bitcoin Script is a stack-based language — instructions operate on a stack (a list where items are added and removed from the top). An opcode is a single instruction: OP_ADD adds two numbers, OP_CHECKSIG verifies a signature, OP_IF enables conditional logic. The most consequential design decision is what Bitcoin Script deliberately cannot do: it has no loops and limited state. It’s not Turing-complete (a property of programming languages that can compute anything computable, including infinite loops). Satoshi made this choice deliberately — a Turing-complete scripting language would allow arbitrary programs to run on every node, enabling denial-of-service attacks (where someone floods the network with computationally expensive scripts) and making it impossible to guarantee that scripts terminate. By limiting Script to simple, terminating programs, Bitcoin ensures that validating any transaction is fast and predictable. This is why Bitcoin cannot run Ethereum-style smart contracts natively — the scripting language doesn’t permit that complexity. What it does permit: multisig (multiple required signatures), timelocks (spending locked until a specific block height or time), hash locks (spending requires knowing a specific secret), and the combinations of these that power the Lightning Network’s HTLC (Hash Time-Locked Contract — the conditional payment mechanism that enables trustless Lightning routing) mechanism.
🌍 The Real-World Analogy
Bitcoin Script is like a vending machine’s logic — a limited, predictable set of rules that always terminate. 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 an open-ended computer that can run anything — powerful, but impossible to guarantee will finish or won’t be exploited. Bitcoin chose the vending machine deliberately.
⚡ So What?
Understanding Bitcoin Script explains why Bitcoin’s capabilities are limited compared to “smart contract” platforms — and why Bitcoiners consider that limitation a feature rather than a bug. Predictability, auditability, and resistance to exploitation come from simplicity. The Lightning Network achieves enormous functionality using just timelocks and hash locks — demonstrating that significant complexity can be built on simple, safe primitives.
