Talk video(Chinese): https://vimeo.com/641650302
The blockchain introduction for frontend engineers, talk at JSDC TW 2021
In the talk, I shared what's blockchain and its taxonomy for newbies. Then, I explain how blockchain can provide a "decentralized", "unforgeable" and "immutable" p2p network.
Finally, you will learn, as frontend engs, how do you join the trend of the blockchain.
---
前端工程師也可以懂的區塊鏈, JSDC 2021
在 20 分鐘內,帶你快速了解區塊鏈是什麼,以及區塊鏈可以做到什麼?我用樸實簡單的語言帶你揭開區塊鏈神秘的面紗,最後分享作為一個前端工程師,你可以怎麼加入區塊鏈的浪潮。
2. Lucien Lee・鹿尋
2
Tech Lead
Dapps Fullstack Eng
The first Taiwanese Defi
CEO Co-founder
The largest crowdsourcing
fact-check platform in Asia
PREVIOUS
8. How to achieve that
Unforgeable
8
Public-key cryptograph
Digital Signature
9. How to achieve that
Immutable
9
Block Hash Chain
https://andersbrownworth.com/blockchain/
10. How to achieve that
Decentralized
10
Kademlia
Msg exchange
consensus
POW, POS, PBFT…
11. Example of ETH Tx
POW version
11
1. A user init an TX
2. Input Tx Info in wallet,
3. Sign TX with private key
4. Broadcast “Signed Tx” to nearby ETH node
Broadcast to
( nearby ) node
4
Creat a Tx
Steve
0x123… 0x321… ether
FROM
Dave
TO
12
AMOUNT
10
gwei
GAS PRICE
units
21,000
GAS LIMIT
Welcome to Pelith! …
INPUT DATA
Tx Signature
3
Wallet
Private Key
Steve
2
1
12. 12
State Database
SQL
BALANCE
( ether )
ADDRESS
34
16
9
Steve
Dave
W
130
X
0.7
Y
0.02
Z
9
First Miner finding out the “nonce”
Generate new block and get the ETH award
Tx Pool
Filtered by “Gas Price”
Tx
Gas Limit
Gas Price
W X 3.5
Y Z 0.7
Depoly
Contract
Call
Contract
I J 25
S D 12
21,000
21,000
21,000
500,000
120,000
21,000
11
10
10
8
8
7
Check Status
5 Join Wait List
6 Executed in EVM
8
( ≈ 2.4 TB )
Node
7
New
Block
Calculating “nonce” for block <PoW>
(Competing with other nodes)
Total Gas Limit < 8,000,000
EVM
Ether Balance Updated
Smart Contract Deployed / Called
1 Block ≤ 8M Gas
Blockchain
New
Block 8660586
Block 8660585
Block 8660584
5. Check the balance
6. Put Tx in the pool
7. Nodes keep broadcast and received new Tx
8. Nodes select more tips tx, calc and prepare
to pack them into new block
9. Mine the block
24. Why Frontend Engs are so important?
Put an elephant into refrigerator
24
Gas fee too expensive Lightweight Backend
Move user-friendly logic to FE
Isomorphic-like app
solidity <-> JS/TS
contract blockchain
TypeChain, @symfoni/hardhat-react