Asset 20 8 2
Does AI recommend your business? Run the free check →

Join 15,000 business owners, marketers and entrepreneurs. The Sunday newsletter you'll be annoyed only arrives once a week.

Article

What Is a Smart Contract? A Plain English Guide

A smart contract is a program stored on a blockchain that automatically carries out an agreed rule when set conditions are met. ethereum.org describes it as code and data living at an address on the chain. Once deployed, it runs exactly as written, which makes it predictable but hard to fix if there's a bug.

Smart contracts come up in almost every conversation about blockchains, NFTs and decentralised apps, yet the name puts a lot of people off. They aren't legal documents and they aren't especially clever. They're small programs that run on a blockchain and carry out an agreed rule automatically, without anyone in the middle deciding whether to honour it.

This guide is built from ethereum.org's own explainers and developer documentation, including its page on smart contract security. I'll stick to how they work, where they're used and what can go wrong. It's an explainer, not financial or legal advice, and it doesn't recommend using or holding any cryptoasset.

The smart contract definition from ethereum.org

ethereum.org describes smart contracts as programs stored on a blockchain that follow "if this then that" logic. Its developer documentation goes a step further: a smart contract is a collection of code (its functions) and data (its state) that lives at a specific address on the Ethereum blockchain.

  • It's a type of Ethereum account, so it can hold a balance and receive transactions.
  • No user controls it. Once deployed, it runs exactly as it was programmed.
  • Interactions with it are irreversible, and contracts can't be deleted by default.
  • Anyone can write and deploy one, using a smart contract language such as Solidity or Vyper.

The vending machine analogy and Nick Szabo's smart contracts

The term itself is older than Ethereum. ethereum.org credits the computer scientist Nick Szabo with coining it, noting that he wrote an introduction to the concept in 1994 and explored its possibilities further in 1996.

Szabo's best-known comparison is the vending machine. You choose an item and put in the right amount, and the machine hands it over. Nobody behind the counter has to check, approve or remember the deal, because the rule is built into the machine. ethereum.org puts it as specific inputs guaranteeing predetermined outputs. A smart contract works the same way: when its conditions are met, it acts, and when they aren't, it doesn't.

What smart contracts are used for

ethereum.org lists a range of uses that already run on smart contracts:

  • Stablecoins, tokens designed to track the value of something steadier.
  • Unique digital assets, better known as NFTs, created and distributed by code.
  • Automatic token swaps, open to anyone without a middleman.
  • Decentralised gaming, where game rules and items live on the chain.
  • Insurance policies that settle automatically when set conditions are met.
  • Token standards that let different tokens work together in the same apps.

Part of what makes this possible is what ethereum.org calls composability. Public contracts behave like open APIs, so one contract can call another and build on top of it. Contracts can even deploy other contracts.

How a smart contract runs on the blockchain

  1. A developer writes the contract in a language such as Solidity and compiles it.
  2. The compiled code is deployed to the blockchain in a transaction, which uses gas. ethereum.org notes that deploying a contract uses far more gas than a simple ETH transfer.
  3. The contract gets its own address, where its code and data live.
  4. Users or other contracts send transactions to that address to trigger its functions.
  5. Every node runs the same code, and the network's consensus rules decide the agreed result.

That last step is where the blockchain's design matters. On Ethereum, the agreement comes from proof of stake, which I explain alongside its predecessor in my guide to proof of work vs proof of stake.

Smart contract limits: immutability, oracles and size

  • Code can't usually be changed. ethereum.org says smart contract code cannot be changed once created. Developers can design upgradeable contracts using a proxy pattern, but that has to be planned in from the start.
  • No direct view of the real world. ethereum.org explains that smart contracts can't access off-chain data on their own, by design. Oracles are the services that bring that outside information onto the chain.
  • A size ceiling. ethereum.org gives a maximum contract size of 24KB. Larger projects split their logic across several contracts.
  • Hard-to-read transactions. ethereum.org warns that raw transaction data is difficult for people to read, which leads to blind signing, where users approve something they don't understand.

Smart contract risks, bugs and famous failures

Because a contract does exactly what its code says, a mistake in the code is a mistake that runs automatically. ethereum.org's security page explains that deployed code usually can't be patched and that stolen assets are mostly irrecoverable. Its best-known example is The DAO hack in 2016, when 3.6 million ETH was stolen.

The same page describes common weaknesses, including reentrancy, where a malicious contract calls back into a vulnerable one before it finishes and drains it, and oracle manipulation, where an attacker distorts the outside data a contract relies on. ethereum.org notes that audits help but won't catch every bug, and many projects also run bug bounties so ethical hackers report problems instead of exploiting them.

Work with me

Want AI doing the heavy lifting in your marketing?

I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.

For everyday users, the practical lessons are simple. Read what you're being asked to approve, be wary of links from strangers and remember that a transaction approved by mistake can't usually be undone. The FCA also warns that cryptoassets are high risk and largely unregulated in the UK.

Writing about smart contracts and decentralised apps

Smart contracts sit right where software development, finance and law overlap, so clear writers are in short supply. If you can explain contract design, audits or oracles in plain English, it's worth sharing that knowledge more widely.

If smart contracts are your specialist subject, take a look at where blockchain writers can submit articles.

Frequently asked questions

Is a smart contract legally binding?

Not automatically. On ethereum.org, a smart contract is a program that runs on a blockchain, not a legal agreement. Whether one has legal force is a separate legal question, so take advice from a solicitor if it matters.

Who invented smart contracts?

ethereum.org credits Nick Szabo with coining the term. He wrote an introduction to the concept in 1994 and explored it further in 1996.

Can a smart contract be changed after it's deployed?

Usually not. ethereum.org says smart contract code can't be changed once created, although developers can build in upgrades using a proxy pattern from the start.

What is a blockchain oracle?

An oracle brings outside information onto a blockchain. ethereum.org explains that smart contracts can't access off-chain data by themselves, so oracles fill that gap.

Which language are Ethereum smart contracts written in?

ethereum.org names Solidity and Vyper as smart contract languages. The code is compiled before it's deployed to the blockchain.

Published and maintained by the Lilach Bullock team, covering marketing, AI and business growth.
Your buyers are asking AI who to use. Does it say you?

See for free whether ChatGPT, Claude, Perplexity, Gemini and Google name you, and get the plan to become the answer.

Check my AI visibility →
Sundays only

Get the Sunday newsletter.

One email a week. AI experiments, marketing tactics, and the workflows Lilach is building right now in her own business.

Subscribe free

Let’s get your marketing running on AI.

Book a free 30-minute call

We figure out what you need, where AI fits in, and what working together would look like.

Book the call →

Or take the 30-second calculator

You’ll see the hours and the money quietly leaking out of your week, and the three workflows worth building first.

Take the calculator →

Or grab the free AI resource library

Prompt packs, templates, checklists, and swipe files. The exact tools I build for paying clients. Yours, free.

Get the library →
Keep reading

More from the blog.