3. DApp example: class voting system
- Teacher is the host and can create new proposals with some
description
- Students are participants, the list is pre-defined, and can vote for
‘agree’ or ‘disagree’ for each proposal
- Each of the participants can vote for each proposal only once
4. Traditional approach
- Server defines API for creating, querying and voting proposals
- Hardcoded teacher account to verify for creating proposals
- Hardcoded student accounts to verify for voting proposals
- Server ensures that no one can vote the same proposal twice
- A web frontend
5. Traditional approach
- Server defines API for creating, querying and voting proposals
- Hardcoded teacher account to verify for creating proposals
- Hardcoded student accounts to verify for voting proposals
- Server ensures that no one can vote the same proposal twice
- A web frontend
Smart contract
Smart contract
address
address
DApp
Still need this
6. Some concepts
- Private Key: a secret stored by the user for signing transactions and
proving user’s identity
- Ethereum Address: user’s identifier derived from private key
- Smart Contract: code that executes on blockchain, plus storage
Or in other words:
- Private Key: password for blockchain
- Ethereum Address: username for blockchain
- Smart Contract: program for blockchain
7. How does an Ethereum DApp work
Browser
Your app’s
execution
environment
Your code
MetaMask
extension
Private Key(s)
①
②
③
④
smart
contract
Ethereum
Blockchain