What Is a Smart Contract?
A smart contract is a program stored on a blockchain that runs automatically when its conditions are met. It is not a legal document and not a lawyer's contract; it is code that holds and moves value according to rules that everyone can read and no single party can quietly change. Smart contracts are the engine behind most of what people mean by "crypto apps", from token swaps to NFTs.
The plain-English idea
Think of a vending machine. You put in the right amount, press a button, and the machine dispenses your item automatically. There is no cashier deciding whether to serve you; the logic is built into the machine. A smart contract works the same way, but for digital value: "if this happens, then do that", enforced by the blockchain rather than by a person or company. Once deployed, it runs the same way for everyone, every time.
How it actually works
A developer writes the contract's rules in code and deploys it to a blockchain that supports smart contracts, most famously Ethereum. From then on, the contract lives at an address on the chain. When someone sends a transaction to that address, the network's computers all run the contract's code and agree on the result, which is recorded permanently. Because it is stored on the blockchain, no one can secretly alter what the contract does. For the ledger it lives on, see what is a blockchain.
Running a contract costs a fee, since it uses the network's computing power. On Ethereum this is paid as gas fees, and more complex contracts cost more to run.
What smart contracts power
Most things people do beyond simply holding a coin rely on smart contracts:
- Tokens. Most tokens other than a chain's native coin, including stablecoins and memecoins, are defined by a smart contract.
- DeFi. Lending, borrowing, and trading in decentralized finance are all governed by contracts.
- NFTs. An NFT is created and tracked by a smart contract.
- DAOs. Rules for community-run organisations, covered in what is a DAO, are enforced by contracts.
The strengths
Smart contracts are automatic, so they execute without waiting on a middleman. They are transparent, since their code and history are public. And they are tamper-resistant, because changing a deployed contract's behaviour is extremely difficult by design. For agreements between people who do not trust each other, this can remove the need for a trusted third party.
The serious limitations
The same properties that make smart contracts powerful also make them unforgiving:
- Bugs are permanent and costly. If the code has a flaw, attackers can exploit it and drain funds, usually with no recovery. The DAO hack of 2016 drained tens of millions of dollars through a single coding flaw.
- Immutability cuts both ways. A contract that cannot be changed also cannot be easily fixed once a problem is found.
- They only know what they are told. A contract cannot see the outside world on its own; it relies on data feeds, which can be a point of failure or manipulation.
- "Code is law" is harsh. If you interact with a malicious or poorly written contract, the outcome stands even if it was clearly unfair. This is a favourite tool of scammers, so see common crypto scams.
Why the concept matters
Understanding smart contracts demystifies most of crypto beyond simple payments. Nearly every app, token, and protocol you encounter is ultimately a set of these programs. Knowing that they run exactly as written, cost gas to use, and cannot easily be undone gives you a realistic picture of both their promise and their danger.
The takeaway: a smart contract is self-executing code on a blockchain that enforces rules automatically and transparently. That makes it a genuinely new tool for agreements without middlemen, and also one where a single mistake in the code can be irreversible and expensive.
A free daily email — the biggest movers, in plain English. No spam.