A smart contract is self-executing code on the blockchain that settles agreements automatically without intermediaries.