₿₿₿Bitcoin Horizon
Dashboard
Skip to content
  1. Home
  2. ›
  3. Glossary

Script (Bitcoin Script)

Bitcoin's simple, stack-based programming language used to define the conditions under which Bitcoin can be spent. Every Bitcoin transaction contains a script that specifies who can claim the funds and under what circumstances.

Definition

Bitcoin's simple, stack-based programming language used to define the conditions under which Bitcoin can be spent. Every Bitcoin transaction contains a script that specifies who can claim the funds and under what circumstances.

Explanation

Bitcoin Script is a purposefully limited programming language that powers every Bitcoin transaction. When you send Bitcoin, you're not just transferring a balance — you're creating a locking script (scriptPubKey) that defines the conditions required to spend those coins. The recipient must provide an unlocking script (scriptSig) that satisfies those conditions to claim the funds.

Script is intentionally not Turing-complete — it cannot loop, which means scripts always terminate and their execution cost is bounded. This is a deliberate security design choice by Satoshi Nakamoto. While it limits Bitcoin's programmability compared to platforms like Ethereum, it eliminates entire categories of bugs and attacks. The most common script type simply requires a valid digital signature from a specific public key, but more complex scripts enable multisignature wallets, time-locked transactions, and hash-locked contracts.

Despite its simplicity, Script has proven remarkably versatile. Hash Time-Locked Contracts (HTLCs), which power the Lightning Network, are built entirely with Script. Multisig arrangements for corporate treasuries, escrow services, and inheritance planning all use Script's native capabilities. Taproot's MAST extension further expanded what's practical by allowing complex scripts to be compressed and revealed only when needed, keeping the common spending paths cheap and private.

Key Takeaways

  • •Stack-based language that defines spending conditions for every Bitcoin transaction
  • •Intentionally not Turing-complete to prevent infinite loops and bound execution costs
  • •Enables multisig, time-locks, hash-locks, and other programmable spending conditions
  • •Taproot extended Script capabilities with Merklized Abstract Syntax Trees

Frequently Asked Questions

By design. A Turing-complete language can enter infinite loops, making execution costs unpredictable and creating attack surfaces. Bitcoin Script's limitations ensure every script terminates deterministically and has bounded resource usage. This trade-off prioritizes security and predictability over programmability.

Script supports signature verification, time-locks (spending only after a certain block height or time), hash-locks (spending only with a secret preimage), multisig (requiring M-of-N signatures), and combinations thereof. These primitives enable Lightning channels, atomic swaps, escrow arrangements, and inheritance schemes.

No. Wallets abstract away the Script layer entirely. When you send Bitcoin, your wallet automatically constructs the appropriate scripts. Script knowledge is mainly relevant for developers building Bitcoin applications, designing custody solutions, or working on protocol-level improvements.

Related Terms

Block Reward
The amount of new Bitcoin awarded to miners for successfully adding a block to the blockchain. The reward started at 50 BTC per block and is cut in half approximately every four years through the halving process.
Cold Storage
A method of storing Bitcoin offline, disconnected from the internet, to protect against hacking and theft. Hardware wallets and paper wallets are common forms of cold storage.
Halving
An event that occurs approximately every four years (every 210,000 blocks) where the Bitcoin block reward is cut in half. Halvings reduce the rate of new supply entering the market and have historically preceded major bull runs.
Mining
The process of using computational power to validate transactions and add new blocks to the Bitcoin blockchain. Miners are rewarded with newly minted Bitcoin (the block reward) plus transaction fees.
Node
A computer running Bitcoin software that validates transactions and blocks, enforces consensus rules, and relays data across the network. Running a full node is the most sovereign way to interact with Bitcoin.
Private Key
A secret cryptographic key that proves ownership of Bitcoin and authorizes transactions. Losing your private key means losing access to your Bitcoin permanently. It should never be shared with anyone.
← Back to Glossary