Independent discussion of crypto, wallets, cards and markets
Forum Home > Crypto Trading & Markets > Bitcoin > Bitcoin Script: what the network can compute and what it cannot
Bitcoin Script: what the network can compute and what it cannot134 replies · 4,902 views
Thread ToolsShow Printable Version · Subscribe to this Thread · Search Thread
Where to open an account: Open a Trustee account.

Bitcoin Script: what the network can compute and what it cannot

What script is

  • A stack-based language: script pushes and pops values on a stack, and each transaction output carries a script that defines who can spend it and under what conditions
  • It runs per output: every spend re-runs the relevant script from scratch, with no memory between transactions, which keeps execution stateless
  • It is deterministic by requirement: every full node must reach the same verdict on every script, so ambiguity is a bug, not a feature
  • It is old and frozen: the scripting language has changed rarely and conservatively, and most new features arrive through soft forks that extend rather than rewrite it

What script can compute

  • Conditional spending: script expresses rules like "spendable with this key" or "spendable with two of three keys", which covers multisig and basic custody
  • Time conditions: CLTV and CSV encode delays into outputs, which is how scheduled spends and channel closures work
  • Hash and signature checks: hash locks and signature verification let script enforce proof-of-payment and proof-of-authority conditions
  • Simple combinations: conditions compose with AND and OR logic through careful script construction, which is enough for practical custody and payment patterns

What script cannot compute

  • No loops: script has no iteration, so it cannot run unbounded computation, which is the main difference from general-purpose languages
  • No Turing completeness: Bitcoin script is deliberately not Turing-complete, so halting is guaranteed and every node finishes verification
  • No state between transactions: script cannot remember previous runs, so complex application state must live outside the chain
  • No dynamic dispatch: script cannot call arbitrary external logic, which keeps execution predictable and auditable

Why the limits are the feature

  • Determinism protects consensus: if scripts could loop or diverge, nodes could disagree about validity, and disagreement is how chains split
  • Security follows simplicity: a small, auditable language has a small attack surface, and every added capability widens it
  • Verification stays cheap: bounded script means every node can check every transaction, which is what keeps the network decentralized
  • Upgrades stay conservative: the cost of changing script is high, which is why changes arrive slowly and with broad consensus

What this enables in practice

  • Auditable contracts: because script is simple, anyone can read a spending condition and verify it, which is rare in finance
  • Trust-minimized custody: multisig and time locks work without trusted intermediaries because the rules are enforced by every node
  • Layered complexity: applications that need more than script can do build it in layers - channels, second layers, and sidechains - while Bitcoin enforces the base rules
  • The pattern to remember: Bitcoin script does little perfectly, and the ecosystem builds the rest around that solid, boring core

The takeaway

Bitcoin script is a deliberately limited, stack-based language that decides who can spend each output, and its limits - no loops, no state, no Turing completeness - are what keep verification deterministic and cheap enough for every node to run. Within those limits, script covers conditional spending, time locks, hash and signature checks, and composable custody rules, which is enough for trust-minimized money. Complexity that script cannot express lives in layers above it. The honest summary is that Bitcoin's scripting weakness is its strength: a small language that everyone can audit is worth more than a powerful one that only a few can.

Thread Statistics134 replies · 4,902 views