When most people think of smart contracts, they think of Ethereum. But Bitcoin has had smart contract capabilities since its inception. Bitcoin’s scripting language, while deliberately limited compared to Ethereum’s Turing-complete language, is powerful enough to enable a wide range of financial applications – from multi-signature wallets to time-locked transactions to complex escrow arrangements.
What Is Bitcoin Script?
Bitcoin Script is a simple, stack-based programming language that is used to define the conditions under which Bitcoin can be spent. Every Bitcoin transaction includes a script that specifies what is required to spend the output – typically a digital signature from the owner’s private key.
Bitcoin Script is intentionally not Turing-complete (it does not support loops). This is a deliberate design choice: by limiting the complexity of the scripting language, Satoshi reduced the attack surface and made it easier to verify that scripts will terminate. This makes Bitcoin more secure and predictable, even if it is less flexible than Ethereum.
Types of Bitcoin Smart Contracts
Pay-to-Public-Key-Hash (P2PKH)
The most common type of Bitcoin transaction. The spender must provide a public key that matches the hash in the script, plus a valid digital signature. This is the standard “send Bitcoin to an address” transaction.
Pay-to-Script-Hash (P2SH)
Allows more complex spending conditions. The script hash is provided, and the spender must provide a script that matches the hash. This enables multi-signature wallets, time-locked transactions, and other advanced features.
Multi-Signature (Multisig)
Requires multiple private keys to authorize a transaction. A 2-of-3 multisig, for example, requires any 2 out of 3 designated keys to sign. This is used for enhanced security, corporate treasury management, and escrow services.
Time-Locked Transactions
Bitcoin transactions can be locked until a specific time or block height. This enables features like:
- Vaults that require a waiting period before funds can be moved (protecting against theft)
- Inheritance plans that release funds after a certain date
- Payment channels (the foundation of the Lightning Network)
Hash Time-Locked Contracts (HTLCs)
The foundation of the Lightning Network. HTLCs require the recipient to provide a cryptographic preimage (a secret) within a certain time period, or the funds return to the sender. This enables trustless, atomic swaps across different blockchains.
Taproot: Bitcoin’s Smart Contract Upgrade
The Taproot upgrade, activated in November 2021, was Bitcoin’s most significant upgrade in years. It introduced several improvements:
- Schnorr signatures: More efficient and private than the previous ECDSA signatures.
- MAST (Merkelized Abstract Syntax Trees): Allows complex spending conditions to be hidden until they are used, improving privacy and reducing transaction size.
- Tapscript: An upgraded scripting language that enables more complex smart contracts.
Taproot makes Bitcoin smart contracts more private, more efficient, and more flexible. It also paves the way for more advanced applications like discreet log contracts (DLCs) and improved Lightning Network functionality.
The Bottom Line
Bitcoin is not just digital cash – it is a programmable money platform. While it may not have the same flexibility as Ethereum, Bitcoin’s smart contract capabilities are sufficient for most financial applications, and they come with the security and decentralization that only Bitcoin can offer. As Taproot and future upgrades expand Bitcoin’s capabilities, the gap between Bitcoin and other smart contract platforms will continue to narrow.

