EigenLayer学习

Ref

Github: eigenlayer-contracts/docs/EigenLayer-tech-spec.md

官方doc: https://docs.eigenlayer.xyz/overview/readme

[登链] 2023/04/28期:深度解析以太坊质押和LSD(文字整理版): https://learnblockchain.cn/article/5740

[登链] 深入了解再质押(Restaking):EigenLayer https://learnblockchain.cn/article/5732

详解 EigenLayer:通过“再质押”扩展以太坊信任层: https://new.qq.com/rain/a/20230404A02TU700

What is EigenLayer?

EigenLayer is a set of smart contracts on Ethereum that allows consensus layer Ether (ETH) stakers to opt in to validating new software modules built on top of the Ethereum ecosystem.

Ethereum 提出了新的信任模组化创新,使得开发DApps 不再需要重新打造一个去中心化网路。可以直接使用在Ethereum 网路所提供的信任。

Ethereum 只提供区块生成层面的信任,Middlewares 无法利用Ethereum 的信任机制来打造更广泛的去中心化服务。Middlewares 仍需另外打造自己的信任网路(AVS),这中间的主要成本来自维持网路安全的经济模型。

EigenLayer 是一个平台,旨在探讨Liquid Staking Derivatives 板块,并提供更安全、更可靠的去中心化服务。其核心概念是Restaking,即让同一份资金可以质押在不同的信任网路,来担保不同信任网路的安全性。

Pooled Security via Restaking 可以让质押者获得更多收益,同时也降低了维持DApp 安全性的成本。透过Restaking,质押者可以用同一份资金质押到不同的信任网路,担任不同的网路的验证者来获得验证奖励。而对于中介服务(Middlewares)来说,Restaking 也能够让建立信任网路的门槛大幅降低,使其能够继承Ethereum 网路部分或全部的信任(资金)。

Free-market governance 则建立一个开放市场的自由机制。透过这种机制,Stakers 能根据收益和风险来决定要质押的对象。Middlewares 能够根据自己的需求限制Staker 来保证自身网路的安全性。

EigenLayer 创新也带来一些额外的问题和风险,例如Operator collusion 和Unintended Slashing。面对这些问题我们仍需要根据不同的使用场景采用不同的手段来解决。

Incentive

Reward:
在Ethereum上质押本身带来的收益
再质押到Dapp上带来的收益
(如果选择了代理,可能要考虑代理的分红问题,这个eigenlayer中不涉及设计,如果自己是自己的operator,那么应该没有这个问题)
Developers choose for themselves which tokens to accept as stake for their AVS. They may also choose whether there is preferential weighting for rewards they distribute to different types of staked tokens. (来自白皮书)

Punishment:
EigenLayer有Slashing机制,Slashing机制还有风险规避(诚实节点被slash)机制,但机制比较简单

提供的再质押选项

As shown in Fig. 5b, EigenLayer provides multiple pathways for yield stacking which allow stakers to earn additional yield from securing new AVSs. Broadly we can think of three distinct layers of the blockchain: core protocol, AVS, and DeFi. Liquid staking can be thought of as stacking yield by first going to the core protocol and then the DeFi layer. Superfluid staking can be thought of as first going through the DeFi layer before going to the core protocol layer. In EigenLayer, there can be several modalities of restaking:

  1. Native restaking. Validators can restake their staked ETH natively by pointing their withdrawal credentials to the EigenLayer contracts. This is equivalent to L1 → EigenLayer yield stacking.
  2. LST restaking. Validators can restake by staking their LSTs, ETH already restaked via protocols like Lido and Rocket Pool, by transferring their LSDs into the EigenLayer smart contracts. This is equivalent to DeFi → EigenLayer yield stacking.
  3. ETH LP restaking. Validators stake the LP token of a pair which includes ETH. This is equivalent to DeFi → EL yield stacking.
  4. LST LP restaking. Validators stake the LP token of a pair which includes a liquid staking ETH token, such as Curve’s stETH-ETH LP token, thus taking the L1 → DeFi → EL yield stacking
    route.

EigenLayer Delegation

Solo Staking: In this model, solo stakers, who are natively restaked, have two options for participating in EigenLayer: (1) solo stakers can can opt in to AVSs on EigenLayer for which they can provide validation services directly; or (2) solo stakers can delegate EigenLayer operations to a different entity, while continuing to validate for Ethereum themselves. This latter option allows for home stakers with non-upgradeable / lightweight setups to continue contributing decentralization and censorship resistance to Ethereum (as well as not sharing the core Ethereum yield with any operator), while receiving additional rewards through EigenLayer via delegation to another operator. We envision that there will be many services built on EigenLayer that are designed to be lightweight, and suitable for home stakers who do not want to delegate their stake to another operator. For example, consider a decentralized price oracle, which is computationally easy to run, but requires high trust.

Delegation Model: The delegation model in EigenLayer requires that delegate their stake to an operator. If their operator doesn’t fulfill its obligations in the EigenLayer modules that it is participating in, then their deposited stake will be subject to slashing. Restakers who have delegated their stake with this operator will be slashed too. Hence, EigenLayer restakers should only delegate to trusted operators who have a track record of successfully fulfilling their obligations. There are no incentives built into EigenLayer for delegating, but is possible for others to build innovative delegation frameworks on top of EigenLayer.

