Staking and Delegation in Cosmos

Notional Ventures
9 min readAug 28, 2023

An introductory article on staking your Cosmos assets: risks, rewards, and how it all works.

Table of Contents

Introduction

Did you know that you can put your Cosmos tokens to work? There are many different features of Cosmos blockchains that make them special, but in this article, I’m going to focus on delegation, which is the ability of users who are not validators to contribute to the security of the chain and receive a portion of the block rewards in return.

If you haven’t already, be sure you have a look at our introductory Cosmos article for a foundational overview of the Cosmos, but if you’re keen to understand how your Cosmos assets can earn yield in the form of more Cosmos assets, let’s dive in.

Delegated Proof of Stake

The majority of Cosmos blockchains run the CometBFT consensus algorithm to keep them secure. This is a delegated proof of stake (dPOS) algorithm, which means that validators need to commit a certain amount of staked tokens in order to participate in consensus.

As a reward for abiding by the rules of the protocol and contributing to its security, a block reward of new tokens is distributed to all validators every time a new block is added. Since a greater proportion of staked tokens means higher economic security, non-validators (who I will now just refer to as ‘users’) can delegate their tokens to an active validator and share in the rewards for their contribution to the security of the blockchain. This is important, since running a reliable validator in Cosmos takes considerable technical knowledge.

Delegation and Shares

Suppose I have 100 ATOM and Notional is an active validator with 100 ATOM currently staked (Note: These numbers are for illustrative purposes only, to make the math easy!). If I so desire, I can choose to delegate my ATOM to Notional, which will bring their total staked ATOM to 200.

The first thing users should know is that even though my ATOM has been committed to the Notional staking pool, they do not have control over my funds¹. Delegation is a non-custodial feature — the validator can never send your funds somewhere else and (as long as they don’t get slashed — more on this later) you can always halt the delegation and withdraw your funds back to your wallet.

Users should also note that all Cosmos chains have an unbonding period, which is a pre-determined amount of time after you withdraw where your funds will not accrue rewards but can also not be sent to other addresses. This is a drawback, but it is also a critical security feature of CometBFT consensus so it is something you should consider before delegating your tokens.

You can check the unbonding period for your favourite Cosmos chain on an explorer like Mintscan². For example, at the time of writing, the unbonding period for the Cosmos Hub is 21 days, which means I need to wait this long after I undelegate before I can transfer my ATOM freely again, and during this time I will earn no rewards.

But how does this all work? Let’s revisit my previous example:

  • Me: 100 ATOM looking for a staking home.
  • Notional: 100 ATOM already staked.

The validator pool implements a system of shares to keep track of who has contributed what, which you can read about here³. When Notional created their validator pool, they bonded 100 ATOM and created 100 shares that they now hold. Thus, 1 share = 1 ATOM (1:1).

If I now delegate my 100 ATOM, new shares will be created and distributed to me at the pre-bonding exchange rate (1:1). I will receive 100 new shares and my 100 ATOM will be bonded to Notional’s validator pool. Note that now, there are 200 shares in existence and 200 staked tokens, and the exchange rate is still 1:1.

These shares are not fungible assets — just a book-keeping mechanism — and wallets will generally show your number of shares as a number of staked tokens. If I now want to undelegate from Notional, my 100 shares will be destroyed, and I’ll receive ATOM back at the pre-unbonding exchange rate of 1:1, so after 21 days my 100 ATOM will be back in my wallet where they can freely be transferred.

Now that we are comfortable with the basic structure of delegation, let’s talk about Rewards and Risks.

Rewards

I’ve gone to the trouble of delegating to Notional, and now my ATOM is contributing to the security of the network. What can I expect in return?

Each block, rewards are distributed to all validators in proportion to their stake. Let suppose that while I am delegating my 100 ATOM to Notional (with their self-stake of 100 ATOM), Notional earns 20 ATOM. Since I contributed half their stake, I should get half the rewards — 10 ATOM — right?

Maybe.

All validators can set a commission rate on their block rewards. This is an amount that they receive before delegators can claim their portion. It is extremely reasonable for a delegator to have a non-zero commission — after all, they are doing the heavy lifting of actually running the Cosmos software, and their delegators are not. At the time of writing, Notional has a 5% commission for their validator on the Cosmos Hub, so we will use this with our previous example (see this article for more details⁴).

Notional will receive 10 ATOM for their stake (50% of the rewards) PLUS 5% of their delegators’ share (also 10 ATOM, in this example). So their commission will be 0.05*10 = 0.5 ATOM, leaving 9.5 ATOM to be split amongst delegators. Since I am the only delegator in this example, the entire 9.5 ATOM would be claimable by me.

Now, suppose instead of only me, there is another delegator (named… Maria…) who delegates 200 ATOM to Notional. Now the breakdown of the total stake is:

