Smart Contract
Program stored on a blockchain that runs automatically when its conditions are met, carrying out agreements or rules without a central operator.
A smart contract is code deployed to a blockchain that executes when transactions call it. Every participating node runs the same code and records the result, so the outcome does not depend on any single party. Contracts can hold and transfer digital assets, keep records and interact with other contracts. Despite the name, most smart contracts are not legal contracts; they are programs that enforce whatever rules their code specifies. On Ethereum, they are commonly written in Solidity and compiled to run on the Ethereum Virtual Machine.
Nick Szabo described smart contracts in the 1990s, comparing them to a vending machine that automatically completes a sale once a coin is inserted. Bitcoin supports only a limited scripting language, and Ethereum, launched in 2015, was the first major blockchain designed for general-purpose contracts. They underpin tokens, decentralized finance, non-fungible tokens and decentralized autonomous organizations. Each operation consumes gas, a fee that limits computation and pays the network for executing code.
Because deployed contracts are often difficult or impossible to change, bugs can be costly and irreversible. The 2016 exploit of The DAO and a 2017 flaw that froze funds held in Parity multisignature wallets are well-known examples. Developers rely on audits, testing and formal verification, and some use upgradeable designs that trade immutability for the ability to fix errors. Contracts cannot read off-chain information without an oracle, and their legal status varies by jurisdiction, so code alone rarely settles every dispute.
Key points
- Smart contracts are programs executed identically by every node on a blockchain.
- Nick Szabo proposed the idea in the 1990s; Ethereum made it practical in 2015.
- Bugs in deployed contracts can cause irreversible losses.
- Contracts need oracles to use real-world data and are not automatically legal agreements.
Related entries
Ethereum
Decentralized blockchain platform, launched in 2015, that runs smart contracts and uses its native cryptocurrency, ether, to pay for computation.
Solidity
Statically typed, object-oriented programming language for writing smart contracts on Ethereum and other EVM-compatible blockchains.
Nick Szabo
American computer scientist and legal scholar who coined the term smart contract in the 1990s and designed bit gold, a precursor of Bitcoin.
Decentralized Finance
Financial services such as lending, trading and derivatives built from smart contracts on public blockchains, operating without traditional intermediaries.
DAO
Organization whose rules and shared funds are managed by smart contracts on a blockchain, with members voting on decisions instead of central management.
Gas (Ethereum)
Unit measuring the computational work needed to execute operations on Ethereum, used to calculate transaction fees and limit resource use.
Oracle (Blockchain)
Service that supplies external data such as prices or real-world events to smart contracts, which cannot fetch information from outside their blockchain.
Vitalik Buterin
Russian-Canadian programmer who co-founded Ethereum, proposing in 2013 a blockchain platform for running general-purpose smart contracts.
Featured in guides
Referenced by
Other entries that discuss or point to Smart Contract.