Fee model: In addition, EigenLayer restakers need to take into consideration the ratio of fees that operators share back to delegators. Given that there will be many operators to which a restaker can delegate its ETH or LSTs, this will organically give rise to a free market of delegation between restakers and operators in EigenLayer. Each EigenLayer operator will put up a delegation contract on Ethereum that specifies how fees would be split back to delegators, and that delegation contract will route fees accordingly.

风险管理

EigenLayer 中存在两类风险:

  • 许多运营商可能串通同时攻击一组 AVS;
  • AVS 可能存在非预期的罚没漏洞(slashing vulnerabilities),如诚实节点可能被罚没。

运营商串通

在现实中,只有一部分运营商选择加入给定的 AVS,其中一些运营商可能串通从一组 AVS 中窃取资金,然后会出现复杂的攻击。

  • 一种解决方案是限制任何特定 AVS 的破坏收益。这个解决方案取决于那些 AVS 的设计者。 例如,
  • 桥可以限制罚没周期内的价值流动,
  • 预言机可以限制该周期内交易的总价值,等等。
  • 另一个解决方案是 EigenLayer 可以主动增加 AVS 的破坏成本。EigenLayer 创建一个开源的仪表板,构建在 EigenLayer 上的 AVS 可以监控参与其验证任务的一组运营商是否也在许多其他 AVS 中再质押。 AVS 可以在其合约中制定规范,仅激励参与少量 AVS 的 EigenLayer 运营商。

意外罚没

在 AVS 及其相关基础设施和合约经过实际测试之前,许多罚没风险需要控制以避免产生更大的叠加风险。 一种风险是 AVS 创建时的意外罚没漏洞(例如,代码 bug),这种漏洞一旦触发会导致诚实运营商损失资金。

我们在这里提出两条解决方案:

  • 安全审计:必须像审计智能合约一样审计 AVS 代码库。
  • 对罚没的一票否决能力(veto):EigenLayer 中有一个治理层,其主要由以太坊和 EigenLayer 社区的重要成员组成,它有能力通过多重签名否决罚没决定。

Github项目的学习

一些definition

Stakers
A staker is any party who has assets deposited into EigenLayer. In general, these could be any mix of ERC20 tokens and/or staked ETH itself (deposited by transferring withdrawal credentials to EigenLayer or depositing to the Beacon Chain through EigenLayer). Stakers can delegate their stake to an operator, or act as an operator themselves.

Operators
Operators in EigenLayer are those users who actually run the software built on top of EigenLayer. Operators register in EigenLayer, allowing stakers to delegate to them, and then opt-in to any mix of services built on top of EigenLayer; each service that an operator chooses to serve may impose its own slashing conditions on the operator.

Watchers
NOTE: at present, EigenLayer does not feature any optimistically rolled up claims. This paragraph reflects a potential future state of the system.

Some operations in EigenLayer are “optimistically rolled up”. This is a design pattern used where it is either impossible or infeasible to prove that some claim is true, but easy to check a counterexample that proves the claim is false. The general pattern is:

  • A “rolled-up” claim is made, asserting that some condition is true.
  • There is a “fraudproof period”, during which anyone can disprove the claim with a single counterexample. If a claim is disproven, then the original claimant is punished in some way (e.g. by forfeiting some amount or being slashed).
  • If the claim is not disproved during the fraudproof period, then it is assumed to be true, and the system proceeds from this assumption.

Watchers are parties who passively observe these “rolled up” claims, and step in only in the case of an invalid or false claim. In such a case, an honest watcher will perform the fraudproof, disproving the claim.

Services / Middleware
We refer to software built on top of EigenLayer as either services or middleware. Since we anticipate a wide variety of services built on top of EigenLayer, the EigenLayer team has endeavored to make a minimal amount of assumptions about the structure of services.

Contract-Specific Overview

StrategyManager

The StrategyManager contract keeps track of all stakers’ deposits, in the form of “shares” in the Strategy contracts. Stakers who wish to deposit ERC20 tokens can do so by calling the StrategyManager, which will transfer the depositor’s tokens to a user-specified Strategy contract, which in turn manages the tokens to generate rewards in the deposited token (or just passively holds them, if the depositor is risk-averse or if the token lacks good reward-generating opportunities).

Strategy(s)

Each Strategy contract is expected to manage a single, underlying ERC20 token, known as the underlyingToken.

Each user’s holdings in the strategy is expected to be reflected in a number of shares, and the strategy is expected to define methods for converting between an amount of underlying tokens and an amount of shares (and vice versa), somewhat similar to an ERC4626 Vault but without most of the tokenizing aspects of EIP-4626 (e.g. no transfer or transferFrom functions are expected). Assets may be depositable or withdrawable to a single Strategy contract in multiple forms, and the strategy may either actively or passively manage the funds. Since individual users’ share amounts are stored in the StrategyManager itself, it is generally expected that each strategy’s deposit and withdraw functions are restricted to only be callable by the StrategyManager itself.

Operator和delegator是什么?

Any staker in EigenLayer may choose to become either:

  1. an operator, allowing other stakers to delegate to them, and potentially earning a share of the funds generated from using the restaked assets of stakers who delegate to them

OR

  1. a delegator, choosing to allow an operator to use their restaked assets in securing applications built on EigenLayer