What a smart contract is and what it isn’t
A smart contract is code stored on a blockchain that runs automatically when called. It is not a legal contract and not intelligent. Here is what it is and isn't.

Quick answer
A smart contract is a program on a blockchain that runs exactly as written when someone calls it, enforcing predefined rules without a trusted middleman. It is not a legal agreement, not intelligent, and cannot reach outside the chain on its own. Its literal execution is both its strength and its main risk.
Key points
- It is code on a blockchain that runs when someone calls it
- It enforces its own rules, not a legal agreement
- It cannot see off-chain data without an oracle
- Running it costs a fee measured in gas
- Deployed code is often fixed, so bugs run exactly as written
A smart contract is a program stored on a blockchain that runs automatically when its conditions are met. Despite the name, it is not a legal contract and it is not especially “smart.” It is code that executes exactly as written, on a network that guarantees it will run the same way for everyone.
What a smart contract actually is
On blockchains that support them — Ethereum being the original and best known — you can deploy code to an address, much as you would send funds to an address. Once deployed, that code lives on the chain and can hold funds, store data, and expose functions that anyone can call by sending a transaction to it. When called, the code runs on the network’s computers, and every node executes it identically and checks the result. The outcome is recorded on the shared ledger.
Because the code and its results are on the blockchain, they inherit the blockchain’s properties: the logic is public and auditable, its execution is verified by the whole network rather than a single server, and once deployed it typically cannot be quietly changed. A useful plain-language definition is “if this, then that, enforced by the network” — a vending machine rather than a person. You put in the required input, and the machine dispenses the defined output with no clerk deciding whether to honour it.
A simple mental model
Consider an escrow-like example, described only to illustrate the mechanics. A contract could be written to hold funds and release them to a seller once a specified condition is recorded, or return them to the buyer if it is not, by a deadline. Nobody has to trust a middleman to hold the money honestly, because the rules for releasing it are fixed in code that everyone can read and that the network enforces uniformly.
Generalise that pattern and you get most of what smart contracts are used for: token systems, lending arrangements, exchanges, and other applications where predefined rules move value between parties without a trusted operator in the middle. The applications built from them are often labelled “decentralised applications,” or dapps.
What a smart contract is not
The term causes more confusion than almost any other in crypto, so it is worth being precise about what it is not:
- Not a legal contract. It does not by itself create legally binding obligations, and courts do not enforce it. It enforces its own code, which is a different thing from enforcing an agreement in law.
- Not intelligent. There is no AI or judgement involved. It follows fixed instructions literally, including any mistakes in those instructions.
- Not able to reach outside the blockchain on its own. A contract cannot natively know a stock price, the weather, or whether a package arrived. It only sees data that is already on-chain. Bringing external information in requires a separate service called an oracle, which introduces its own trust considerations.
- Not automatically self-running. A contract does nothing until someone sends a transaction that calls it. It sits inert until triggered; there is no built-in timer that fires on its own.
- Not necessarily unchangeable in practice. While the deployed code is fixed, developers can build in upgrade mechanisms or administrative controls. So “immutable” depends on how a specific contract was written.
Holding these limits in mind prevents a lot of misunderstanding. A smart contract is powerful precisely because it is narrow and literal — and that literalness is also its main risk.
Running code costs money
Executing a smart contract consumes the network’s computing resources, and the person who triggers it pays for that computation through a fee. On Ethereum this is measured in gas. More complex operations cost more, and a transaction that runs out of the fee it allocated will fail rather than complete halfway. This is a deliberate safeguard: it prevents infinite loops and stops anyone from clogging the network for free. The detail of what these fees pay for is covered in what gas fees actually pay for.
The practical implication is that on-chain computation is genuinely expensive compared with running the same logic on an ordinary server. Smart contracts are used where the guarantees — public rules, no trusted operator, verified execution — are worth that cost, not because they are a cheaper way to run programs.
Composability: contracts that use other contracts
One property that makes smart contracts genuinely powerful is composability: because contracts live at public addresses and expose callable functions, one contract can call another as part of its own execution. A contract that needs to swap one token for another, for example, can call an existing exchange contract to do it, rather than reimplementing that logic. Developers sometimes call this “money legos” — building new applications by snapping together existing on-chain pieces.
Composability is why ecosystems of contracts can grow quickly, since each new contract can build on the ones already deployed. But it also compounds risk. If your contract relies on another, it inherits any flaws or unexpected behaviour in that one, and a single weak component can affect everything built on top of it. This is the double edge of the whole model in miniature: the same openness that lets useful systems assemble themselves also means a bug in one widely used contract can ripple outward. It is a reason that interacting with a complex application is rarely a matter of trusting a single piece of code, but a whole stack of them.
The risks that come with “code is law”
Because a smart contract executes exactly as written and often cannot be corrected after deployment, bugs are unusually consequential. If the code contains a flaw, it may run faithfully in a way its author never intended, and there is frequently no administrator who can pause it or reverse the outcome. Several of the largest losses in crypto have come not from broken cryptography but from mistakes in contract logic that behaved precisely as coded.
A few sober takeaways follow from this:
- Auditing matters. Serious contracts are reviewed by specialists before handling significant value, though an audit reduces risk rather than eliminating it.
- Interacting with a contract means trusting its code. When you approve a contract to access your funds, you are trusting what it will do, which may differ from what a website says it does.
- Immutability cuts both ways. The same property that stops a bad actor from tampering also stops a good actor from fixing a mistake, unless upgrade paths were designed in from the start.
You can inspect whether an address is a contract, and often view its verified code, using a block explorer — see how to read a block explorer.
What this means
A smart contract is best understood as an automated, network-enforced vending machine for value: you define rules once, deploy them, and the network runs them the same way for everyone, without a trusted operator in the middle. What it is not is a legal document, an intelligent agent, or something that can sense the outside world by itself. Its strength — literal, unstoppable execution — is inseparable from its main danger, because code that runs exactly as written will also faithfully run any mistake it contains. Keeping both the capability and the limits in view is what separates a realistic understanding from the hype. For the ledger these programs live on, see what a blockchain actually is.
Sources
Frequently asked questions
Is a smart contract a legally binding contract?
No. It is a program on a blockchain that enforces its own code, not a legal agreement. It does not by itself create obligations that courts enforce.
Can a smart contract access real-world data like prices or weather?
Not on its own. It can only see data already on the blockchain. Bringing in external information requires a separate service called an oracle, which adds its own trust considerations.
Why can't a buggy smart contract just be fixed?
Once deployed, a contract's code is typically fixed and there is often no administrator who can change or pause it. Contracts can only be upgraded if the developers built that capability in from the start.
Related
What is a Merkle tree?
A Merkle tree summarises many items into one hash. Learn what a Merkle tree is, how it is built from…
What a blockchain actually is, without the metaphors
A blockchain is a shared, tamper-evident database that many computers keep identical copies of — here is how that actually…
How crypto phishing attacks actually work
How crypto phishing attacks work: the tricks that steal wallets, the wallet-drainer signature scam, and the simple habits that stop…


