Smart Contract
A program stored on a blockchain that runs automatically when its conditions are met. Smart contracts are how blockchains do anything beyond just transferring tokens — DeFi, NFTs, DAOs, and DeAI infrastructure all run on smart contracts.
Also known as: on-chain code, chain program
Smart contracts are the second great innovation in blockchain technology after the blockchain itself. Bitcoin proved you could have decentralised value transfer; Ethereum proved you could have decentralised arbitrary computation. A smart contract is just a program: input goes in, defined rules run, output comes out, and the result is recorded permanently on the blockchain. The crucial difference from a normal program is that nobody owns the smart contract once it’s deployed. It runs on the consensus of every validator, not on any single server, and nobody can shut it down or modify it (unless the contract was specifically designed to allow upgrades).
The implications are far-reaching. A smart contract can hold tokens (lending pools, DEX liquidity, custodial wallets), enforce rules (vesting contracts, staking contracts, multi-sig wallets), respond to events (oracle integrations, automatic liquidations, scheduled payments), and call other smart contracts to compose complex behaviours. Almost everything in DeFi and DeAI is built from these primitives. A staking protocol is a smart contract. An AMM is a smart contract. An NFT collection is a smart contract. A DAO governance system is a smart contract.
The flip side is that smart contracts are immutable by default, which means bugs are catastrophic. Once a vulnerability is in production, the funds at risk are usually impossible to recover. Crypto history is littered with multi-million-dollar smart contract exploits: The DAO hack ($60M, 2016), Parity multisig freeze ($150M+, 2017), Ronin bridge hack ($600M, 2022), and dozens of others. Modern projects use multiple audits, formal verification, and gradual rollouts to minimise this risk, but smart contract security is fundamentally hard.
In DeAI, smart contracts handle the on-chain components of decentralised AI projects: token contracts, staking, governance, payment routing for inference services, attestation registries, and integration with broader DeFi infrastructure. The OYM Open Source dimension of the Freedom Score scores projects partly on whether their critical smart contracts are open source, audited, and free of upgrade backdoors that could be abused by the team. Smart contracts that look decentralised but have hidden admin keys are a recurring red flag.