Contracts & tokens · 2 min read

What is a smart contract?

By Oliver James Whitmore · Updated 20 October 2026

In one sentence

A smart contract is a program stored on a blockchain that runs exactly as written whenever a transaction calls it, with every node executing it and checking the same result.

Every node runs the same contract code on the same input and reaches the same result.Transactioncalls vote()Smart contractcode + storagehas its own addressnode 1: count = 42node 2: count = 42node 3: count = 42Deterministic: same input, same code, same result everywhere
Every node runs the same contract code on the same input and reaches the same result.

How it works

The term was coined by the computer scientist Nick Szabo in the 1990s, long before blockchains, to describe agreements enforced by software. His favourite illustration was a vending machine: put in the right amount and the machine hands over the item, with no clerk involved.

Ethereum, launched in 2015, made this practical on a public blockchain. A developer deploys a contract with a transaction; the code receives its own address and its own storage. From then on, anyone can call its functions by sending a transaction. Every node runs the same code in the Ethereum Virtual Machine and must reach exactly the same result, which is why contracts are strictly deterministic.

That determinism has consequences. A contract cannot read a website or check the weather by itself; outside information has to be brought in by a service called an oracle. Once deployed, the code usually cannot be changed, unless it was written with an upgrade mechanism, which in turn means someone holds the power to upgrade it. Bugs are permanent and public. In 2016 a flaw in a contract called The DAO was exploited, and the Ethereum community responded with a hard fork.

Every step a contract performs costs gas, paid by whoever calls it.

A simple example

A club writes a voting contract. It accepts one vote per member address, rejects anything after a fixed deadline and keeps a running count. Nobody needs to trust a person counting the votes: anyone can read the code, see every vote as a transaction, and recompute the result themselves.

Common misconception

Misconception: A smart contract is a legally binding contract.

In fact: It is code, not a legal document. It may carry out part of an agreement, but whether there is a binding contract in law depends on the people involved and the applicable law. And "smart" does not mean clever: it does exactly what it says, mistakes included.

Where you meet it

  • Tokens and NFTs, which are smart contracts.
  • DAOs, bridges and layer-2 systems.
  • Applications grouped under the name "DeFi".

Sources

This card explains a technical concept for general education. It is not a recommendation to acquire, sell or hold any crypto-asset, and it is not financial advice.