Crypto Basics

Ethereum and Smart Contracts Explained

By Thomas Lovas Lokoy — researched and drafted with AI from published sources; edited and published by NorwegianSpark SA | Last updated: 2026-10-16

This article contains affiliate links. We may earn a commission at no extra cost to you. Full disclosure

A smart contract is a program stored on a blockchain that runs automatically when its conditions are met — ethereum.org defines them as programs that follow "if this then that" logic and are "guaranteed to execute according to the rules defined by its code, which cannot be changed once created". Ethereum, live since its genesis block on 30 July 2015, was built to run them, which is why it is often described as a programmable computer rather than just digital money. Smart contracts power decentralised exchanges, lending protocols, stablecoins and NFTs; most are written in Solidity or Vyper; and every interaction costs a fee called gas, paid in ETH. The trade-off is that code which cannot be stopped also cannot be corrected when it is wrong.

What a smart contract is, in plain terms

If Bitcoin is digital money, Ethereum is closer to a global, programmable computer. ethereum.org's own analogy is a vending machine: you choose an item, pay the price, the machine checks the payment and only then releases the item — no shop assistant needed. A smart contract does the same with digital assets: "if X happens, send Y to Z". The idea is older than Ethereum; the computer scientist Nick Szabo coined the term "smart contract" in 1994.

Examples of what smart contracts do

  • Token contracts create and track tokens, including stablecoins — see our stablecoin guide.
  • Decentralised exchanges swap one token for another from a pool of liquidity, without a company holding your funds; why a swap can fill worse than quoted is covered in MEV and slippage.
  • Lending protocols let people borrow against collateral, with rules enforced by code — part of the wider picture in CeFi vs DeFi.
  • NFTs are contracts that record ownership of a unique token.
  • Staking contracts handle ETH staked to secure the network — see crypto staking explained.

Gas: what every interaction costs

Running these operations costs "gas", a fee paid in ETH that compensates the network and varies with demand; high activity means high gas, which is why fees spike during busy periods. Since the London upgrade on 5 August 2021, part of each fee — the base fee — is burned rather than paid to anyone. Our explainer on base fee vs priority fee shows why a transaction gets stuck.

The risks

The honest beginner's caveat: this programmability is powerful but introduces new risks. Smart contracts can contain bugs or be outright malicious, and "the code is the law" cuts both ways — if a contract is exploited, there is often no recourse. That is why our security guide stresses caution with token approvals.

Ethereum builds on the foundations in Bitcoin basics, and it underpins much of what we discuss in stablecoins and crypto earn and staking, since ETH itself can be staked. As always, volatility and risk applies — ETH is as volatile as the rest of the market.

Frequently asked questions

What is an Ethereum smart contract? A program stored on the Ethereum blockchain that executes automatically according to its code when its conditions are met. Once deployed, its rules cannot be changed (unless it was built with an upgrade mechanism), and no one can stop it from running as written.

What are examples of smart contracts? Token contracts (including stablecoins), decentralised exchanges, lending protocols, NFT contracts and staking contracts are all smart contracts running on Ethereum and similar networks.

What language are Ethereum smart contracts written in? ethereum.org names Solidity and Vyper as the two most active and maintained languages for Ethereum smart contracts.

Are smart contracts safe? Not automatically. They can contain bugs or be malicious, an audit reduces rather than removes risk, and token approvals you grant stay live until revoked. Test with small amounts and review approvals regularly — see token approvals.

What "Unstoppable Code" Costs You

The property that makes smart contracts useful is the same one that makes them dangerous: they execute exactly as written, and neither party can intervene.

The practical consequences, in the order they bite:

  • A bug is a feature of the contract, not an error to be corrected. Funds lost to

one are lost in accordance with the code.

  • An approval is standing permission. Granting a contract access to a token usually

grants it access to your balance until you revoke it, not just for one transaction.

  • Upgradeable contracts have an admin. That is often sensible engineering and it

means somebody can change the rules. Find out who, and what a change requires.

  • Composability propagates failure. A contract that calls another inherits its

weaknesses, which is how single failures have cascaded across protocols.

The single most valuable habit here is reviewing and revoking token approvals periodically. Old approvals from protocols you no longer use remain live indefinitely.

Reading an Audit Correctly

An audit is a snapshot review of specific code by a specific firm, and it is routinely cited as though it were a guarantee. What to check:

QuestionWhy
Which commit was auditedDeployed code is often not the audited code
What was in scopePeripheral contracts are frequently excluded
Who performed itReputation in this field varies enormously
Were findings fixed, and re-reviewedAn audit listing unfixed criticals is a warning
WhenCode changes; an old audit describes an old system

An unaudited protocol is a clear risk. An audited one is a reduced risk, not an absent one — several audited protocols have failed since.

Gas, and Why Transactions Fail

Gas is payment for computation, and understanding it removes most beginner frustration:

  • You pay for the attempt, not the result. A reverted transaction still consumes

gas, because the work was performed.

  • The gas limit and the gas price are different things. Too low a limit causes a

failure; too low a price causes a wait.

  • Costs rise with network demand, which is why the same action costs different

amounts at different times.

  • Layer 2 networks exist largely to reduce this, with their own trade-offs — see

the Ethereum layer 2 guide.

Interacting With a Contract Safely

  1. Verify the contract address from the protocol's official documentation, never

from a search result or a message.

  1. Read what the transaction actually requests in the wallet before signing.

Unlimited approvals should be a deliberate choice.

  1. Test with a small amount on any contract you have not used.
  2. Check the protocol has been live for a meaningful period with meaningful value in

it. Time is imperfect evidence and it is evidence.

  1. Revoke approvals you no longer need, on a schedule.

Capital at risk. Smart-contract risk is not covered by any protection scheme, and what DeFi is and whether it is safe covers the wider picture.

The bottom line

Understand smart contracts as automated, unstoppable code — powerful and risky in equal measure. To buy ETH, Coinbase covers the exchange side; to interact with contracts directly you need a self-custody wallet you control, such as COCA (which uses multi-party computation instead of a single seed phrase, so read how its recovery works first). Capital at risk. This is not financial advice.

For the bigger picture, Web3 explained shows where smart contracts are actually being used in 2026, and if you move assets between Ethereum and other networks, crypto bridges explained covers the trust you take on.

Thomas Lovas Lokoy · Founder & Editor, NorwegianSpark SA

Thomas Lovas Lokoy is the founder of NorwegianSpark SA, the Norwegian company (org. 834 984 172) that runs AICryptoCoin. He oversees the business. Articles are researched and drafted with AI assistance; Thomas is responsible for what goes live. Corrections: thomaslien@norwegianspark.com.

Editorial policy · Affiliate disclosure

Content on AICryptoCoin is for informational purposes only and does not constitute financial advice. Always do your own research and consult a qualified financial advisor before making investment decisions.

Continue in this collection