# Introduction to Web 3
## I don't know WTF
PPR: Pricing, Portofolio-mgmt, Risk-mgmt
Trading (金融科技聖杯) is on top of paper, not pepper
## Finance
like "時光機" or "任意門"
跟未來的自己借錢、跟遠在地球另一端的的人借錢
價值:資產、收益(預期標的物收成分潤)、便利性、安全性
## Web 3
- Web 3 is the internet owned by the builders and users, orchestrated with tokens
## Blockchain
### Seed Phrase and Key
- Mnemonic phrase (usually 12 or 24 words)
- Private key ➜ Derive public key ➜ Then derive address (e.g., 0xabc...123)
### Transaction and Signing
- The transaction, before being signed, is typically in a JSON format.
- After signing, it becomes a cryptographic signature, often represented as a hexadecimal string.
- The signed transaction is sent to a node for verification using the sender’s public key.
- The transaction enters the consensus mechanism and is permanently recorded on the blockchain.
## Wallets
### Software Wallet - MetaMask
The private key is encrypted and stored in the browser's local storage.
#### Disadvantages:
- Since the extension can access the private key and is integrated with the browser, there is a risk of leakage.
- The private key can be exposed if tricked by a phishing website and clicking a button.
- It may be vulnerable to malicious scripts being injected.
#### Advantages
- It allows convenient interaction with functions on websites.
### Web Wallet - FTX
The private key is in the company's hands.
#### Disadvantages:
- The company could go bankrupt.
- The company might misuse your funds for gambling.
- The company could be hacked.
#### Advantages:
- Access to various exchange functions like long/short trading, staking, lending, etc.
- No need to interact with underlying calls directly.
### Cold Wallet - Paper / Hardware
The private key is on a piece of paper.
#### Disadvantages:
- Requires knowledge of underlying functionality for interactions.
#### Advantages:
- Secure.
## Smart Contract Implementation
- CLI or GUI
- EOAs or Smart Contract Account
### Ethereum Gas
- 合約運行時會根據使用到的指令和空間消耗對應的 gas
- 總花費 = gas * gas price
- gas price 是浮動的,由 base fee (根據前一個區塊的壅塞程度調整) + priority fee (小費) 組成
- 因為協助驗證區塊的 validator,會根據其質押的 eth 獲得相對應獎勵,為了避免通貨膨脹,gas 中的 base fee 會被銷毀 ( burn ),priority fee 則保留給礦工作為額外收入
**Remix IDE**: https://remix.ethereum.org
## Key Perspectives: Essence & Blockchain’s 5w1h
### Essence: 金融科技區塊鏈本質 (with CS2)
金融科技區塊鏈’s essentials:
#### WHY 金融科技區塊鏈?
Decentralization: PayFi (“指東打東, 指哪打哪”): A peer-to-peer electronic cash system.
#### WHAT is it?
Ledger formed by value-yielding consensus. (If today is a small class, we’ll do a CS2 here too.)
#### HOW to do it?
Proof of work
#### WHO owns this value?
Proof of knowledge
#### WHEN to do it?
Blockchain literally means block chained after block, which is after another block etc.
Block time = ?
#### WHERE is it?
To the users, it’s where the Lightning network is.
Internet companies: User-centric and growth-hacking. vs. some crypto companies’ 90-10 rule.