Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(contracts): added EigenLayer integration in README #232

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 67 additions & 7 deletions bolt-contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ coordination of validators, operators, and vaults within the Bolt network.

Key features include:

1. Registration of Symbiotic Operators and Vaults
1. Registration of Symbiotic Operators and Vaults / EigenLayer Operators and Strategies
2. Whitelisting of collateral assets used to back commitments
3. Retrieval of operator stake and proposer status from their pubkey
4. Integration with Symbiotic
5. (WIP) Integration with Eigenlayer
4. Integration with Symbiotic/EigenLayer

### Symbiotic Integration guide for Staking Pools

Expand All @@ -62,7 +61,7 @@ on how to spin up a Vault and start receiving stake from your node operators.

Opting into Bolt works as any other Symbiotic middleware integration. Here are the steps:

1. Make sure your vault collateral is whitelisted in `BoltManager` by calling `isCollateralWhitelisted`.
1. Make sure your vault collateral is whitelisted in `BoltManager` by calling `isSymbioticCollateralWhitelisted`.
2. Register as a vault in `BoltManager` by calling `registerSymbioticVault`.
3. Verify that your vault is active in `BoltManager` by calling `isSymbioticVaultEnabled`.
4. Set the network limit for your vault in Symbiotic with `Vault.delegator().setNetworkLimit()`.
Expand All @@ -83,9 +82,70 @@ The opt-in process requires the following steps:
5. get approved by the vault.
6. start providing commitments with the stake provided by the vault.

### Eigenlayer Integration guides

WIP
### EigenLayer Integration Guide for Node Operators and Solo Stakers

> [!NOTE]
> Without loss of generality, we will assume the reader of this guide is a Node
> Operator (NO), since the same steps apply to solo stakers.

As a Node Operator you will be an ["Operator"](https://docs.eigenlayer.xyz/eigenlayer/overview/key-terms)
in the Bolt AVS built on top of EigenLayer. This requires
running an Ethereum validator and the Bolt sidecar in order issue
preconfirmations.

The Operator will be represented by an Ethereum address that needs
to follow the standard procedure outlined in the
[EigenLayer documentation](https://docs.eigenlayer.xyz/) to opt into EigenLayer. Let's go through the steps:

1. As an Operator, you register into EigenLayer using [`DelegationManager.registerAsOperator`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/core/DelegationManager.sol#L107-L119).

2. As an Ethereum validator offering precofirmations a NO needs some collateral in
order to be economically credible. In order to do that, some entities known as a "stakers"
need to deposit whitelisted Liquid Staking Tokens (LSTs)
into an appropriate "Strategy" associated to the LST via the
[`StrategyManager.depositIntoStrategy`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/core/StrategyManager.sol#L105-L110),
so that the Operator has a `min_amount` (TBD) of collateral associated to it.
Whitelisted LSTs are exposed by the `BoltEigenLayerMiddleware` contract
in the `getWhitelistedCollaterals` function.
Note that NOs and stakers can be two different entities
_but there is fully trusted relationship as stakers will be slashed if a NO misbehaves_.

3. After the stakers have deposited their collateral into a strategy they need
to choose you as their operator. To do that, they need to call the function
[`DelegationManager.delegateTo`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/core/DelegationManager.sol#L154-L163).

4. As an Operator you finally opt into the Bolt AVS by interacting with the `BoltEigenLayerMiddleware`.
This consists in calling the function `BoltEigenLayerMiddleware.registerOperatorToAVS`.
The payload is a signature whose digest consists of:

1. your operator address
2. the `BoltEigenLayerMiddleware` contract address
3. a salt
4. an expiry 2.

The contract will then forward the call to the [`AVSDirectory.registerOperatorToAVS`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/core/AVSDirectory.sol#L64-L108)
with the `msg.sender` set to the Bolt AVS contract. Upon successful verification of the signature,
the operator is considered `REGISTERED` in a mapping `avsOperatorStatus[msg.sender][operator]`.

Lastly, a NO needs to interact with both the `BoltValidators` and `BoltEigenLayerMiddleware`
contract. This is needed for internal functioning of the AVS and to make RPCs aware that you are a
registered operator and so that they can forward you preconfirmation requests.

The steps required are the following:

1. Register all the validator public keys you want to use with Bolt via the `BoltValidators.registerValidator`.
If you own more than one validator public key,
you can use the more gas-efficient `BoltValidators.batchRegisterValidators` function.
The `authorizedOperator` argument must be the same Ethereum address used for
opting into EigenLayer as an Operator.

2. Register the same Operator address in the `BoltEigenLayerMiddleware` contract by calling
the `BoltEigenLayerMiddleware.registerOperator` function. This formalizes your role within the Bolt network
and allows you to manage operations effectively, such as pausing or resuming
your service.

3. Register the EigenLayer strategy you are using for restaking _if it has not been done by someone else already_.
This ensures that your restaked assets are correctly integrated with Bolt’s system.

## Fault Proof Challenge and Slashing: `BoltChallenger`

Expand Down
Loading