Skip to main content
Back to Glossary

Smart Contract

Ethereumblog.difficulty.beginner

A smart contract is a self-executing program stored on a blockchain that automatically runs when predetermined conditions are met.

Simple Explanation

Imagine a vending machine: you put in money, select a snack, and the machine automatically gives it to you without needing a person. Smart contracts work the same way - they automatically execute actions when conditions are met, without needing a middleman.

How They Work

  1. Code is written defining the rules and consequences
  2. Deployed to blockchain where it cannot be changed
  3. Automatically executes when conditions are met
  4. Results recorded permanently on the blockchain

Example

A simple smart contract for rent: "If Alice sends 1 ETH on the 1st of every month, she can access the apartment. If she misses a payment, access is automatically revoked."