Skip to main content

How Ethereum smart contracts work: code that runs when called, and the gas it costs

A smart contract on Ethereum is code at its own address. It runs when an account calls it, every node runs it, and the caller pays gas.

· By ZIPMEX · 5 min read

An Ethereum smart contract is code stored at its own address. Coin Bureau's guide says an externally owned account, controlled by a private key, has to call it first, and every participating node then runs the call. The caller pays gas for that work.

Key facts, per Coin Bureau and ethereum.org

  • Account types: In the 2014 design, externally owned accounts were controlled by private keys, and contract accounts by their code.
  • Who runs a call: Every participating node executes the requested computation to verify the result.
  • Gas fee: Gas units consumed, multiplied by the gas price in gwei. One gwei is 10^-9 ETH (ether).
  • Base fee: Burned out of Ethereum's supply on successful execution.
  • Priority fee: A tip above the base fee, to incentivize validators to include the transaction in the next block.
  • Block production: Since The Merge in 2022, proof-of-stake validators propose blocks. Mining no longer produces valid blocks.
Ethereum accounts, validators and gas fees/ KEY FACTSEthereum accounts, validators and gas feesBLOCK PRODUCTIONethereum.org says proof-of-stake validators now producevalid blocks; mining no longer does.ACCOUNT TYPESThe whitepaper says there are two account types: key-heldexternally owned and code-run contract accounts.FEE FORMULACoin Bureau says gas fees equal gas units used times thecurrent gas price, measured in gwei.Source: ethereum.org; coinbureau.com
Diagram titled Ethereum accounts, validators and gas fees with three labelled facts: validators produce blocks instead of mining, Ethereum has two account types, and gas fees equal gas units times gas price.
Original ZIPMEX key-facts diagram with three facts on Ethereum block production, account types and the gas fee formula, each quoted from its cited source. data: ethereum.org (The Merge page, whitepaper); Coin Bureau, 2024-11-07 · ZIPMEX key-facts diagram; data: ethereum.org, coinbureau.com

How a call runs

According to Coin Bureau, a call starts with a transaction from an externally owned account. A contract account cannot start one on its own. Every participating node then runs the requested computation in the Ethereum Virtual Machine (EVM).

Mining is no longer the means of producing valid blocks. Instead, the proof-of-stake validators have adopted this role and are now responsible for processing the validity of all transactions and proposing blocks.
ethereum.org · Read the source

What a contract is

Coin Bureau says a deployed contract becomes a contract account with its own address that others can interact with. Ethereum's whitepaper calls contracts autonomous agents, not agreements that must be fulfilled or complied with. The original design built a programming language into the blockchain, which allowed anyone to write smart contracts and decentralized applications. In that design, the contract's code activates when its account receives a message. It reads and writes its own storage.

How contracts are written

Coin Bureau says contracts are written in Solidity, a programming language designed for the platform. In the 2014 design, contract code was low-level, stack-based bytecode, according to Ethereum's whitepaper. A university tutorial says a smart contract holds a decentralized application's business logic and reads from and writes to the Ethereum blockchain.

What the caller pays

Coin Bureau says a gas fee is the gas units a transaction uses, multiplied by the gas price in gwei. One gwei is 10^-9 ETH. Gas fees are paid to validators in ether, but the base fee is burned, as described below. The original design also required each transaction to set a limit on computational steps. That limit prevents accidental or hostile infinite loops.

Where the fee goes

Coin Bureau says the fee has two parts with different destinations. The base fee is burned out of Ethereum's supply on successful execution. The priority fee is a tip above the base fee, and users can add it to incentivize validators to include the transaction in the next block.

Where each part of a call's fee goes

Compare where each part of a call's fee goes and when it applies.

Fee partWhere the money goesWhen it appliesSource
Base feeBurned out of Ethereum's supplyOn successful executionSource: What is Ethereum? A Comprehensive Guide for 2026 (coinbureau.com), accessed Oct 19, 2026
Priority fee (tip)Validators, to include the transaction in the next blockOptional, added above the base feeSource: What is Ethereum? A Comprehensive Guide for 2026 (coinbureau.com), accessed Oct 19, 2026
Failed call, original designCaller still pays the feesFunds or gas run out, and state changes revertSource: Ethereum Whitepaper | ethereum.org (ethereum.org), accessed Oct 19, 2026

The last row describes the original design only.

Analysis: what the fee split means

Read together, these rules mean the base fee leaves the supply rather than reaching validators. The tip is the part a sender can add to encourage validators.

When a call fails

Under the original design, if a transfer fails for lack of funds, or the code runs out of gas, all state changes are reverted except the payment of the fees. Under that design, the caller still pays the fees. Current treatment of a failed call is not covered here.

What a contract cannot do

A contract cannot start itself, because an externally owned account must trigger it. An older Coin Bureau article says smart contracts on Ethereum cannot directly access information stored outside the Ethereum blockchain. It also says that once a contract is coded, changing it is practically impossible and potentially expensive.

What the sources leave out

Ethereum has changed since that whitepaper: it moved from proof-of-work to proof-of-stake in 2022. Later sections of the whitepaper, the longer Coin Bureau guide and the university tutorial are not covered here.

Next steps

A separate explainer covers how gas fees are set and split between the base fee and the tip. Check current fee levels before you budget a call.

Sources: What is Ethereum? A Comprehensive Guide for 2026 (coinbureau.com), accessed Oct 19, 2026 · Ethereum Whitepaper | ethereum.org (ethereum.org), accessed Oct 19, 2026 · The Merge | ethereum.org (ethereum.org), accessed Oct 17, 2026 · Smart Contract in Ethereum Blockchain (www3.ntu.edu.sg), accessed Oct 19, 2026 · Beginner's Guide to Smart Contracts: Everything You Need to Know (coinbureau.com), accessed Oct 19, 2026

ZIPMEX promotes trading on trade.zipmex.com. Promotions are labelled and kept separate from news coverage, which is selected and checked without regard to them. Perpetual futures are leveraged derivatives. Prices can move fast and you can lose all of your margin. Not available in every jurisdiction. Not investment advice.

Updated on Oct 20, 2026