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 code on a blockchain that runs exactly as written the moment someone calls it, enforcing fixed rules with no middleman. It's not a legal agreement and it's not intelligent — and it can't see off-chain data by itself. That literal execution is its strength and its sharpest 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 that lives on a blockchain and runs on its own the moment someone calls it. Both words oversell it. There’s no contract in the legal sense, and nothing clever is happening under the hood. It’s code. Code that executes exactly as written, on a network that runs it the same way for everyone — no clerk in the middle, and no takebacks.
What a smart contract actually is
Picture deploying code to an address the way you’d send funds to one. On chains that support this — Ethereum came first and still sets the tone — that code, once deployed, simply lives there. It can hold funds. It can store data. It exposes functions that anyone on earth can trigger by firing off a transaction. And when triggered, it runs across the network’s computers, every node executing it identically and checking everyone else’s result, with the outcome written into the shared ledger for good.
Because the logic and its results sit on-chain, they take on the chain’s character. Anyone can read the code. Nobody has to trust one company’s server, since the whole network verifies what happened. Change it quietly after the fact? Usually impossible. The plain-language version people reach for is “if this, then that, enforced by the network” — a vending machine rather than a person. Feed it the required input, it dispenses the defined output. No attendant weighing whether to honour your request. No bad mood, no lunch break.
A simple mental model
Think escrow, purely as a way to see the mechanics. You could write a contract that grips a pile of funds and releases them to a seller once some agreed condition gets recorded on-chain — or hands them back to the buyer if that condition never lands by the deadline. No middleman has to be trusted to hold the money honestly. The release rules are frozen in code everyone can read, and the network applies them identically to both sides.
Stretch that one pattern and you’ve covered most of what these programs do: token systems, lending setups, exchanges, anything where fixed rules move value between parties with no trusted operator sitting in the middle. The apps built on top get called “decentralised applications,” or dapps. You’ll see the shorthand everywhere.
What a smart contract is not
Here’s where people get burned, honestly — the term breeds more confusion than almost anything else in crypto. So let’s be blunt about what it is not:
- Not a legal contract. By itself it creates no obligation a court will enforce. It enforces its own code — a wholly different thing from enforcing an agreement in law.
- Not intelligent. No AI. No judgement. It follows fixed instructions to the letter, mistakes and all.
- Not able to reach off-chain on its own. A contract can’t natively know a stock price or whether your parcel arrived. It sees only what’s already on-chain. Pulling in outside information takes a separate service called an oracle — which drags its own trust questions along for the ride.
- Not self-starting. Nothing happens until someone sends a transaction that calls it. It sits there, inert, until triggered. No hidden timer waiting to fire.
- Not always unchangeable in practice. The deployed code is fixed, yes — but developers can wire in upgrade mechanisms or admin controls. So whether a contract is truly “immutable” depends entirely on how it was written.
Hold those limits in mind and you sidestep a mountain of misunderstanding. A smart contract is powerful because it’s narrow and literal. That same literalness is where the danger lives.
Running code costs money
Every time a contract runs, it consumes the network’s computing resources, and whoever pulled the trigger pays for that work. On Ethereum the meter is called gas. Heavier operations cost more; a transaction that burns through the fee it set aside just fails rather than finishing halfway. That’s deliberate. It kills infinite loops and stops anyone clogging the network for free. What those fees actually cover gets its own explainer — see what gas fees actually pay for.
The practical upshot: on-chain computation is genuinely expensive next to running the same logic on a normal server. So contracts show up where the guarantees — public, unchangeable rules that no single operator controls — earn that premium. Not because they’re a cheap way to run code. They aren’t. Nobody serious pretends otherwise.
Composability: contracts that call other contracts
One property makes these things genuinely powerful, and it’s worth pausing on: composability. Because contracts sit at public addresses and expose callable functions, one contract can call another mid-execution. Need to swap one token for another? Your contract just calls an existing exchange contract to handle it, rather than rebuilding that machinery from scratch. Developers nicknamed the whole approach “money legos” — assembling new applications by snapping together on-chain pieces that already exist.
This is why ecosystems of contracts sprawl so fast. Each new one gets to stand on everything already deployed. But the same move compounds risk. Lean your contract on another and you inherit its flaws and its surprises — one weak component can quietly drag down everything stacked above it. That’s the model’s double edge in a single image: the openness that lets useful systems assemble themselves is the very openness that lets a bug in one popular contract ripple outward for months. Which is why touching a complex application almost never means trusting one piece of code. You’re trusting the whole stack.
The risks that come with “code is law”
Since a contract executes exactly as written, and often can’t be corrected once it’s live, bugs get expensive in a hurry. A flaw runs just as faithfully as correct logic would, doing something the author never intended, with no administrator on hand to hit pause or claw back the result. Some of the largest losses in crypto history came not from broken cryptography but from ordinary mistakes in contract logic that behaved precisely as coded. The code did its job. The job was wrong.
A few sober lessons drop out of that:
- Auditing matters. Serious contracts get combed over by specialists before they ever touch real value — though an audit shrinks the risk, it never zeroes it.
- Interacting with a contract means trusting its code. Approve one to move your funds and you’re trusting what it will really do, which can differ from whatever a website’s front end claims.
- Immutability cuts both ways. The property that stops an attacker tampering also stops an honest developer fixing a slip — unless upgrade paths were designed in from day one.
Want to check whether an address is a contract, and often read its verified code? A block explorer will show you — see how to read a block explorer.
What this means
Picture a smart contract as an automated, network-enforced vending machine for value. You write the rules once, deploy them, and the network runs them identically for everyone, with no trusted operator in the middle. What it isn’t: a legal document. It isn’t an intelligent agent, and it can’t sense the outside world unaided. Its great strength — literal, unstoppable execution — is welded to its great danger, because code that runs exactly as written will run any mistake it holds just as faithfully. Keeping both the power and the limits in view is the whole difference between a realistic grasp of this technology and the hype around it. For the ledger these programs call home, 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 gas fees actually pay for
Gas fees pay for the computation your transaction needs and ration limited block space. Here is what they actually fund…
How a crypto transaction gets confirmed
A crypto transaction is confirmed when a block includes it and more blocks build on top. Here is how a…
What Is a Paper Wallet? How It Works & Risks
A paper wallet is an offline printout of your crypto keys; it removes online hacking risk but adds physical loss,…


