Skip to content

Commit

Permalink
Staking diagram (#507)
Browse files Browse the repository at this point in the history
* This "for them" might imply the baker, not the user

* Add staking diagram and explain what it means

* Clarification about the unstaked funds still guaranteeing honest behavior
  • Loading branch information
timothymcmackin authored Jan 13, 2025
1 parent 6e8d294 commit 6aaab9a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions docs/using/staking.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: Staking
authors: "Tim McMackin"
last_update:
date: 20 December 2024
date: 13 January 2025
---

Staking is the process of temporarily locking tez on the Tezos platform in exchange for rewards.
Staked tez stays in the staker's account, but the staker cannot transfer (or spend) that tez.
Stakers can unstake the tez at any time, which makes them spendable again after a delay.
Stakers can unstake the tez at any time, which makes them spendable again after a delay; see [Staking periods and delays](#staking-periods-and-delays).
Staking is an important part of running the Tezos protocol and keeping the blockchain secure, so this is why stakers earn rewards proportional to the locked funds.

Two main groups stake on Tezos:
Expand All @@ -16,7 +16,7 @@ Two main groups stake on Tezos:
Their staked tez ensures that they bake correctly, because part of their stake is taken ("slashed") if they misbehave.
For more information about staking for baking purposes, see [Baking](/architecture/bakers).

- Any Tezos user can stake tez with a baker and earn rewards for them.
- Any Tezos user can stake tez with a baker and earn rewards.
In exchange for staking tez with a baker, users automatically receive a portion of the baker's rewards in proportion to how much they stake.
Users can stake any amount of tez, but there is a limit to how much staked tez a single baker can accept, and bakers must opt in to allow users to stake with them.

Expand Down Expand Up @@ -146,6 +146,24 @@ Now the application shows your liquid balance and any tez that remain staked.
The Tezos protocol distributes staking rewards automatically, without requiring any manual action.
To see them, look up your account on a block explorer such as [TzKT](https://tzkt.io).

## Staking periods and delays

The following diagram shows the reason for the unstaking delay.
The diagram shows cycles as a timeline and assumes that the user has already staked tez with a baker at the start of the timeline.

The system calculates rights for bakers two cycles ahead, so at the end of cycle 1, the system calculates rights for a baker in cycle 4 based on the amount staked with that baker as of the end of cycle 1.
The example user in the diagram submits an unstake request in the middle of cycle 2.
When cycle 2 ends, the system calculates rights for bakers in cycle 5, so the baker will have reduced staking rights in cycle 5 depending on how much the user requested to unstake.

The diagram also shows why users must wait to unfreeze their staked tez.
Because the rights in cycles 3 and 4 were computed before the unstake request, the funds being unstaked must still guarantee the honest behavior of the baker during that period.
The diagram shows a baker misbehaving in cycle 4.
Other bakers have the remainder of cycle 4 and all of cycle 5 to denounce the misbehaving baker, which results in that baker being slashed.
Therefore, funds staked with that baker stay frozen until the end of cycle 5 in case they need to be penalized.
Then, the user can finalize their unstake request.

![A diagram of an unstake request and the period that the user must wait to finalize that request](/img/using/staking-periods-diagram.png)

## More information

For more information about the staking web application and the process of staking from the Tezos user perspective, see the blog post [How to stake your tez and earn 2x rewards](https://spotlight.tezos.com/how-to-stake/).
Binary file added static/img/using/staking-periods-diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6aaab9a

Please sign in to comment.