Beyond coins: DeFi, web3 and other uses
- Lesson 3 of 4
- Crypto from scratch
- steps
- 8
- terms explained
- 7
- Your test
- Not taken yet
About this lesson
What you'll learn
Blockchains also run programs. This lesson covers smart contracts, borrowing and trading without a bank, the idea behind web3, NFTs, recording documents, and airdrops.
Terms in this lesson
- Smart contractStep 1 · Smart contracts: rules that run themselves
- DeFi and liquidationStep 2 · DeFi: borrowing without a bank
- Liquidity poolStep 3 · Pools: swapping without an exchange
- Web3Step 4 · Web3: the account stays with you
- NFTStep 5 · NFTs: tokens that have no twin
- Recording documentsStep 6 · Records and signatures
- AirdropStep 7 · Airdrops: free tokens
Smart contracts: rules that run themselves
A smart contract is a program stored on a blockchain that follows an "if this happens, do that" rule. Once it's published it runs on its own: nobody has to approve anything, and nobody can change the rule halfway through.
The idea goes back to the 1990s and computer scientist Nick Szabo, who compared such a contract to a vending machine: put the coin in, the can comes out. Ethereum, from 2015, was built to run programs like these.
Here's a crowdfunding pot. If it collects 100 ETH by Friday, the money goes to the project; if not, everyone gets theirs back. Pick how much was raised and get to Friday.
DeFi: borrowing without a bank
DeFi (decentralized finance) means financial services built from smart contracts: lending, borrowing, swapping coins. There's no bank manager and no credit check. Whoever borrows leaves collateral worth more than the loan.
If the collateral loses value and the debt gets too close to it, the contract sells part of the collateral to repay the debt and charges a penalty. That's liquidation, the same idea you'll meet in the derivatives lessons. Protocols like Aave use a limit of around 83% for ETH.
Leave 1 ETH as collateral, pick how many dollars to borrow, then move ETH's price.
Pools: swapping without an exchange
On a regular exchange, buyers meet sellers in an order book. On a decentralized exchange, like Uniswap from 2018, you trade with a liquidity pool: a contract that holds two coins, here ETH and USDC.
The pool sets the price from what it holds. Every ETH that leaves makes the next one more expensive, so a big purchase pays a worse average price. People who deposit coins in the pool get a share of the fees on every swap.
Drag the size of the purchase and watch the price climb.
Web3: the account stays with you
The internet of the 1990s, web1, was mostly for reading. Web2 brought social networks and apps: you post, but the account and what's in it belong to the platform.
Web3 is the name for apps you sign into with your wallet, where your tokens and items are recorded on the blockchain, outside the app's control. Gavin Wood, one of Ethereum's creators, used the term this way in 2014. Web3 is still small next to web2, and many projects with the name didn't take off.
Switch eras and see what happens when the platform closes your account.
NFTs: tokens that have no twin
One bitcoin is worth the same as any other, just as one $10 bill is worth another $10 bill. That's being fungible. A ticket with a numbered seat is different: swapping yours for someone else's changes where you sit.
An NFT (non-fungible token) is a one-of-a-kind token recorded on the blockchain, with its own number and an owner. It's used for digital art, tickets and game items. The image almost always lives on a server outside the blockchain, and the NFT stores a link to it.
NFTs boomed in 2021, when a digital work by the artist Beeple sold for $69 million, and trading volume collapsed over 2022. Swap the items with Bia in both cases.
Records and signatures
A blockchain can also work like a notary. You work out a document's fingerprint, the same idea as the blocks in the first lesson, and record only that fingerprint in a transaction. The document stays with you.
Later, anyone can check: if the file's fingerprint matches the recorded one, the text already existed on that date and hasn't changed since. That doesn't prove what it says is true. To prove who signed, the person signs with their wallet's key, and anyone can check it against their public address.
The same idea works for diplomas, tickets and tracking cargo. Change any letter in the contract.
Airdrops: free tokens
An airdrop is when a project hands out tokens for free, usually to people who used its app before a certain date. One of the best known was Uniswap's, in September 2020: anyone who had already made a swap there got at least 400 UNI.
Many people sell what they got right away, and the price often drops in the first days. The chart is a simulated launch, not Uniswap's.
Watch out for fake airdrops. A site that asks you to "connect your wallet and sign" to receive tokens may be asking for permission to take your coins. Pick the day you sell.
Test what you learned
Three quick questions, then a loan.
You leave 1 ETH as collateral and borrow dollars to get through a week you haven't seen. Borrow at least $1,500 without being liquidated.
These lessons explain what each number measures. They are not trading advice, and the lesson charts use simulated data. Preview build: market data on this site is simulated.