What Are Smart Contracts?

How a piece of code came to replace intermediaries in financial agreements, and why that changed the direction of blockchain.

A smart contract is a computer program stored on a blockchain that automatically executes actions once certain conditions are met. Unlike a traditional contract, which relies on the parties trusting one another (or on a third party to arbitrate disputes), a smart contract fulfills whatever was programmed automatically, verifiably, and in practice impossible to circumvent without altering the source code before it runs.

The Origin of the Concept: Nick Szabo, 1994

Long before any blockchain existed that could run this kind of code, computer scientist and cryptographer Nick Szabo had already formulated the concept in 1994. Szabo described a smart contract as a set of promises, specified in digital form, including the protocols within which the parties perform on these promises automatically.

He used a simple example to illustrate the idea: a vending machine. Insert the correct amount, and the product is released without any human vendor mediating the transaction. Szabo argued that a smart contract would carry that same logic into far more complex agreements, such as property transfers, insurance, or loans.

The problem at the time was that no decentralized infrastructure existed that could reliably run that kind of logic without a central intermediary. That missing piece would only arrive almost two decades later.

Bitcoin: Capable, but Limited

When Bitcoin launched in 2009, it came with a simple scripting language that allowed for a few basic conditions within transactions. That language, however, was deliberately designed to be limited, prioritizing security and predictability over flexibility. It was possible, for example, to create transactions requiring multiple signatures, but it was not feasible to build complex applications or sophisticated business logic on top of the network.

Ethereum: A Network Built for Smart Contracts

In 2013, Vitalik Buterin published the Ethereum white paper proposing exactly that: a blockchain with a fully expressive (Turing-complete) programming language, capable of running any computational logic a developer could write. The network officially launched in 2015 and quickly became the reference environment for building smart contracts.

In practice, every smart contract on Ethereum is code, mostly written in Solidity, deployed to an address on the blockchain. Anyone can interact with it by sending transactions, and the result of that execution is processed by every node on the network, ensuring the outcome is identical for all participants.

How a Smart Contract Works in Practice

A smart contract follows a simple conditional logic: "if this happens, then execute that." Some common use cases include:

  • Decentralized lending: the contract automatically releases a loan as soon as the user deposits the required collateral.
  • Token swaps: the contract exchanges one token for another instantly, following a mathematical pricing formula, without relying on a central exchange.
  • Parametric insurance: the contract automatically pays out a claim when a verifiable condition is met, such as a flight delay recorded by an external data source.
  • Royalty distribution: the contract automatically splits payment among different creators every time a digital work is sold.

Advantages and Limitations

The main advantage of a smart contract is eliminating the need to trust a central intermediary: the code is public, auditable, and executes exactly what was programmed. This reduces operating costs and opens the door to financial applications accessible to anyone with an internet connection.

On the other hand, a smart contract is only as secure as the code written into it. Programming flaws have already resulted in significant losses of funds across several protocols over the years, which has made code audits an essential step before launching any contract that will handle meaningful value.

A Smart Contract Is Not the Same as a Legal Contract

It is worth stressing that a smart contract does not automatically replace a traditional legal contract. It executes predefined computational logic, but the legal validity of an agreement represented by that code still depends on the legislation of each country and the context in which it is used. For this reason, the term is best understood as a technical tool for automating agreements, rather than a legal category in itself.

Frequently Asked Questions About Smart Contracts

Who coined the term smart contract?

The term was coined by computer scientist Nick Szabo in 1994, nearly two decades before any blockchain existed that could actually run this kind of code.

Is a smart contract the same as a legal contract?

No. A smart contract is computer code that automatically executes actions once certain conditions are met. It can represent an agreement, but it does not, by itself, replace the legal validity of a traditional contract in every jurisdiction.

Which blockchain is most used for smart contracts?

Ethereum was the first network to popularize smart contracts at scale and remains the most widely used, although other networks such as Solana, BNB Chain, and Avalanche also support smart contracts.

See also: The History of Blockchain and the term Smart Contract in our Glossary.