Key Responsibilities

The Taiyi Proposer Registry is a core contract that serves as the central coordination point for both Validator AVS and Gateway AVS operators in the Taiyi protocol. It manages operator registrations, validator registrations, delegations, and operational status tracking.

Core Functions

Contract Setup

initialize

function initialize(address _owner) external initializer

Initializes the contract with the specified owner address. This can only be called once as per the initializer modifier.

Parameters:

NameTypeDescription
_owneraddressAddress of the contract owner

setAVSContracts

function setAVSContracts(address gatewayAVSAddr, address validatorAVSAddr) external onlyOwner

Sets the addresses of the GatewayAVS and ValidatorAVS contracts. Can only be called by the contract owner.

Parameters:

NameTypeDescription
gatewayAVSAddraddressAddress of the GatewayAVS contract
validatorAVSAddraddressAddress of the ValidatorAVS contract

Middleware Management

addRestakingMiddlewareContract

function addRestakingMiddlewareContract(address middlewareContract) external onlyOwner

Adds a new middleware contract to the registry. Only callable by the owner, used to expand supported middleware contracts.

Parameters:

NameTypeDescription
middlewareContractaddressAddress of middleware contract to add

removeRestakingMiddlewareContract

function removeRestakingMiddlewareContract(address middlewareContract) external onlyOwner

Removes a middleware contract from the registry. Only callable by the owner, used to manage supported middleware contracts.

Parameters:

NameTypeDescription
middlewareContractaddressAddress of middleware contract to remove

Operator Management

registerOperator

function registerOperator(address operatorAddress, AVSType avsType, bytes calldata blsKey) external

Registers a new operator in the specified AVS type (GATEWAY or VALIDATOR). For GATEWAY type, requires a valid BLS public key.

Parameters:

NameTypeDescription
operatorAddressaddressThe address of the operator to register
avsTypeAVSTypeThe type of AVS (GATEWAY or VALIDATOR)
blsKeybytesThe BLS public key for the operator (only for GATEWAY type)

deregisterOperator

function deregisterOperator(address operatorAddress) external

Deregisters an operator from the system. Cannot be called if the operator has active validators or validators in cooldown.

Parameters:

NameTypeDescription
operatorAddressaddressThe address of the operator to deregister

Validator Management

registerValidator

function registerValidator(
    BLS12381.G1Point calldata pubkey,
    uint256 signatureExpiry,
    BLS12381.G2Point calldata signature,
    address delegatee
) external payable

Registers a validator with their BLS public key and optional delegatee.

Parameters:

NameTypeDescription
pubkeyBLS12381.G1PointThe BLS public key of the validator
signatureExpiryuint256Expiry timestamp for the signature
signatureBLS12381.G2PointBLS signature proving control of pubkey
delegateeaddressAddress of the delegatee for preconfirmations

batchRegisterValidators

function batchRegisterValidators(
    BLS12381.G1Point[] calldata pubkeys,
    uint256 signatureExpiry,
    BLS12381.G2Point[] calldata signatures,
    address[] calldata delegatees
) external payable

Registers multiple validators in a single transaction for gas efficiency.

Parameters:

NameTypeDescription
pubkeysBLS12381.G1Point[]Array of validator BLS public keys
signatureExpiryuint256Expiry timestamp for all signatures
signaturesBLS12381.G2Point[]Array of BLS signatures proving control of pubkeys
delegateesaddress[]Array of delegatee addresses

Opt-Out Management

initOptOut

function initOptOut(
    bytes32 pubKeyHash,
    uint256 signatureExpiry,
    BLS12381.G2Point calldata signature
) external

Initiates the opt-out process for a validator, starting the cooldown period.

Parameters:

NameTypeDescription
pubKeyHashbytes32Hash of validator’s BLS public key
signatureExpiryuint256Expiry timestamp for the signature
signatureBLS12381.G2PointBLS signature proving control of pubkey

confirmOptOut

function confirmOptOut(bytes32 pubKeyHash) external

Confirms validator opt-out after cooldown period has elapsed.

Parameters:

NameTypeDescription
pubKeyHashbytes32Hash of validator’s BLS public key

View Functions

getGatewayAVS

function getGatewayAVS() external view returns (IGatewayAVS)

Returns the GatewayAVS contract instance.

Returns:

TypeDescription
IGatewayAVSThe GatewayAVS contract interface

getValidatorAVS

function getValidatorAVS() external view returns (IValidatorAVS)

Returns the ValidatorAVS contract instance.

Returns:

TypeDescription
IValidatorAVSThe ValidatorAVS contract interface

getOperator

function getOperator(bytes32 pubKeyHash) external view returns (address)

Returns the operator address for a given validator by their public key hash.

Parameters:

NameTypeDescription
pubKeyHashbytes32Hash of the validator’s BLS public key

Returns:

TypeDescription
addressThe operator’s address

getValidatorOperator

function getValidatorOperator(bytes calldata pubkey) external view returns (address)

Returns the operator address for a given validator by their full public key.

Parameters:

