Staking and Delegation

Technical explanation of staking on Self Chain

The Validators set is defined in the staking module. It is first formed using the initial validators from the genesis file. However, this is a dynamic set meaning that new validators can decide to join the set by staking an amount and existing ones can decide to leave.

The way the set is modified is defined by the Tendermint blockchain itself.

Additionally, the response may contain a list of validators, which can be used to update the validator set. To add a new validator or update an existing one, simply include them in the list returned in the EndBlock response.

This is how the staking module handles it, as well.

For more details check here

In a Cosmos SDK chain, holders of the native staking token of the chain can become validators and can delegate tokens to validators, ultimately determining the effective validator set for the system.

Each proposer (validator) is weighted according to their relative total bonded stake and where a validator’s total bonded stake is directly correlated to their chance to propose a block and the amount of rewards they receive for doing so.

If any equivocation or byzantine behavior by a validator were to be committed, the validator and its delegates would be slashed a percentage of their relative total bonded stake.

As a delegator, having your $SLF staked amongst a series of validators give you a set of unalienable rights such as being able to participate in consensus and governance, and earning inflation rewards.

Validators can have one of three statuses

  1. Unbonded: The validator is not in the active set. They cannot sign blocks and do not earn rewards. They can receive delegations.

  2. Bonded: Once the validator receives sufficient bonded tokens they automatically join the active set EndBlock and their status is updated to Bonded. They are signing blocks and receiving rewards. They can receive further delegations. They can be slashed for misbehavior. Delegators to this validator who unbond their delegation must wait for the duration of the chain-specific param, during which time they are still slashable for offenses of the source validator if those offenses were committed during the period of time that the tokens were bonded.

  3. Unbonding: When a validator leaves the active set, either by choice or due to slashing, jailing, or tombstoning, an unbonding of all their delegations begins. All delegations must then wait UnbondingTime before their tokens are moved to their accounts from the BondedPool

MaxValidators

Validators are ranked by stake-backing based upon the sum of their delegations, and only the top N (currently 125 on Cosmos Hub) are designated to be active (aka "the active set"). The active set may change any time delegation amounts change. Only active validators may participate in validating blocks, earning rewards, and governance voting. SLF-holders may participate in staking by delegating their bonded SLFs to one or more validators in the active set. Delegators may only earn rewards and have their governance votes count if they are delegating to an active validator, the set of which is capped by MaxValidators.

Decreasing the value of the MaxValidators the parameter will likely reduce the number of validators actively participating in validating blocks, earning rewards, and governance voting for the Cosmos Hub. This may decrease the time it takes to produce each new Cosmos Hub block.

Increasing the value of the MaxValidatorsthe parameter will likely increase the number of validators actively participating in validating blocks, earning rewards, and governance voting for the Cosmos Hub. This may increase the time it takes to produce each new Cosmos Hub block.

KeyMaxEntries

A redelegation is simply a “rebonding” or moving a portion (or full amount) of your staked SLFs from one validator to another. This can be beneficial for a number of reasons. For example, if a delegator is no longer happy with the services or commission rates the validator is providing, then they may decide to move their bonded SLFs to another validator without having to wait the full unbonding period to make the switch.

Each delegator has a limited number of times that they may unbond SLF amounts from a unique validator within the unbonding period. Each delegator also has a limited number of times that they may redelegate from one unique validator to another unique validator within the unbonding period. This limit is set by the parameter KeyMaxEntries, which is currently 7 on Cosmos Hub.

Assume a delegator D has bonded N SLFs to validator X. Of course D could have other delegations of varying amounts to other validators, but for this example, we’ll only consider a single validator. Now delegator D wishes to undelegate some of her staked SLFs from X, so D sends a MsgUndelegate tx unbonding M SLFs. This creates an “entry” in the ledger’s state machine between D and X. Going forward if D wants to further undelegate some more staked SLFs from X, she’ll send another MsgUndelegate tx. However, D can only do this up to MaxEntries times!

So delegator D will have to wait for the full UnbondingPeriod before she can attempt to undelegate any more staked ATOMs from validator X.

For redelegations, the same concept applies. In other words, if delegator D wishes to redelegate some of her staked SLFs from validator X to another validator Y, she can only do this up to MaxEntriestime. Note, for redelegations this is per unique delegator, source validator, and destination validator tuple.

Joining Validator Set

A validator is created using the MsgCreateValidator message. The validator must be created with an initial delegation from the operator.

As you can see here the message includes amongst others the commission validator will be charging delegators. Let’s describe the commission rate fields:

  1. rate: the commission rate charged to delegators, as a fraction. For example, if the validator charges 10% then this value would be 0.1

  2. max_rate: defines the maximum commission rate that which validator can ever charge, as a fraction. Each validator can send MsgEditValidator to update the commission rate (at most once within 24 hours). The max_rate will make sure that the new rate does not exceed this value.

  3. max_change_rate: max_change_rate defines the maximum daily increase of the validator commission, as a fraction. For example, we can say that when a validator updates the rate then the new rate cannot be, let’s say 20% higher than the previous rate.

At this point, it’s worth mentioning that rewards and commissions are not automatically distributed. Validators and delegators should use the delegation module.

Last updated