Ethereum

Ethereum Basics: Smart Contracts, Gas Fees and Proof of Stake

If Bitcoin is digital gold, Ethereum is a world computer. Learn how smart contracts work, why gas fees swing so wildly and what changed after the Merge.

Ever sent ETH and wondered why the fee was a few cents one day and twenty dollars the next? Or heard people talk about "staking" and "Layer 2" and nodded along?

Here's the one-sentence version: Bitcoin is a ledger that records payments; Ethereum is a computer that runs programs. Everything else (DeFi, NFTs, stablecoins, gas fees) follows from that idea.

Key takeaways

  • Ethereum launched in July 2015 with one big idea: a blockchain you can program.
  • Smart contracts are programs that run on-chain exactly as written. Most of crypto is built on them.
  • Every computation costs gas, and the price moves with network demand.
  • Since the Merge in September 2022, Ethereum runs on proof of stake and uses about 99.95% less energy.
  • Most everyday activity is moving to cheaper Layer 2 networks.

How is Ethereum different from Bitcoin?

In 2013, a 19-year-old programmer named Vitalik Buterin asked a simple question: if a blockchain can track who paid whom, why can't it run more complex rules too? His answer became Ethereum, which went live on July 30, 2015.

BitcoinEthereum
PurposePeer-to-peer cash, store of valuePlatform for decentralized applications
ConsensusProof of workProof of stake (since 2022)
Block timeAbout 10 minutesAbout 12 seconds
SupplyCapped at 21 millionNo fixed cap; some fees are burned
Main usesPayments, savingsDeFi, NFTs, stablecoins, on-chain apps

What is a smart contract?

The classic analogy is a vending machine. Put in the right coins, press a button, and your snack drops. No cashier, no negotiation; the rules are built into the machine and apply to everyone equally.

A smart contract is a vending machine made of code, living on the blockchain. Its logic is public, it runs automatically when conditions are met, and nobody (not even the developer) can step in and change the outcome mid-way. Decentralized exchanges, lending markets, NFTs and stablecoins are all built from smart contracts.

Smart contracts are on-chain programs that run by fixed rules, and every step of computation costs gas
Smart contracts are on-chain programs that run by fixed rules, and every step of computation costs gas

But "runs automatically" doesn't mean "risk-free." Code is written by people, and people make mistakes. In 2016, a bug in a project called The DAO let an attacker drain about 3.6 million ETH. The fallout split the community in two, which is why both Ethereum (ETH) and Ethereum Classic (ETC) exist today. On-chain transactions usually can't be reversed, so be careful which contracts you interact with.

Where do gas fees come from?

Every action on Ethereum (sending ETH, swapping tokens, minting an NFT) uses computing power, measured in gas. Think of it like fuel for a road trip: a longer, twistier route burns more fuel, and the price at the pump decides what you pay.

The fee for a transaction is roughly:

gas used × (base fee + priority fee)

  • Gas used depends on complexity. A plain ETH transfer always uses 21,000 gas; a complex DeFi interaction can use hundreds of thousands.
  • The base fee adjusts automatically with network congestion. Since the EIP-1559 upgrade in August 2021, the base fee is burned rather than paid to block producers.
  • The priority fee is a tip to validators to get your transaction included faster.

Gas prices are quoted in gwei, where 1 gwei = 0.000000001 ETH. Here's a worked example:

ItemValue
Gas for a simple ETH transfer21,000 gas
Base fee + priority fee20 + 2 = 22 gwei
Total fee21,000 × 22 = 462,000 gwei ≈ 0.000462 ETH
At an ETH price of $2,500About $1.16

When the network gets busy (a hyped mint, a market crash), the base fee can multiply within minutes. To save on gas: wait out busy periods if it isn't urgent, trust your wallet's estimate instead of cranking the fee up, and use a Layer 2 for small, everyday transactions.

From proof of work to proof of stake

On September 15, 2022, Ethereum completed the Merge, switching from proof of work to proof of stake and cutting the network's energy use by roughly 99.95%. It was the biggest upgrade in Ethereum's history.

Validators stake ETH to secure the main chain, while Layer 2 networks batch transactions and settle them back on it
Validators stake ETH to secure the main chain, while Layer 2 networks batch transactions and settle them back on it

Miners were replaced by validators. To run one, you lock up 32 ETH as a security deposit:

  • Do the job honestly and you earn ETH rewards.
  • Go offline and you lose some of those rewards.
  • Cheat (for example, by signing two conflicting blocks) and part of your stake can be slashed before you're forced out.

Instead of burning electricity, attackers now put their own money on the line. The Shanghai upgrade in April 2023 enabled withdrawals, so stakers can now exit and reclaim their ETH under the protocol's rules.

Don't have 32 ETH? You can stake through an exchange or a liquid staking protocol. Just know what you're signing up for: custody risk, smart contract risk and withdrawal queues. Advertised yields also move with how much ETH is staked network-wide. They aren't fixed interest rates.

Layer 2: cheaper and faster Ethereum

Ethereum's main chain can only process so many transactions per second, and when demand spikes, fees soar. The fix is Layer 2: networks that execute transactions off the main chain, compress the results and post them back to Ethereum, which still guarantees final security.

TypeHow it worksExamplesTrade-offs
Optimistic rollupsAssume transactions are valid; allow a challenge period for fraud proofsArbitrum, Optimism, BaseMature ecosystems; withdrawing via the official bridge usually takes about 7 days
ZK rollupsProve every batch is correct with zero-knowledge proofszkSync, Starknet, Linea, ScrollFaster withdrawals; more complex technology

The Dencun upgrade in March 2024 introduced EIP-4844 ("blobs"), which slashed the cost of posting Layer 2 data to Ethereum. Transfers on many Layer 2s now cost a few cents or less.

One caveat: moving assets between networks means using a bridge, and bridges have been among the most hacked targets in crypto. Stick to official bridges or well-established options, and always double-check you've picked the right network before you hit send.

FAQ

Is ETH the same as Ethereum?

Ethereum is the network; ETH is its native currency, used to pay gas fees and to stake. People use the names interchangeably in everyday conversation.

My transaction failed. Why was I still charged?

Validators still spent computing resources trying to run it. Transactions usually fail because the gas limit was too low or a contract condition wasn't met, and the gas used isn't refunded.

Does Ethereum have a supply cap?

No. Proof of stake issues a small amount of new ETH as rewards, while EIP-1559 burns part of every fee. When the network is busy, more ETH gets burned, so supply can rise or fall over time.

I sent tokens on the wrong network. Are they gone?

If you control the private key for that address (for example, a self-custody wallet), you can usually recover them by connecting to the right network. If you sent them to an exchange on an unsupported network, contact its support team. Whether they can help depends on the exchange.

Summary

Ethereum boils down to three ideas: smart contracts let the blockchain run programs, gas puts a price on every step of computation, and proof of stake secures the network with staked ETH instead of electricity. Add Layer 2 scaling, and you have the foundation for most of what happens on-chain today.

Ready for the next step? Read our DeFi guide to see how these pieces come together into decentralized exchanges and lending markets. This article is for education only and isn't investment advice.

Related reading