KIP 277: Self Validator Registration
| Author | Lewis, Ollie, Ian |
|---|---|
| Discussions-To | https://github.com/kaiachain/kips/issues/77 |
| Status | Draft |
| Type | Core |
| Created | 2025-11-10 |
Abstract
Introduce a self validator registration process that accepts validator-initiated requests (onboarding, offboarding, add/remove staking contracts) and validates request data under strict invariants.
Upon explicitly approved by the Kaia team, it’ll register the validator information to corresponding smart contracts. This KIP won’t bring any changes to the existing smart contracts, such as AddressBook and SimpleBlsRegistry.
Specification
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.
Terminology
| Term | Description |
|---|---|
| AddressBook | The smart contract that manages the validator information, such as node ID, staking contract address, and reward address. |
| SimpleBlsRegistry | The smart contract that manages the BLS public key information, introduced by KIP-113. |
| Consensus Node ID | The node address participating in the consensus (i.e., address in council). It uniquely identifies a validator. A validator can have only one consensus node ID. |
| Node ID | The dummy node address assigned for each staking contract registered in the AddressBook. A validator can have multiple node IDs. |
| Manager | An account set by the validator to manage its registration lifecycle. |
Adding a new staking contract requires a unique Node ID to be assigned, so a validator needs to assign multiple node IDs to the multiple staking contracts. But among all node IDs, only one node ID will be participating in the consensus and other node IDs will be dummy addresses. In this KIP, we call the node ID that participates in the consensus as Consensus Node ID and the other node IDs as Node IDs.
ValidatorManager
A new ValidatorManager smart contract (VMC for short) is introduced, which implements the self registration processes for validators. The possible requests are:
- Onboarding: Request to register a new validator to
AddressBookandSimpleBlsRegistry. - Offboarding: Request to unregister a validator from
AddressBookandSimpleBlsRegistry. - AddStakingContract: Request to add a new staking contract to a
AddressBook. - RemoveStakingContract: Request to remove a staking contract from a
AddressBook.
When onboarding/adding a new staking contract, the StakingContract MUST be CnStakingV3 introduced by KIP-163.
The VMC must implement the IValidatorManager interface.
interface IValidatorManager {
enum RequestType {
NoRequest,
Onboarding,
Offboarding,
AddStakingContract,
RemoveStakingContract
}
struct OnboardingRequest {
address manager;
address consensusNodeId;
address stakingContract;
address rewardAddress;
IKIP113.BlsPublicKeyInfo blsPublicKeyInfo;
}
struct Request {
/// @dev the manager that submitted the request
address manager;
/// @dev requestIndex is used to prevent request-replacement attack when approving or rejecting a pending request
uint256 requestIndex;
/// @dev the type of request
RequestType requestType;
/// @dev the ABI-encoded request data (abi.encode)
/// - Onboarding: struct OnboardingRequest
/// - Offboarding: N.A. (no request data required)
/// - AddStakingContract: (address nodeId, address stakingContract, address rewardAddress)
/// - RemoveStakingContract: (address nodeId)
bytes requestData;
}
/// @notice Request a new validator onboarding, offboarding, adding a new staking contract, or removing a staking contract
/// @param consensusNodeId The consensus node id that the request is for
/// @param requestType The type of request
/// @param requestData The encoded request data
/// @dev Callable by validator manager
/// @dev Note that this only allows to submit one request at a time
function request(address consensusNodeId, RequestType requestType, bytes memory requestData) external;
/// @notice Cancel existing request for the given consensus node id
/// @param consensusNodeId The consensus node id that the request is for
/// @dev Callable by validator manager
function cancelRequest(address consensusNodeId) external;
/// @notice Transfer the validator manager to a new address
/// @dev Callable by validator manager
/// Can't transfer manager if there is a pending request
function transferManager(address consensusNodeId, address newManager) external;
/// @notice Approve a request
/// @dev Callable by owner
/// @param consensusNodeId The consensus node id that has a request to be approved
function approveRequest(address consensusNodeId, uint256 requestIndex) external;
/// @notice Reject request of a validator manager
/// @dev Callable by owner
/// @param consensusNodeId The consensus node id that has a request to be rejected
function rejectRequest(address consensusNodeId, uint256 requestIndex) external;
}
After the activation of VMC, all validators must manage their own registration process through VMC. For onboarding of existing validators, the Kaia team will initially backfill the validator information at the deployment of VMC.
Prerequisites
Since the VMC will execute calls to the AddressBook and SimpleBlsRegistry, the following prerequisites should be satisfied to ensure the execution of requests:
VMCis registered as an admin ofAddressBook. It can include more than one admin for backup purposes.AddressBookhasrequirementset to 1.- This is required since
AddressBookinternally implements a multisig mechanism for the admin list.
- This is required since
VMCis the owner ofSimpleBlsRegistry.
If any of the prerequisites are not met, the VMC MUST revert the request approval. (not prevent request submission)
Self Registration Process
Onboarding
- Prepare a manager account.
- Manager deploys a new consensus staking contract (
CnStakingV3MultiSig) through the staking factory in Registry. - Candidate finishes the initialization of staking contract.
- Candidate submits an onboarding request to
VMC. - Kaia team reviews the request.
- Kaia team approves the request.
- a.
VMCMUST executeAddressBook.submitRegisterCnStakingContractto register the validator information. - b.
VMCMUST executeSimpleBlsRegistry.registerto register the BLS public key information.
- a.
Offboarding
- Manager submits an offboarding request to
VMC. - Kaia team reviews the request.
- Kaia team approves the request.
- a.
VMCMUST executeAddressBook.submitUnregisterCnStakingContractto unregister the validator information of staking contracts. - b.
VMCMUST executeSimpleBlsRegistry.unregisterto unregister the BLS public key information.
- a.
AddStakingContract
- Manager deploys a new staking contract through the staking factory in Registry.
- Validator finishes the initialization of staking contract.
- Validator submits an add staking contract request to
VMC. - Kaia team reviews the request.
- Kaia team approves the request.
- a.
VMCMUST executeAddressBook.submitRegisterCnStakingContractto register a new staking contract.
- a.
RemoveStakingContract
- Manager submits a remove staking contract request to
VMC. - Kaia team reviews the request.
- Kaia team approves the request.
- a.
VMCMUST executeAddressBook.submitUnregisterCnStakingContractto unregister the staking contract.
- a.
Request validation
The VMC MUST implement the following validation rules for each request type and MUST revert for both request submission and approval if any of the rules are not met:
Common Validation Rules
- Request for
ConsensusNodeIdMUST be submitted by the correspondingManager.- When onboarding, the
Request.managerMUST bemsg.sender.
- When onboarding, the
- Request for
ConsensusNodeIdcan be cancelled by only theManagerthat submitted the request. Managercan have only one pending request at a time.Request.requestDataMUST be encoded correctly.
Onboarding Request Validation
ConsensusNodeIdMUST NOT exist inVMC.BlsPublicKeyInfoMUST be valid.ConsensusNodeIdMUST have a balance of at leastMIN_CONSENSUS_NODE_BALANCE.- Node entry MUST be valid.
- a.
ConsensusNodeIdMUST NOT exist inAddressBook. - b.
StakingContractMUST be deployed by theManagervia the registered staking factory. - c.
StakingContractMUST be initialized. - d.
StakingContractMUST havenodeId()equal toRequestData.consensusNodeId - e.
StakingContractMUST haverewardAddress()equal toRequestData.rewardAddress. - f. If
PublicDelegationis enabled,PublicDelegationMUST be deployed by theStakingContractvia the registered public delegation factory.
- a.
Offboarding Request Validation
ConsensusNodeIdMUST exist inVMC.
AddStakingContract Request Validation
ConsensusNodeIdMUST exist inVMC.NodeIdMUST NOT be managed by currentManager.- Node entry MUST be valid.
- a.
NodeIdMUST NOT exist inAddressBook. - b.
StakingContractMUST be deployed by theManagervia the registered staking factory. - c.
StakingContractMUST be initialized. - d.
StakingContractMUST havenodeId()equal toRequestData.consensusNodeId - e.
StakingContractMUST haverewardAddress()equal toRequestData.rewardAddress.
- a.
- New staking contract MUST be compatible with the consensus node’s staking contract.
- a.
PublicDelegationMUST NOT be enabled. - b.
gcIdMUST be the same. - c.
rewardAddressMUST be the same.
- a.
RemoveStakingContract Request Validation
ConsensusNodeIdMUST exist inVMC.NodeIdMUST NOT be currentConsensusNodeId.NodeIdMUST be managed by currentManager.
Rationale
Maintain existing smart contracts
The AddressBook provides a trusted source of validator information, deployed at 0x0000000000000000000000000000000000000400 since the genesis block. Migrating the existing AddressBook will essentially require a major effort and cost to entire ecosystem. The Kaia team decided to implement VMC, which doesn’t require any changes to the existing smart contracts but can meet all the requirements for the self validator registration process.
Request-Approval flow
Both validators and the Kaia team need time to be aware of the new validator registration process. This Request-Approval flow prevents any accidental or malicious requests from being executed directly without proper review process.
One request at a time
The validator registration process is critical for the network and should be done in a secure and reliable manner. Allowing multiple requests at a time would introduce unnecessary complexity for both validators and network.
Consensus Node ID as a request argument
The request function requires ConsensusNodeId as an argument to explicitly use ConsensusNodeId as a unique identifier of a validator. The Manager is only responsible for sending the request transaction on its ConsensusNodeId, and should not play as a unique identifier for a validator.
Lack of staking amount requirement for onboarding
Currently there’re validators operating multiple staking contracts with different staking amounts. In this case, it’s possible that the staking contract has less than 5M KAIA staked. If a validator has less than 5M KAIA staked in total, the Kaia network automatically demotes the validator and it doesn’t affect to network stability. But in the future permissionless system, it’ll be necessary to introduce strict staking amount requirement for onboarding to prevent any spamming.
No Public Delegation for an additional staking contract
Since AddStakingContract request doesn’t allow PublicDelegation to be enabled, the validator should offboard and onboard again to migrate staking contract to enable PublicDelegation. This is intended to prevent any unintentional reward distribution. We can consider the following scenario:
- Validator A first has a staking contract with
PublicDelegationdisabled. - Validator A deploys a new staking contract with
PublicDelegationenabled. - Validator A updates the reward address of existing staking contract to the
PublicDelegationaddress.
Right after (3), all rewards will go to PublicDelegation address, which only tracks the staking amount of new staking contract. If there’s not enough staking amount, than small shareholders will receive massive rewards, which is not intentional.
Backwards Compatibility
CnStakingContract
The VMC contract will be backward compatible with the existing CnStakingContractV2 and CnStakingContractV3, but not compatible with the previous deprecated CnStakingContractV1. Please note that the CnStakingContractV2 compatibility is required for the existing validators (when backfilling the validator information).
Forward Compatibility
Forward compatibility might be considered since self registration process is essential for a permissionless network. During the future progress, the Kaia team is expecting fundamental changes to the existing smart contracts, which means VMC can be deprecated once the new smart contracts are deployed. The Kaia team should provide a proper migration plan for the existing validators and keep the interface compatible with the new smart contracts to ensure seamless transition.
Security Considerations
In an emergency situation which requires instant recovery through direct access to the AddressBook or SimpleBlsRegistry, it can cause state inconsistency between VMC and the AddressBook or SimpleBlsRegistry. In this case, the Kaia team should perform a state recovery process through manual intervention and implement a proper recovery function to ensure the network can recover from the emergency situation.
Reference
Copyright
Copyright and related rights waived via CC0.