What is a smart contract?

Answer

A smart contract is a self-executing program stored on a blockchain that automatically enforces and executes the terms of an agreement when predetermined conditions are met — without intermediaries. The term was coined by Nick Szabo in 1994. On Ethereum, smart contracts are written in Solidity (or Vyper), compiled to bytecode, and deployed on the blockchain. Once deployed, they are: (1) Immutable — the code cannot be changed (unless designed with upgrade patterns); (2) Deterministic — same input always produces same output; (3) Trustless — execution is guaranteed by the blockchain, not by the counterparty's honesty; (4) Transparent — anyone can read the bytecode (and verify the source with Etherscan); (5) Permanent — live as long as the blockchain exists. Examples: automated token swaps (DEXes), lending/borrowing protocols, NFT minting, voting systems, and escrow agreements.