Mastering-Ethereum.Pdf

Mastering-Ethereum.Pdf

目录 前言 .......................................................................... 1 快速术语表 ................................................................... 11 第一章 什么是以太坊? ........................................................ 25 什么是以太坊? ........................................................... 25 与比特币的对比 ........................................................... 25 区块链的组成部分 ......................................................... 25 以太坊的诞生 ............................................................. 26 以太坊的四个发展阶段 ..................................................... 27 以太坊:通用区块链 ....................................................... 29 以太坊的组件 ............................................................. 29 进一步阅读 ............................................................... 30 以太坊和图灵完备性 ....................................................... 31 从通用区块链到分散应用(DApps) .......................................... 32 互联网的第三个时代 ....................................................... 33 以太坊的发展文化 ......................................................... 33 为什么要学习以太坊? ..................................................... 34 本书将教会你什么 ......................................................... 34 第二章 以太坊基础知识 ........................................................ 35 以太坊基础知识 ........................................................... 35 以太币单位 ............................................................... 35 挑选以太坊钱包 ........................................................... 36 控制管理 ................................................................. 37 介绍全球分布式计算机 ..................................................... 46 外部账户(EOA)与合约 .................................................... 47 一个简单的合约:测试以太水龙头 ........................................... 47 编译水龙头合约 ........................................................... 49 与合约互动 ............................................................... 53 结论 ..................................................................... 59 第三章 以太坊客户端 .......................................................... 60 以太坊客户端 ............................................................. 60 以太坊网络 ............................................................... 60 运行以太坊客户端 ......................................................... 63 基于以太坊区块链的第一次同步 ............................................. 70 远程以太坊客户端 ......................................................... 74 结论 ..................................................................... 76 第四章 私钥, 地址 ............................................................ 77 密码学 ................................................................... 77 私钥, 地址 ............................................................... 77 公钥密码学以及加密货币 ................................................... 78 私钥 ..................................................................... 79 公钥 ..................................................................... 80 加密哈希函数 ............................................................. 86 以太坊地址 ............................................................... 88 第五章 钱包 .................................................................. 93 I 钱包 ..................................................................... 93 钱包技术概述 ............................................................. 93 钱包的最佳实践 ........................................................... 97 第六章 交易 ................................................................. 108 交易 .................................................................... 108 交易的结构 .............................................................. 109 nonce ................................................................... 110 交易 gas ................................................................. 115 交易接收方 .............................................................. 117 交易的数值和数据 ........................................................ 118 特殊交易:合约创建 ...................................................... 122 数字签名 ................................................................ 125 签名的前缀值 v 和公钥恢复 ................................................ 131 隔离签名和传输 .......................................................... 132 交易广播 ................................................................ 133 数据上链 ................................................................ 133 多重签名交易 ............................................................ 134 结语 .................................................................... 134 第七章 智能合约与 Solidity ................................................... 135 智能合约与 solidity ...................................................... 135 什么是智能合约? ........................................................ 135 智能合约的生命周期 ...................................................... 136 以太坊高级语言简介 ...................................................... 137 建立一个 Solidity 智能合约 ............................................... 139 以太坊合约 ABI ........................................................... 141 用 Solidity 编程 ......................................................... 143 GAS 考虑因素 ............................................................. 163 结论 .................................................................... 166 第八章 智能合约及 Vyper ..................................................... 166 智能合约及 Vyper ......................................................... 166 漏洞和 Vyper ............................................................. 166 与 Solidity 的比较 ...................................................... 167 修饰符 .................................................................. 171 函数和变量排序 .......................................................... 172 汇编 .................................................................... 173 结论 .................................................................... 174 第九章 智能合约的安全 ....................................................... 175 智能合约的安全 .......................................................... 175 安全最佳实现 ............................................................ 175 安全风险和反模式 ........................................................ 176 重入 .................................................................... 176 算术上/下溢 ............................................................. 181 异常以太 ................................................................ 186 DELEGATECALL ............................................................ 190 默认可见 ................................................................ 196 II 熵错觉 .................................................................. 199 外部合约的调用 .......................................................... 200 短地址/参数攻击 ......................................................... 206 未检查的调用返回值 ...................................................... 208 竞态条件/前运行 ......................................................... 211 拒绝服务攻击(DoS) ..................................................... 214 区块时间戳操作 .......................................................... 216 保护构造函数 ............................................................ 218 未初始化的存储指针 ...................................................... 220 浮点和精度 .............................................................. 222 Tx.Origin 验证 .......................................................... 224 合约库 .................................................................. 226 结论 .................................................................... 226 第十章 令牌 ................................................................. 227 什么是令牌 .............................................................. 227 令牌有什么用 ............................................................ 227 令牌和可替代性 .......................................................... 228 交易对手风险 ............................................................ 229 令牌及其内在机制 ........................................................ 229 令牌应用:实用性或权益性 ................................................ 229 Token 标准 .............................................................. 231 第十一章 Oracles ............................................................ 257 Oracles ................................................................. 257 为什么需要 oracles ....................................................... 257 Oracle 使用实例 ......................................................... 257 Oracle 设计模式 .......................................................... 259 数据认证 ................................................................ 261 计算 Oracles ............................................................ 262 去中心化 Oracles ........................................................ 263 Oracle 客户端基于 Solidity 的接口 ......................................... 264 总结 .................................................................... 268 第十二章 分布式应用 ......................................................... 269 分布式应用 .............................................................. 269 Web3:使用智能合约和 P2P 技术的分布式 Web ................................. 269 什么是 DApp? ............................................................ 269 后端(智能合约) ........................................................ 270 前端(Web 用户界面) ..................................................... 271 数据存储 ................................................................ 271 分散的消息通信协议 ...................................................... 271 基本 DApp 示例:拍卖 DApp ................................................. 272 DApp 治理 ............................................................... 274 以太坊名称服务(ENS) ................................................... 277 以太坊名称服务的历史 .................................................... 277 Vickrey 拍卖 ...........................................................

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    315 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us