Smart Contract
What Is a Smart Contract?
A smart contract is a program that runs on a blockchain and executes automatically when its predefined conditions are met, without requiring a trusted intermediary to enforce the agreement. The term predates blockchain technology itself - computer scientist Nick Szabo coined it in 1994 - but it wasn't practically implementable at scale until Ethereum's 2015 launch, which built smart-contract execution directly into its core protocol via a Turing-complete virtual machine (the Ethereum Virtual Machine, or EVM), making it possible to deploy arbitrary programmable logic on top of a public blockchain for the first time.
In practice, a smart contract is simply code, deployed to a specific address on a blockchain, that anyone can interact with according to its own rules. A decentralized exchange's smart contract, for instance, holds and swaps token pairs automatically according to a defined pricing formula, without a company approving individual trades. A lending protocol's smart contract holds collateral and issues loans automatically once collateral requirements are met, and can automatically liquidate that collateral if its value falls below a defined threshold - all without a bank or loan officer involved.
Smart contracts underpin nearly all of what's generally called DeFi: decentralized exchanges, lending protocols, yield-generating vaults, and synthetic asset platforms are all, functionally, collections of interacting smart contracts. The same technology underlies NFTs and DAOs (decentralized autonomous organizations), which use smart contracts to encode voting and treasury rules directly rather than relying on traditional corporate governance structures.
Because smart-contract code is often deployed as immutable once live, and because it frequently controls large amounts of user funds directly, smart-contract security is one of the highest-stakes technical problems in crypto. A single bug in a widely used contract's code can be exploited to drain funds directly, with no recourse through a bank or payment processor - DeFi protocols have collectively lost billions of dollars to smart-contract exploits since 2020. This is why contract audits, conducted by specialized security firms before a major protocol launches, have become a standard part of DeFi's development process, and why an unaudited contract holding significant user funds is treated as a meaningful red flag.
While Ethereum remains the platform most associated with smart contracts, the capability is now standard across most major blockchains - including Solana, Avalanche, Cardano, and layer-2 networks built on Ethereum itself - each with its own trade-offs in execution speed, cost, and programming language.
Smart-contract capability has also become a competitive axis in its own right among blockchains, with newer networks differentiating themselves on transaction speed, cost, and developer tooling for building contracts rather than on the basic ability to run them at all, since that baseline capability is now assumed. Cross-chain smart-contract interaction - a contract on one chain triggering or verifying an action on another - remains one of the more technically difficult and security-sensitive areas of the field, and a disproportionate share of the largest DeFi exploits to date have involved exactly that kind of cross-chain interaction rather than a flaw in a single, self-contained contract.