NameTypeDescription
pubkeybytesThe BLS public key of the validator

Returns:

TypeDescription
addressThe operator’s address

getValidatorStatus

function getValidatorStatus(bytes32 pubKeyHash) external view returns (ValidatorStatus)
function getValidatorStatus(bytes calldata pubKey) external view returns (ValidatorStatus)

Returns the current status of a validator (NotRegistered, OptedOut, Active, OptingOut).

Parameters:

NameTypeDescription
pubKeyHashbytes32Hash of the validator’s BLS public key

Returns:

TypeDescription
ValidatorStatusThe current status of the validator

getValidator

function getValidator(bytes32 pubKeyHash) external view returns (Validator memory)

Returns complete validator information including status, operator, and delegation details.

Parameters:

NameTypeDescription
pubKeyHashbytes32Hash of the validator’s BLS public key

Returns:

TypeDescription
ValidatorComplete validator information

getValidatorCountForOperatorInAVS

function getValidatorCountForOperatorInAVS(address operator) external view returns (uint256)

Returns the number of validators registered to a specific operator.

Parameters:

NameTypeDescription
operatoraddressThe address of the operator

Returns:

TypeDescription
uint256The number of validators registered to the operator

getRegisteredOperator

function getRegisteredOperator(address operatorAddr) external view returns (Operator memory gatewayOp, Operator memory validatorOp)

Returns the registration information for an operator in both Gateway and Validator AVS roles.

Parameters:

NameTypeDescription
operatorAddraddressThe address of the operator

Returns:

TypeDescription
OperatorRegistration information for the operator in Gateway and Validator AVS roles

getActiveOperatorsForAVS

function getActiveOperatorsForAVS(address avs) external view returns (address[] memory)

Returns an array of active operator addresses for a specific AVS type.

Parameters:

NameTypeDescription
avsaddressThe address of the AVS

Returns:

TypeDescription
address[]Array of active operator addresses

getTotalValidatorCountForAVS

function getTotalValidatorCountForAVS(address avs) external view returns (uint256)

Returns the total number of validators registered in a specific AVS.

Parameters:

NameTypeDescription
avsaddressThe address of the AVS

Returns:

TypeDescription
uint256The total number of validators registered in the AVS

TaiyiProposerRegistry.sol

Maintains registry of opted-in validators and manages their status and delegations. Handles BLS signature verification for validator registration and opt-out processes.

  • Maintains registry of opted-in validators
  • Handles BLS signature verification for validator registration
  • Manages validator status and delegations
  • Coordinates opt-in/opt-out processes with cooldown periods

Functions

registerValidator

function registerValidator(
    BLS12381.G1Point calldata pubkey,
    uint256 signatureExpiry,
    BLS12381.G2Point calldata signature,
    address delegatee
) external payable

Registers a validator with their BLS public key and optional delegatee. Parameters:

NameTypeDescription
pubkeyBLS12381.G1PointThe BLS public key of the validator
signatureExpiryuint256Expiry timestamp for the signature
signatureBLS12381.G2PointBLS signature proving control of pubkey
delegateeaddressAddress of the delegatee for preconfirmations

initOptOut

function initOptOut(
    bytes32 pubKeyHash,
    uint256 signatureExpiry,
    BLS12381.G2Point calldata signature
) external

Initiates the opt-out process for a validator, starting the cooldown period. Parameters:

NameTypeDescription
pubKeyHashbytes32Hash of validator’s BLS public key
signatureExpiryuint256Expiry timestamp for the signature
signatureBLS12381.G2PointBLS signature proving control of pubkey

confirmOptOut

function confirmOptOut(bytes32 pubKeyHash) external

Confirms validator opt-out after cooldown period has elapsed. Parameters:

NameTypeDescription
pubKeyHashbytes32Hash of validator’s BLS public key

delegatePreconfDuty

function delegatePreconfDuty(
    PreconferElection calldata preconferElection,
    BLS12381.G2Point memory signature
) external

Allows a validator to delegate preconfirmation duties to a registered preconfirmer. Parameters:

NameTypeDescription
preconferElectionPreconferElectionStruct containing delegation details including validator pubkey and preconfirmer address
signatureBLS12381.G2PointBLS signature proving control of validator pubkey

revokeDelegation

function revokeDelegation(
    bytes32 validatorPubKeyHash,
    uint256 signatureExpiry,
    BLS12381.G2Point calldata signature
) external

Revokes an existing delegation for a validator. Parameters:

NameTypeDescription
validatorPubKeyHashbytes32Hash of validator’s BLS public key
signatureExpiryuint256Expiry timestamp for the signature
signatureBLS12381.G2PointBLS signature proving control of pubkey

View Functions

getDelegatedPreconfirmer

function getDelegatedPreconfirmer(bytes32 validatorPubKeyHash) external view returns (address)

Returns the current delegated preconfirmer for a validator. Parameters:

NameTypeDescription
validatorPubKeyHashbytes32Hash of validator’s BLS public key

Returns:

TypeDescription
addressAddress of the delegated preconfirmer