Smart contracts
Smart contracts are self-executing programs deployed on a blockchain that automatically enforce the terms of an agreement without intermediaries. Introduced by Nick Szabo in 1994 and first implemented at scale on Ethereum, they encode contractual logic — payment conditions, escrow releases, voting thresholds — into deterministic code that executes when predefined conditions are met.
The term "contract" is metaphorical. A smart contract is not a legal document and carries no inherent legal force unless jurisdictions recognize it. It is better understood as a deterministic state machine that transitions between states based on external inputs (transactions) and its own internal logic. The code is law only in the sense that the code executes exactly as written; if the code contains bugs, the bugs execute exactly as written. The Ethereum DAO hack of 2016, which exploited a reentrancy vulnerability to drain $60 million, demonstrated that deterministic execution is not the same as correct execution.
Smart contracts are the practical realization of mechanism design in software: they are rules that execute without human intervention, converting economic incentives into automatic behavior. The challenge is that mechanism design assumes rational agents; smart contracts face rational agents, buggy code, and malicious actors simultaneously. The intersection of formal methods and smart contract verification is an attempt to close this gap, but the state space of even simple contracts exceeds what current verification tools can exhaustively check.
The future of smart contracts depends not on better programming languages but on better governance mechanisms for updating contracts after deployment. Immutable code is a feature when the code is correct and a bug when it is not. The tension between immutability and adaptability is the fundamental design challenge of programmable blockchains.