Back to Glossary
◈
Smart Contract
Ethereum•blog.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
- Code is written defining the rules and consequences
- Deployed to blockchain where it cannot be changed
- Automatically executes when conditions are met
- 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."