区块链2.0:Ethereum

吴克坤

区块链2.0:Ethereum

  • 以太坊区块链
  • 智能合约与去中心化应用
  • 通证/代币

以太坊(Ethereum)是什么?

以太坊是新互联网时代的基础设施:

  • 内置货币和支付的互联网。

  • 用户可以拥有自己数据的互联网,应用程序不会监视和窃取用户的数据。

  • 每个人都可以访问开放金融系统的互联网。

  • 建立在中立、开放访问基础设施之上、不受任何公司或个人控制的互联网。

白皮书

  • 以太坊愿景:以太坊旨在创建一个下一代智能合约和去中心化应用平台,提供一个内置图灵完备编程语言的区块链,允许用户创建任意状态转换函数。

  • 比特币及现有概念:白皮书首先回顾了比特币的发展和其作为分布式共识工具的区块链技术,以及早期的去中心化数字货币和财产登记等应用。

  • 状态转换系统:比特币被视为一个状态转换系统,其中状态由所有现存比特币的所有权状态组成,状态转换函数以状态和交易为输入并输出新状态。

  • 挖矿:在去中心化系统中,挖矿是确保交易顺序和网络共识的重要机制。以太坊的挖矿机制包括工作量证明和权益证明。

  • 默克尔树:默克尔树是一种数据结构,允许区块数据可以零散地传送,同时确保数据的完整性。

  • 区块链应用:白皮书讨论了区块链技术在其他领域的潜在应用,如域名币、彩色币和元币。

  • 以太坊账户:以太坊中的账户分为外部账户和合约账户,状态转换涉及账户之间价值和信息的转移。

  • 消息和交易:以太坊中的交易是已签名的数据包,存储着将要从外部账户发送的消息。

  • 状态转换函数:以太坊的状态转换函数定义了如何处理交易和消息,以及如何更新全局状态。

  • 代码执行:以太坊合约中的代码用一种基于堆栈的低级字节码语言编写,被称为“以太坊虚拟机代码”或“EVM 代码”。

  • 区块链和挖矿:以太坊区块链在许多方面与比特币区块链相似,但也有其独特的特点,如包含交易列表和最新状态的副本。

  • 应用:以太坊可以应用于多种场景,包括金融应用、半金融应用和非金融应用。

  • 代币系统:在以太坊中实现代币系统相对简单,可以用于创建子货币、金融衍生品等。

  • 身份和信誉系统:以太坊可以用于建立身份和信誉系统,类似于域名币的名称注册系统。

  • 去中心化文件存储:以太坊合约可以促进去中心化文件存储生态系统的发展。

  • 去中心化自治组织:以太坊可以用于创建去中心化自治组织,这些组织通过成员的集体决策来管理。

  • 改进版GHOST协议:以太坊实现了改进版的GHOST协议,以减少中心化风险并提高网络安全。

  • 费用:以太坊需要一种机制来防止区块链滥用,通常涉及交易费。

  • 计算和图灵完备:以太坊虚拟机是图灵完备的,可以执行任何可执行的计算。

  • 货币和发行:以太坊有内置货币以太币,用于支付交易费和作为流动资金层。

  • 挖矿中心化:以太坊旨在通过其挖矿算法减少中心化风险。

  • 可扩展性:以太坊面临着与比特币类似的可扩展性问题,但有一些策略来缓解这些问题。

  • 结论:以太坊协议不仅仅是一个加密货币,它是一个开放式的平台,适用于各种金融和非金融协议。

Ethereum’s Four Stages of Development

以太坊的发展计划分为四个不同的阶段,每个阶段都会发生重大变化。 一个阶段可能包括子版本,称为“硬分叉”,它以不向后兼容的方式更改功能。

四个主要发展阶段的代号分别为“Frontier”、“Homestead”、“Metropolis”和“Serenity”。 迄今为止已经发生(或计划)的中间硬分叉的代号为 Ice Age、DAO、Tangerine Whistle、Spurious Dragon、Byzantium 和 Constantinople。

Ethereum’s Components

In Ethereum, the components of a blockchain system described in Components of a Blockchain are, more specifically:

  • P2P network (P2P网络)

    • Ethereum runs on the Ethereum main network, which is addressable on TCP port 30303, and runs a protocol called ÐΞVp2p.
  • Consensus rules (共识规则)

    • Ethereum’s consensus rules are defined in the reference specification, the Yellow Paper.
  • Transactions (交易)

    • Ethereum transactions are network messages that include (among other things) a sender, recipient, value, and data payload.
  • State machine (状态机)

    • Ethereum state transitions are processed by the Ethereum Virtual Machine (EVM), a stack-based virtual machine that executes bytecode (machine-language instructions). EVM programs, called "smart contracts," are written in high-level languages (e.g., Solidity) and compiled to bytecode for execution on the EVM.
  • Data structures (数据结构)

    • Ethereum’s state is stored locally on each node as a database (usually Google’s LevelDB), which contains the transactions and system state in a serialized hashed data structure called a Merkle Patricia Tree.
  • Consensus algorithm (共识算法)

    • Ethereum uses Bitcoin’s consensus model, Nakamoto Consensus, which uses sequential single-signature blocks, weighted in importance by PoW to determine the longest chain and therefore the current state. However, there are plans to move to a PoS weighted voting system, codenamed Casper, in the near future.
  • Economic security (经济安全)

    • Ethereum currently uses a PoW algorithm called Ethash, but this will eventually be dropped with the move to PoS at some point in the future.
  • Clients (客户端)

    • Ethereum has several interoperable implementations of the client software, the most prominent of which are Go-Ethereum (Geth) and Parity.

DApps and Token Economy

  • 以太坊是一个用于创建存储在区块链中的智能合约的去中心化平台。 以太坊虚拟机是托管这些合约的隔离运行时环境。 以太坊的网络基础设施使用加密货币以太来促进交易。

  • 智能合约是经过编码的程序,一旦满足预定义的条件,即可自动控制两方或多方之间的资产转移。 它们旨在安全、透明地促进资产交换,无需中间人。

智能合约与去中心化应用

DApp

  • 一个DApp至少由以下部分组成:

    • 区块链上的智能合约

    • 网络前端用户界面

  • 此外,许多 DApp 还包含其他去中心化组件,例如:

    • 去中心化(P2P)存储协议和平台

    • 去中心化(P2P)消息传递协议和平台

智能合约的用途

Distributed Autonomous Organization (DAO)

The DAO and the DAO hack

DAO 在 2016 年 5 月期间筹集了 1.5 亿美元的 ETH。2016 年 6 月 17 日,DAO 遭到黑客攻击,他利用递归调用漏洞窃取了 5000 万美元。

ICO流程

Tokensales

ICO融资规模

不同类的代币/通证

全球数字货币排名(2021)

排名 数字货币 总市值
1 Bitcoin 126,387,557,616
2 Ethereum 17,502,341,386
3 XRP 8,302,309,107
4 Tether 6,370,220,958
5 Bitcoin Cash 4,144,031,574
6 Bitcoin SV 3,515,738,866
7 Litecoin 2,673,016,498
8 Binance Coin 2,443,269,109
9 EOS 2,270,807,037
10 Tezos 1,375,470,401

全球数字货币交易所排名(2021)

排名 数字货币交易所 成交量
1 Bitfinex 49,230,727
2 HitBTC 46,356,768
3 Binance 42,345,655
4 Huobi Global 38,795,263
5 Kraken 24,655,403
6 ZB.COM 20,941,182
7 Folgory 17,235,333
8 BW.com 15,777,310
9 OKEx 13,677,201
10 Huobi Russia 12,526,382

数字货币的分类