If we pretend that the voting weights of other validators have not changed yet, then Notional’s weight has increased. This means that their total block rewards will also increase. Suppose it increases to 40 ATOM (to keep the math simple), and let’s run the calculation again:

  • Notional gets: 10 ATOM (for 1/4 of the total stake) + 0.05*30 = 1.5 ATOM (commission on the other 3/4 of the rewards) for a total of 11.5 ATOM.
  • This leaves 40–11.5 = 28.5 ATOM remaining from the total block reward for the delegators.
  • I get: 28.5/3 = 9.5 ATOM since I contributed 1/3 of the delegator stake.
  • Maria gets: (2*28.5)/3 = 19 ATOM since she contributed 2/3 of the delegator stake.

Hopefully now you are feeling more comfortable with what you will earn by delegating to a Validator. Easy money right?

Risks

As is normally the case, in order to get these rewards, you have to understand the risks involved and be willing to participate. Let’s start with the most basic one: If you delegate to a validator whose commission rate is 100%, it shouldn’t take you long to figure out that you will receive no rewards! If your goal is to increase the number of tokens you own, you should avoid these validators entirely.

You can always check the commission rates of the various validators by looking at an explorer like Mintscan⁵, and it is always worth doing this before you make your selection. At the time of writing, there are eight validators on the Cosmos Hub charging 100% commission (!!!).

But all the other validators are safe, right?

Well… if you read our articles on CometBFT consensus, you’ll know that Cosmos chains can handle up to 1/3 faulty or malicious validators. But that’s not the end of the story. All Cosmos chains can decide how they want to punish validators who commit different kinds of offenses. The most common are downtime and double signing, so let’s look at what happens to your stake in these two situations.

If your validator goes offline, and signs no blocks for a certain period of time (called the signed blocks window) they will be ‘jailed’ for the jail duration. This means that even if they come back online, they will be prevented from signing blocks until the jail duration has ended.

Both the signed blocks window and the jail duration are parameters that can be changed through governance, but at the time of writing they are 10 000 blocks and 600 seconds (about 10 minutes) on the Cosmos Hub. If your validator is jailed for downtime, you can expect a slap on the wrist — 0.01% of their stake will be slashed. This means that 0.01% of YOUR stake will also be slashed.

A far worse case scenario is that your validator double signs. You may have read in our second CometBFT article that this means they attest to the validity of two conflicting states of the blockchain. This could cause a fork in the chain, and this is very bad. Two things will happen once this offense is discovered³:

1) Your validator’s stake (and thus your stake) will be slashed 5%.

2) Your validator will be tombstoned — blacklisted from producing blocks for that blockchain. This means that you will cease earning rewards as soon as the network agrees that the offense has been committed. You can redelegate to a new validator, but you will not receive rewards for any time you continue delegating to the offending validator.

Remember those shares we mentioned in the Rewards section? Let’s revisit that quickly.

The tokens from all the delegators for a particular validator are in the same pool, and each of them also has a number of shares attached to their address. Let’s suppose there were 1000 ATOM in a validator pool, the exchange rate was 1 share = 1 ATOM, and you had staked 100 ATOM with that validator and received 100 shares.

Now suppose that this validator is slashed for a double sign — the pool will be reduced in size from 1000 to 950 ATOM (a 5% haircut). But there are still 1000 shares that exist, spread across delegators. Now when you go to undelegate, your 100 shares will only get you

(100/1000)*950 = 95$ ATOM (also a 5% haircut)

Hopefully, now you can see: in the event of slashing, the share system ensures that the damage is spread across all delegators, as well as the validator.

Conclusion

The economic security of Cosmos chains is dependent on good validators safeguarding it, and delegators putting their faith in the validators that they think are doing a great job. Hopefully in this article you’ve understood

  1. That Cosmos delegation is non-custodial
  2. That you can earn rewards with your assets by delegating them to active Validators
  3. That if your validator has technical problems or misbehaves, some of your funds will be at risk.

We hope that you’ll consider trusting us with your tokens on one or more of the many chains that we validate on.

Thanks for reading ❤
Robin Tunley
Twitter: @the5thforce0_0

References

[1]: Cosmos Github, https://github.com/cosmos/cosmos/blob/master/VALIDATORS_FAQ.md

[2]: Mintscan Block Explorer — Parameters, https://www.mintscan.io/cosmos/parameters

[3]: Cosmos SDK Documentation — x/slashing, https://docs.cosmos.network/main/modules/slashing

[4]: Node A-Team, Understanding a Few Key Features of Cosmos, https://medium.com/node-a-team/understanding-few-key-features-of-cosmos-hub-87394317d10a

[5]: Mintscan Block Explorer — Validators, https://www.mintscan.io/cosmos/validators

If you found this article interesting or informative, please help us out by sharing it with your friends and family. If there are other topics within the Cosmos you’d like to know more about, don’t hesitate to contact us and let us know!

Notional: Website
Notional on Twitter: @notionaldao

--

--

Notional Ventures

High Quality In-House Validation, Relaying, and Software Engineering for the Cosmos.