Skip to content

What is a smart contract?

A program that carries out an agreement by itself, such as releasing money once set conditions are met. Nick Szabo coined the term in 1994.

The computer scientist Nick Szabo coined the term in a 1994 essay, defining a smart contract as “a computerized transaction protocol that executes the terms of a contract”. The aim was to need fewer trusted middlemen. Two years later he pointed to an everyday example, the vending machine: put in the right coins and it hands over the goods, with no shopkeeper involved.

Bitcoin has simple ones built in. Every coin is locked by a short script that says what it takes to spend it: one signature, two signatures out of three (multisigMultisig (multi-signature)A wallet whose coins need signatures from several keys, such as 2 of 3, so no single key can spend alone.), or a wait until a set time (a timelockTimelockA rule inside a payment that stops coins being spent until a certain block height or time has passed.). Bitcoin’s developer guide calls these contracts “transactions which use the decentralized Bitcoin system to enforce financial agreements”. Payment channelsPayment channelA shared pot of bitcoin between two parties on the blockchain, which they can pay each other from, off-chain, as often as they like., the building blocks of the Lightning Network, are made this way.

Bitcoin keeps its script language deliberately small. It has no loops, which keeps every script predictable and stops one from running forever. Ethereum, a newer blockchainBlockchainBitcoin's shared record of every payment since 2009, stored in blocks that each link to the one before — which is what makes it a chain., took the other path: its white paper lists the lack of loops among the limits of Bitcoin’s scripts, and it was built to run programs of almost any kind.

All Bitcoin terms

References