Lesson 3.1Bitcoin Expert · 1 of 20
Overall 41 / 60 (68%)
Bitcoin Expert progress5%
Full curriculum68%

3.1 Bitcoin Script: A Tiny Language for Money

What Script can and intentionally cannot do.

Slide 1 of 4

Bitcoin Script: A Tiny Language for Money

Behind every Bitcoin address is a tiny built-in programming language called Script. It defines the rules for how that pile of coins can be spent. Most of the time the rule is simple: 'whoever can produce a signature for this key can spend it.' But Script can also express much richer conditions.

But ScriptBitcoin
1 / 4

Behind every Bitcoin address is a tiny built-in programming language called Script. It defines the rules for how that pile of coins can be spent. Most of the time the rule is simple: 'whoever can produce a signature for this key can spend it.' But Script can also express much richer conditions.

Script is deliberately stripped down. It doesn't have loops or the ability to call itself over and over, so every program is guaranteed to finish quickly. (In computer-science terms, this means Script is intentionally NOT 'Turing-complete' — a fancy way of saying it can't run forever or do unbounded work.) This is a security choice, not a mistake — Bitcoin prizes 'every node can cheaply check every transaction' above being able to run complex apps like Ethereum does.

Common patterns you can build with Script: a regular single-signature address, a multi-signature address ('2 of these 3 keys'), a timelock ('these coins are frozen until block X'), or a hash puzzle ('whoever reveals the secret behind this fingerprint can claim'), and combinations of all of these.

Most users never write Script directly. Wallets compose it under the hood when you choose an address type or set up something fancy like a multisig vault.