Definition
Smart Contract is a program stored on a blockchain that automatically executes when predetermined conditions are met. The term was coined by cryptographer Nick Szabo in 1994.
How It Works
Simple example — a vending machine:
- You insert money (condition)
- Select an item (action)
- Machine dispenses the item (result)
A smart contract works similarly, but on blockchain:
- Condition: if payment is received
- Action: execute code
- Result: transfer tokens
Smart Contract Example
IF 1 ETH is sent to contract address
AND current date >= unlock date
THEN transfer 1 ETH to recipient address
Advantages
| Traditional Contract | Smart Contract |
|---|---|
| Requires intermediaries | Automatic |
| Can be modified | Immutable |
| Slow execution | Instant |
| Subjective interpretation | Precise code |
Smart Contract Applications
- DeFi — lending, trading, staking
- NFTs — creating and selling digital art
- Tokens — issuing cryptocurrencies (ERC-20)
- DAOs — decentralized governance
- Insurance — automatic payouts
Risks
- Code bugs — errors can lead to fund loss
- Immutability — hard to fix after deployment
- Complexity — requires security audits
Tip
Smart contracts enable staking, DeFi, and other services running on Ethereum.