AVS Register and Deploy

Participation in the AVS ecosystem requires providers to undergo a registration process. The AVS register currently accommodates two methodologies: the module approach based on precompile and the smart contract approach.

Module-Based Approach

For the module-based approach, the registration process encompasses the following procedural steps:

  • To register an AVS using the module-based approach, one can execute an EVM transaction via precompile, sending it directly to the exocore chain. This registration process utilizes the RegisterAVS method, which is provided by the AVS module within the exocore chain networks.

    RegisterAVS, registers the AVS. The following parameters need to be supplied:

    • AvsName: String representing of the AVS name

    • AvsAddress: Hexadecimal address of the AVS

    • MinStakeAmount: Minimum stake (uint64) required for task validity

    • TaskAddr: Hexadecimal address of the task contract

    • SlashContractAddr: Hexadecimal address of the slash contract

    • RewardContractAddr: Hexadecimal address of the reward contract

    • AvsOwnerAddress: Array of bech32 addresses for AVS owners

    • AssetID: Array of permitted asset IDs for the AVS

    • Params: Array of string parameters

    • UnbondingPeriod: Duration (uint64) of the unbonding period

    • MinSelfDelegation: Minimum self-delegation amount (uint64)

    • EpochIdentifier: String identifier for the epoch

    • MinOptInOperators: Minimum number (uint64) of opt-in operators

    • MinTotalStakeAmount: Minimum total stake amount (uint64)

    • CallerAddress: Bech32 address of the precompile caller

    • ChainID: String identifier for the chain

    • AvsReward: Reward amount (uint64) for the AVS

    • AvsSlash: Slash amount (uint64) for the AVS

    • Action: Action identifier (uint64)

    Upon successful registration through this method, the AVS will be added to the system. Users can subsequently perform various actions to query and interact with the registered AVS, including:

    • updateAVS: Modifies existing AVS parameters

    • deregisterAVS: Removes an AVS from the system

    • registerOperatorToAVS: Adds a new operator to an AVS

    • deregisterOperatorFromAVS: Removes an operator from an AVS

    • createTask: Initiates a new task within an AVS

    • submitProof: Provides proof of task completion

    • registerBLSPublicKey: Registers a BLS public key for an operator

    • challenge: Initiates a challenge against an operator or task

Smart-Contract-Based Approach

For the smart-contract-based approach, the registration process involves the following steps:

  • The AVS owner develops the customized AVS contract utilizing the Exocore-AVS-SDK repo. This contract encompasses crucial elements such as AVS information, task specifications, verification and more.

  • The AVS owner commences the registration procedure by executing the registerAVS function within the AVS contracts. This function necessitates specific parameters, which are comprehensively outlined in the subsequent table.

    ParameterTypeExampleDescription

    avsName

    string

    avs01

    Unique identifier for the AVS

    assetIDs

    string

    ["0x3e108c058e8066DA635321Dc3018294cA82ddEdf","0x3e108c058e8066DA635321Dc3018294cA82ddEdf"]

    List of asset IDs accepted by the AVS

    minStakeAmount

    uint64

    1000

    Minimum stake required to initiate a task

    taskAddr

    address

    0x1234567890abcdef1234567890abcdef12345678

    Hexadecimal address of the task contract

    slashAddr

    address

    0xabcdef1234567890abcdef1234567890abcdef12

    Hexadecimal address of the slashing contract

    rewardAddr

    address

    0x7890abcdef1234567890abcdef1234567890abcd

    Hexadecimal address of the reward contract

    avsOwnerAddress

    string[]

    ["exo1uhmndjuatwcqkdtwpccf8l9pq92p3jftc4s6ef", "exo1uhmndjuatwcqkdtwpccf8l9pq92p3jftc4s6ef"]

    Bech32 addresses of AVS owners

    avsUnbondingPeriod

    uint64

    10

    Number of epochs for operator unbonding

    minSelfDelegation

    uint64

    500

    Minimum self-delegation required for operator participation

    epochIdentifier

    string

    epoch_01

    Identifier from the epochs module

    params

    uint64[]

    [5, 5, 5, 6]

    Array of 4 elements defining task creation parameters (see table below)

    ParameterNameTypeExampleDescription

    param1

    min_opt_in_operators

    uint64

    5

    Minimum number of operators required for task execution

    param2

    min_total_stake_amount

    uint64

    5

    Minimum aggregate stake amount necessary for task initiation

    param3

    avs_reward

    uint64

    5

    Proportion of reward allocated to the AVS

    param4

    avs_slash

    uint64

    6

    Proportion of penalty applied in case of non-compliance

AVS Contract Deploy

Deploy contracts using remix or other third-party libraries

Smart Contract Example

Type

Address

avs service contract

0xDF907c29719154eb9872f021d21CAE6E5025d7aB

avs owner

exo1uhmndjuatwcqkdtwpccf8l9pq92p3jftc4s6ef

operator

exo1uhmndjuatwcqkdtwpccf8l9pq92p3jftc4s6ef

Operator and AVS Binding Relationship

Two methods are available for establishing an operator-AVS binding:

  • Smart Contract Utilization: Operators can utilize the registerOperatorToAVS function within the AVS contract to initiate the binding process. This approach leverages the AVS smart contract to establish the connection.

  • Command Line Interface (CLI) Utilization: Alternatively, operators may use the Exocore CLI to facilitate the opt-in procedure. This method involves executing a designated command to register the operator with the specified AVS.

    Example:

    exocored tx operator opt-into-avs [avs-address] [public-key-in-JSON-format]

    Parameters:

    • [avs-address]: Hexadecimal string representing the AVS address

    • [public-key-in-JSON-format]: Optional JSON-formatted public key of the operator

    The Example Result:

    exocored tx operator opt-into-avs \\
      0xAa089Ba103f765fCeA44808BD3d4073523254C57 \\
      '{"@type":"/cosmos.crypto.ed25519.PubKey","key":"XLtFCK0/nB1xExSXEhH5kaxRte3aIXSGaBfWSeNOtpE="}'

Both approaches are supported for establishing an operator-AVS binding. These methods ensure a secure and efficient connection between operators and their respective AVSs.

Last updated