Blockchain & Cryptocurrency

Lesson 7 of 8

Smart Contracts & NFTs

Code that runs on the blockchain, what NFTs really are, and how to separate real uses from hype.

🟡 Intermediate 50 XP

Learn it

A smart contract is a program stored on a blockchain that runs exactly as written: 'if this happens, do that' — with no company in the middle able to change the deal.

Ethereum made this famous: its blockchain doesn't just record payments, it runs programs. Apps built on it are called dapps (decentralised apps).

An NFT (non-fungible token) is a blockchain record proving you own a unique token — often linked to digital art. You own the token, not necessarily the copyright or the only copy of the image.

The hard truth about both: code can have bugs (and blockchain code can't be patched once deployed), and hype can push prices of tokens far above any real value.

Key terms

Smart contract
A program stored on a blockchain that runs exactly as written.
Dapp
A decentralised app built on smart contracts.
NFT
A unique blockchain token proving ownership of a specific item or record.
DeFi
Decentralised finance — lending and trading run by smart contracts.
Gas
The fee paid to the network to run a transaction or contract.

Hype detector

  1. 1Read a contract: Read this pseudocode: IF a buyer sends the price, THEN transfer the token to the buyer. What job that a company normally does has the code replaced?
  2. 2Investigate an NFT claim: Find a news story about a famous NFT sale. What did the buyer actually receive — the image, the copyright, or a token?
  3. 3Apply the test: For one real dapp or NFT project, answer: what does it do, who controls it, what if the code has a bug, would a database work better?

A vending machine is a smart contract

textVENDING MACHINE (physical smart contract)
  IF coins inserted >= price
  AND item in stock
  THEN release item + return change
  No shopkeeper needed; rules can't be bent

BLOCKCHAIN SMART CONTRACT
  IF buyer sends 0.5 ETH
  THEN transfer token #4721 to buyer
  No marketplace company needed
  ...but a bug in the code is law too

Smart contracts automate agreements the way vending machines automate shops. The catch: a vending machine with a design flaw gives away free drinks forever — and a buggy contract gives away money.

Try it

True or false?

A smart contract runs exactly as its code says.

Buying an NFT usually means you own the copyright to the artwork.

Bugs in deployed smart contracts have cost users hundreds of millions of dollars.

Smart contracts can easily be patched after deployment.

An NFT image always lives on the blockchain itself.

Challenge

A celebrity launches an NFT collection and your friend wants to spend their savings on one. Write them an honest message covering: what they would actually own (and not own), three questions they should ask about the project, the risks (bugs, hype, rug pulls, volatility), and your advice. Be respectful — your job is to inform, not to mock.

Pick whichever way suits you — every mode earns the same bonus XP.

Write at least 40 more characters to submit.

Mark your own work

Guided walkthrough — 0/2 clues revealed

  1. Clue 1 locked — reveal it only if you get stuck.
  2. Clue 2 locked — reveal it only if you get stuck.

Each clue costs 3 XP (never below 13 XP). You'd earn 25 XP right now.

Quiz time

Question 1 of 3Score 0

What is a smart contract?

Sources & further reading

Connected courses