Skip to content

Latest commit

 

History

History
189 lines (158 loc) · 7.77 KB

File metadata and controls

189 lines (158 loc) · 7.77 KB

MiddlewareV2

The middlewareV2 architecture simplifies AVS development by:

  1. Utilizing core protocol contracts for operator key storage (KeyRegistrar) and task verification (BN254CertificateVerifier and ECDSACertificateVerifier)
  2. Utilizing core contracts for OperatorSet (ie. quorum) membership and strategy composition in the AllocationManager
  3. Utilizing the EigenLabs-run offchain services to update stakes instead of avs-sync

Contents


System Diagram

classDiagram 
direction TD
namespace Middleware-on-Ethereum{
    class OperatorTableCalculator {
        StakeCapping
        StakeWeighting (Multiplier, Oracle)
        ProtocolVotingPowerCalc
    }
    class AVSAdmin {
        metadataURI
        Permissions/multisigs/governance
        verificationDelay
        transportPayments
    }
    class AVSRegistrar {
         registerOperator
         deregisterOperator
    }
    class SlasherEjector {
      submitEvidence
      slashOperator ()
      ejectOperator ()
    }
    class RegistrationHooks{
        RegistrationLogic
        OperatorCaps
        Churn
        Sockets
    }
}
namespace Ethereum-EigenLayer-Core{
    class AllocationManager {
      registerForOperatorSets
      deregisterFromOperatorSets
      allocateStake
      deallocateStake
      slashOperator()
    }
    class KeyRegistrar{
      registerKey
      deregisterKey
      getKey (operator addr)
      isRegistered (operator addr)
    }
    class CrossChainRegistry{
      setOperatorTableCalculator
      getOperatorTableCalculator
      makeGenerationReservation
      addTransportDestination
      calculateOperatorTableBytes()
  }
}
namespace TargetChain{
    class OperatorTableUpdater{
      confirmGlobalTableRoot
      updateOperatorTable()
    }
    class CertificateVerifier{
      n Operator Tables
      updateOperatorTable()
      verifyCert (bool)
    }
    class AVSConsumer{
      requests Operator task 
      receives cert ()
    }
}

namespace Offchain{
 class Operator {
    consumer input
    return certificate()
 }
 class Transport{
    getOperatorTables
    n calculateOperatorTableBytes
    calculateGlobalStakeTable()
  }
}
AllocationManager --> AVSRegistrar
AVSAdmin --> CrossChainRegistry
CrossChainRegistry --> OperatorTableCalculator : Calculates Operator Tables
AVSRegistrar --> RegistrationHooks
RegistrationHooks --> KeyRegistrar
SlasherEjector --> AllocationManager : Slash or eject Operator 
CrossChainRegistry --> Transport : Transports Operator tables
Transport --> OperatorTableUpdater: Update global stake root 
OperatorTableUpdater --> CertificateVerifier: Update Operator Table
Operator --> AVSConsumer : Produces certificate
Operator <-- AVSConsumer : Requests task
AVS Consumer --> CertificateVerifier : Verifies Certificate
Loading

AVS developers only have to manage deployments of the the following contracts on-chain:

MiddlewareV2 architecture defines standards for the AVSRegistrar and OperatorTableCalculator.

See the multichain-ELIP and core contracts documentation for more information.


AVS Registrar

The AVS Registrar is the primary interface for managing operator registration and deregistration within an AVS. It integrates with core EigenLayer contracts to ensure operators have valid keys and are properly registered in operator sets.

File Type Description
AVSRegistrar.sol Proxy Core registrar contract that handles operator registration/deregistration
AVSRegistrarWithSocket.sol Proxy Adds socket URL registration for operator communication
AVSRegistrarWithAllowlist.sol Proxy Restricts registration to allowlisted operators
AVSRegistrarAsIdentifier.sol Proxy Serves as the AVS identifier and manages permissions

Base AVSRegistrar

The AVSRegistrar provides base functionality for AVSs to register and deregister operators to their operatorSet. A single AVSRegistrar supports multiple operatorSets. This contract expects operator registrations and deregistrations to originate from the AllocationManager.

See full documentation in ./AVSRegistrar.md.


Operator Table Calculator

File Type
BN254TableCalculatorBase.sol Abstract Contract
BN254TableCalculator.sol Basic table calculator that sums slashable stake across all strategies
ECDSATableCalculatorBase.sol Abstract Contract
ECDSATableCalculator.sol Basic table calculator that sums slashable stake across all strategies

These contracts define custom stake weights of operators in an operatorSet. They are segmented by key-type.

See full documentation in /operatorTableCalculator.md.


Core Contract Integrations

Key Registrar

The KeyRegistrar manages cryptographic keys for operators across different operator sets. It supports both ECDSA and BN254 key types and ensures global uniqueness of keys across all operator sets.

When an operator registers to an operatorSet, the AVSRegistrar checks membership of the key in the operatorSet.

Allocation Manager

The AllocationManager is the entrypoint for all operator<>avs interactions. It:

  • Manages operator registration and deregistration
  • Enables an AVS to configure its metadataURI and AVSRegistrar
  • Enables an AVS to configure strategy composition in an operatorSet
  • Manages allocation and deallocation of slashable stake
  • Enables an AVS to slash an operator

See the AVSRegistrar for how an AVS is initialized to the core protocol.

Certificate Verifier

The CertificateVerifier is responsible for verifying certificates from an offchain task, on-chain. The stakes in the certificate verifier are defined by the AVS-deployed OperatorTableCalculator and transported via an off-chain process run by Eigen labs. The CertificateVerifier contracts support two signature schemes: ECDSA for individual signatures and BN254 for aggregated signatures. See multichain docs for more information.