
A smart contract is a program deployed to a blockchain that executes automatically when its conditions are triggered. Once deployed, the code is immutable, the rules cannot be changed without an upgrade mechanism, and the execution is verified by every node on the network. The same code produces the same result for everyone—there is no middleman to interpret or refuse a transaction that meets the contract's terms.
Ethereum popularized the model with the Ethereum Virtual Machine (EVM), which runs Solidity and Vyper code. Most modern chains have adopted the EVM or built their own runtimes—Solana with Rust-based programs, Cosmos chains with CosmWasm, NEAR with WASM. Smart contracts power every DeFi protocol, NFT marketplace, on-chain game, and DAO in existence.
Immutability is both the feature and the danger. A correctly written contract enforces its rules exactly as intended, but a flawed one will execute its bugs just as faithfully. Billions have been lost to smart contract exploits—reentrancy attacks, oracle manipulations, integer overflows, and access control mistakes. Audits, formal verification, and battle-tested code patterns mitigate but never eliminate the risk. The phrase "code is law" captures both the power and the brutal honesty of the model.