Registries and Opt-ins
Registries in Symbiotic
Registries in Symbiotic serve as on-chain directories for various entities within the protocol. The two primary registries are:
1. NetworkRegistry
The NetworkRegistry is a smart contract that maintains a list of all networks participating in the Symbiotic ecosystem. It allows networks to register themselves, making them discoverable and eligible for interaction with other components of the system.
2. OperatorRegistry
The OperatorRegistry is responsible for maintaining a record of all registered operators. Operators must register here before they can participate in network activities or receive stake allocations.
Opt-ins in Symbiotic
Opt-ins are crucial for establishing connections between different entities in the Symbiotic ecosystem. There are several types of opt-ins:
1. Operator to Vault Opt-in
Operators use the VaultOptInService to opt into specific vaults. This allows them to receive stake allocations from these vaults.
2. Operator to Network Opt-in
Through the NetworkOptInService, operators can opt into networks they wish to work with. This signifies their willingness to provide services to these networks.
3. Network to Vault Opt-in
Networks can opt into vaults to set maximum stake limits they’re willing to accept. This is done using the setMaxNetworkLimit
function of the vault’s delegator.
4. Vault to Network Opt-in
Vaults can opt into networks by setting non-zero limits.
5. Vault to Operators Opt-in
Vaults can opt into operators by setting non-zero limits.
Network Registration Process
For a network to integrate with Symbiotic, it needs to follow these steps:
- Register in the NetworkRegistry using the
registerNetwork()
function. - Deploy a NetworkMiddleware contract that will act as a bridge between Symbiotic core contracts and the network chain.
- Register the deployed NetworkMiddleware contract address in the
NetworkMiddlewareService
using thesetMiddleware()
function. - Opt into desired vaults by calling
setMaxNetworkLimit()
on each vault’s delegator contract.
Vault Allocation to Networks
After a network opts into a vault, the vault manager can allocate stake to the network:
- The vault manager reviews the conditions proposed by the network (resolvers and limits).
- If agreed, the vault manager allocates stake by calling:
IBaseDelegator(IVault(vault).delegator).setNetworkLimit(subnetwork, amount)
Where 'amount' is the total network stake limit, which can be set up to the MAX_STAKE
defined by the network.
Vault Allocation to Operators
The allocation of stakes to operators in different delegator modules varies depending on the type of delegator used.
- FullRestakeDelegator and OperatorSpecificDelegator: The stake allocation is done using the following method:
IFullRestakeDelegator(delegator).setOperatorNetworkLimit(subnetwork, operator, amount)
- NetworkRestakeDelegator: The stake allocation is done using:
INetworkRestakeDelegator(delegator).setOperatorNetworkShares(subnetwork, operator, shares)
Opt-in Verification During Slashing
When a slashing event occurs, the system verifies the opt-ins to ensure the validity of the slashing request:
- The system checks if the operator has opted into the vault.
- It verifies if the operator has opted into the network.
- The system confirms that the network and the operator have a non-zero stake limits.
- Only if all these conditions are met, the operator is considered to be working with the network through the vault as a stake provider, and the slashing can proceed.