In the delegation flow there are two types of users: Stakers and Operators. Stakers are users who delegate their staked collateral to Operators. Operators receive delegated stakes from Stakers and run services built on top of EigenLayer. While delegating to an operator is designed to be a simple process from the staker's perspective, a lot happens "under the hood".
An Operator can register themselves in the system by calling the registerAsOperator function, providing their OperatorDetails which include the earningsReceiver (the address to receive the operator's earnings), delegationApprover (the address that approves delegations to the operator), and stakerOptOutWindowBlocks (the number of blocks for which a staker can opt out of delegating to the operator). In order to be delegated to, an operator must have first called DelegationManager.registerAsOperator
. Once registered, an operator cannot deregister and is considered permanently delegated to themselves.
When an operator registers in EigenLayer, the following flow of calls between contracts occurs:
sequenceDiagram
participant Operator as Operator
participant DelegationManager as DelegationManager
Operator->>DelegationManager: registerAsOperator(operatorDetails, metadataURI)
DelegationManager->>Operator: OperatorRegistered event
- The would-be operator calls
DelegationManager.registerAsOperator
, providing theirOperatorDetails
and an (optional)metadataURI
string as an input. The DelegationManager contract stores theOperatorDetails
provided by the operator and emits an event containing themetadataURI
. TheOperatorDetails
help define the terms of the relationship between the operator and any stakers who delegate to them, and themetadataURI
can provide additional details about the operator. All of the remaining steps (2 and 3) proceed as outlined in the delegation process below;
For a staker to delegate to an operator, the staker must either:
- Call
DelegationManager.delegateTo
directly OR - Supply an appropriate ECDSA signature, which can then be submitted by the operator (or a third party) as part of a call to
DelegationManager.delegateToBySignature
If a staker tries to delegate to someone who has not previously registered as an operator, their transaction will fail.
In either case, the end result is the same, and the flow of calls between contracts looks identical:
sequenceDiagram
participant Staker as Staker
participant DelegationManager as DelegationManager
Staker->>DelegationManager: delegateTo(operator, approverSignatureWithExpirhy, approverSalt)
DelegationManager->>Staker: StakerDelegated event
sequenceDiagram
participant Staker as Staker
participant DelegationManager as DelegationManager
Staker->>DelegationManager: delegateToWithSignature(staker, operator, stakerSignatureWithExpiry, approverSignatureWithExpiry, approverSalt)
DelegationManager->>Staker: StakerDelegated event
- As outlined above, either the staker themselves calls
DelegationManager.delegateTo
, or the operator (or a third party) callsDelegationManager.delegateToBySignature
, in which case the DelegationManager contract verifies the provided ECDSA signature - The DelegationManager contract calls
Slasher.isFrozen
to verify that the operator being delegated to is not frozen - The DelegationManager contract calls
StrategyManager.getDeposits
to get the full list of the staker (who is delegating)'s deposits. It then increases the delegated share amounts of operator (who is being delegated to) appropriately