---
eip: 2982
label: EIP-2982
title: Serenity Phase 0
status: Final
type: Informational
created: 2020-09-15
official: https://eips.ethereum.org/EIPS/eip-2982
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2982.md
canonical: https://eips.huatuo.xyz/zh/eip-2982/
lang: zh
tldr: 记录 eth2 第 0 阶段的信息类 EIP：在工作量证明的以太坊之外并行启动权益证明的信标链，验证者通过主网上的存款合约加入。
tags: [proof-of-stake, beacon-chain, consensus, staking, informational]
---

# EIP-2982: Serenity Phase 0

> Phase 0 of the release schedule of Serenity, a series of updates to Ethereum a scalable, proof-of-stake consensus

**TL;DR:** 记录 eth2 第 0 阶段的信息类 EIP：在工作量证明的以太坊之外并行启动权益证明的信标链，验证者通过主网上的存款合约加入。

## 它解决什么问题？

到 2020 年，以太坊的区块持续处于满载状态，其工作量证明共识耗能巨大，也不提供经济终局性。长期计划（“Serenity”，即 eth2）是转向权益证明并加入分片，但在运行中的网络上一步切换共识是危险的。

第 0 阶段是第一步，且不破坏兼容性：并行构建一条新的权益证明链，即**信标链**，让它运行并稳定下来，之后才让它来保护以太坊本身。EIP-2982 在 EIP 一侧记录了这一计划及其关键参数；详细规则位于独立的 consensus-specs 仓库的 `v1.0.0` 版本中。

## 它如何运作

- **存款合约。**用户向主网上位于 `0x00000000219ab540356cBB839Cbe05303d7705Fa` 的存款合约发送 ETH 来加入。信标链就该合约的状态达成一致，并处理新的存款。在第 0 阶段，这种单向的存款流是两条链之间唯一的联系；工作量证明的以太坊没有任何改动。
- **验证者。**存款会指明一个 BLS 公钥、提款凭证和金额。验证者提议并证明信标区块，做得好会获得奖励，离线则会受到惩罚。标准的验证者规模是 32 ETH。
- **共识。**Casper FFG 提供终局性；LMD-GHOST 是分叉选择规则。BLS 签名聚合让验证者数量很多时的消息量保持在可控范围内。
- **发行。**奖励与质押 ETH 总量的平方根成比例（`BASE_REWARD_FACTOR = 64`），因此质押的 ETH 越多，每个验证者的收益越低。
- **惩罚。***不活跃泄漏*会在长时间没有终局性时消耗离线验证者的余额，*罚没（slashing）*则惩罚可证明的恶意消息，当许多验证者同时被罚没时惩罚会加重。第 0 阶段启动时，这些惩罚被有意设置得比预期的最终值更轻。
- **队列。**激活和退出按每个 epoch 限速，使验证者集合不会变化得太快。

第 0 阶段没有转账、智能合约或提款；这些计划在后续阶段加入。

## 示例代码

信标链存款就是对存款合约的一次普通调用（ethers v6）。数据来自 `staking-deposit-cli` 之类的存款工具：

```ts
import { Contract, Wallet, JsonRpcProvider, parseEther } from "ethers";

const depositContract = new Contract(
  "0x00000000219ab540356cBB839Cbe05303d7705Fa",
  ["function deposit(bytes pubkey, bytes withdrawal_credentials, bytes signature, bytes32 deposit_data_root) payable"],
  new Wallet(process.env.PRIVATE_KEY!, new JsonRpcProvider(process.env.RPC_URL)),
);

// one entry from deposit_data-*.json (hex strings without 0x)
declare const d: { pubkey: string; withdrawal_credentials: string; signature: string; deposit_data_root: string };

const tx = await depositContract.deposit(
  "0x" + d.pubkey,
  "0x" + d.withdrawal_credentials,
  "0x" + d.signature,
  "0x" + d.deposit_data_root,
  { value: parseEther("32") },
);
await tx.wait();
```

## 需要注意

- 这里描述的路线图已经改变。执行层分片（“第 1/2 阶段”）被放弃，转向以 rollup 为中心的设计，工作量证明的以太坊是通过合并（The Merge，[EIP-3675](/eip-3675/)）加入信标链的，而不是作为一个分片。
- 被描述为未来工作的提款随 [EIP-4895](/eip-4895/) 到来；[EIP-7251](/eip-7251/) 后来把最大有效余额提高到了 32 ETH 以上。
- 验证者密钥通常使用 [ERC-2334](/eip-2334/) 中的路径派生。
- 向存款合约发送 ETH 是不可逆的。只使用可信存款工具生成的数据，并再三核对提款凭证。


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-2982
