关于本课程
- 主讲人:李叔禄
- 以Ethereum为例,生态最好的公链
- 采用自顶向下方法
- 区块链应用
- Solidity代码
- 以太坊源码
- p2p协议
- 不仅是传递知识,更是传递思维
- 本次思维:封装
- 希望招募同学来共同构建课程
密码学
Hash
任意长度的二进制字节→固定长度的字符串
- preimage resistance
- given y, you can’t find any x such that hash(x) == y
- 2nd preimage resistance
- given x, y, such that hash(x) == y, can’t find x’ ≠ x, where hash(x’)==y
- collision resistance ( harder )
- nobody can find any x, z such that x ≠ z, where hash(x) == hash(z)
ECC: Elliptic Curve Cryptography
- Private Key → Public Key
- Sign(Message, Private Key) → Signature
- Verify(Message, Signature, Public Key) → True or False
Elliptic Curve
- a line will intersect with Elliptic curve on 3 points
- A + B, A * b, A / b ✅
- A * B, A + b ❌
- traits of elliptic curve remain when modulo
Secp256k1
Where the name comes from
- Sec: Standards For Efficient Cryptography
- 256: length of p
- p: the mod factor
- k: inventor of ECC Koblitz, here meaning a selected set of curves
- 1:
- is a prime number
- 30% more performant than unoptimized curves
PKC
: generator point, 32 byte x coord, 32 byte y coord = 64 B ⇒ 32B x coord + 1 bit
: private key. 256 bit scalar
: public key.
Signature
- Signing:
- user has private key , now generate random secret (32 bytes)
- Verify: Verifier receives (message), (public key which eq ), &
- Security:
can’t calculate because R is one-way
钱包
什么是钱包?
- 个人认为,更好的词汇是“私钥保险库”
- 保管你的私钥
Metamask
- 注意安装包的来源!
Claim Your ETH
区块链网络
- Ethereum Mainnet
- Goerli Test Net
- Ropsten: Deprecated
- Polygon
- Avalanche
- …
转账
Gas Fee
- 为什么需要 Gas Fee?
- 最简单的理解方式:免费的网络,服务器的账单谁来付?
Transaction
- State → Transaction → State
- Pending… waiting for the block to be confirmed
- FrontRunning: The Dark Forest
ENS
Ethereum Naming Service
- Domain Naming Service
- String → Address
Register Your ENS
Etherscan
最后:怎么进一步学习
- Discord:https://discord.gg/2NF4mb2h
- 关注我们的微信公众号:零知识大学习
- 关注协会的官网: