Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions learn/protocol/staking.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ While Starknet is currently still centralized, it is [gradually](#roadmap) movin

Additional resources

- Staking dashboards by [AlignedStake](https://www.aligned-stake.com/), [Ednur](https://dashboard.endur.fi/), [Staking Rewards](https://www.stakingrewards.com/stake-app?input=starknet), [Starkscan](https://starkscan.co/staking), and [Voyager](https://voyager.online/staking-dashboard)
- Staking dashboards by [AlignedStake](https://www.aligned-stake.com/), [Endur](https://dashboard.endur.fi/), [Staking Rewards](https://www.stakingrewards.com/stake-app?input=starknet), [Starkscan](https://starkscan.co/staking), and [Voyager](https://voyager.online/staking-dashboard)
- [Staking](https://www.starknet.io/staking) on starknet.io
- [`starknet-staking`](https://github.com/starkware-libs/starknet-staking/tree/%40staking/contracts-v1.0.1-dev.510) on GitHub (deployed tag)
- [Starknet launches phase 1 of its staking initiative on mainnet](https://www.starknet.io/blog/staking-phase-1/) on the Starknet blog
Expand All @@ -27,7 +27,7 @@ Additional resources

## Roadmap

Naturally, handing over the responsibility for maintaining and securing Starknet to validators in one day is neither feasible nor desirable. Instead, the staking protocol is implemented in incremental phases, with each phase bringing additional requirements from validators until they fully maintain and secure the network. The protocol is currently in the second of four phases, illustrated in following figure:
Naturally, handing over the responsibility for maintaining and securing Starknet to validators in one day is neither feasible nor desirable. Instead, the staking protocol is implemented in incremental phases, with each phase bringing additional requirements from validators until they fully maintain and secure the network. The protocol is currently in the second of four phases, illustrated in the following figure:

<Warning>
The staking protocol is currently in its second phase on both Sepolia and Mainnet.
Expand Down Expand Up @@ -152,7 +152,7 @@ Starting from its second phase, the staking protocol allows validators to increa
The following latencies are set in place:

- To disincentivise sudden large withdrawals that could destabilize the network, funds are subject to a 7-day lockup after signaling an unstake intent, during which no rewards are earned and funds cannot be withdrawn.
- Starting from the second phase of the protocol, to prevent delegator from switching too quickly between validators while still promoting a competitive delegation market, a switch intent that is signaled on epoch $i$ takes effect only on epoch $i+1$.
- Starting from the second phase of the protocol, to prevent delegators from switching too quickly between validators while still promoting a competitive delegation market, a switch intent that is signaled on epoch $i$ takes effect only on epoch $i+1$.

### Addresses

Expand All @@ -161,7 +161,7 @@ To reduce exposure to threats and enhance security, multiple addresses are defin
- Validator addresses:
- Staking address: Used for staking, adding stake, and unstaking. This address is only needed when entering or exiting the protocol and handles large amounts of STRK, and therefore is best kept by a cold wallet with minimal activity.
- Rewards Address: Used for receiving rewards. This address is only needed when receiving rewards, and therefore is best kept by a cold wallet.
- Operational Address: Used for operational purposes, such as block attestations (starting from the protocol's second phase), block proposing (starting from the protocol's third phase), etc. This address is used frequently and doesn't handle large amounts of funds, and therefore is best kept by a hot wallet. Starting from the protocol's second phase, however, hacking the operational address can lead to a lose of yield for the validator and its delegators.
- Operational Address: Used for operational purposes, such as block attestations (starting from the protocol's second phase), block proposing (starting from the protocol's third phase), etc. This address is used frequently and doesn't handle large amounts of funds, and therefore is best kept by a hot wallet. Starting from the protocol's second phase, however, hacking the operational address can lead to a loss of yield for the validator and its delegators.

<Warning>
If your operational address uses local signing, the account associated with it must be deployed and unprotected (e.g., no Ready Wallet Guardian or Braavos hardware signer).
Expand Down Expand Up @@ -202,7 +202,7 @@ To invoke onchain contracts, use [`Starknet Foundry's sncast`](https://foundry-r
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Staking | Invoke the staking contract's [`stake`](https://github.com/starkware-libs/starknet-staking/blob/main/docs/spec.md#stake) function | • You should make sure you are [running a fully synchronized node](#validator-responsibilities) before staking<br />• You must first approve the transfer of the amount of STRK tokens to be staked to the staking contract by invoking the STRK contract's `approve` function<br />• `operational_address` should have sufficient funds to pay for attestation transactions<br />• `amount` should be equal or greater than the [minimum stake for validators](#protocol) and denominated in FRI (i.e., 1\*10<sup>18</sup> = 1 STRK)<br />• Attesting to blocks is only possible starting from the epoch following a successful stake |
| Initializing or updating commission | Invoke the staking contract's [`set_commission`](https://github.com/starkware-libs/starknet-staking/blob/main/docs/spec.md#set_commission) function | • `commission` should be entered as a percentage with precision, where 10,000 represents 100% (e.g., to set a 5% commission, you enter 500)<br />• Commissions can be increased only after [setting a commission commitment](#commissions) using [`set_commission_commitment`](https://github.com/starkware-libs/starknet-staking/blob/main/docs/spec.md#set_commission_commitment) |
| Opening delegation | Invoke the staking contract's [`set_open_for_delegation`](https://github.com/starkware-libs/starknet-staking/blob/main/docs/spec.md#set_open_for_delegation) function | Opening delegation is is only possible after initializing the commission using `set_commission` |
| Opening delegation | Invoke the staking contract's [`set_open_for_delegation`](https://github.com/starkware-libs/starknet-staking/blob/main/docs/spec.md#set_open_for_delegation) function | Opening delegation is only possible after initializing the commission using `set_commission` |
| Claiming rewards | Invoke the staking contract's [`claim_rewards`](https://github.com/starkware-libs/starknet-staking/blob/main/docs/spec.md#claim_rewards) function | |
| Increasing stake | Invoke the staking contract's [`increase_stake`](https://github.com/starkware-libs/starknet-staking/blob/main/docs/spec.md#increase_stake) function | • `amount` should be denominated in FRI (i.e., 1\*10<sup>18</sup> = 1 STRK)<br />• You must first approve the transfer of STRK tokens to the staking contract by invoking the STRK contract's `approve` function |
| Changing reward address | Invoke the staking contract's [`change_reward_address`](https://github.com/starkware-libs/starknet-staking/blob/main/docs/spec.md#change_reward_address) function | |
Expand All @@ -222,4 +222,4 @@ To invoke onchain contracts, use [`Starknet Foundry's sncast`](https://foundry-r
| Adding to a delegation pool | Invoke the delegation pool contract's [`add_to_delegation_pool`](https://github.com/starkware-libs/starknet-staking/blob/main/docs/spec.md#add_to_delegation_pool) function | • Adding to a delegation pool is only possible after entering it using `enter_delegation_pool`<br />• `amount` should be denominated in the token's base unit (e.g., FRI for STRK)<br />• You must first approve the transfer of STRK tokens to the delegation pool contract by invoking the STRK contract's `approve` function |
| Switching delegation pools | Invoke the delegation pool contract's [`switch_delegation_pool`](https://github.com/starkware-libs/starknet-staking/blob/main/docs/spec.md#switch_delegation_pool) function | To prevent delegator from switching too quickly between validators while still promoting a competitive delegation market, a switch intent that is signaled on epoch $i$ takes effect only on epoch $i+1$. |
| Changing reward address | Invoke the delegation pool contract's [`change_reward_address`](https://github.com/starkware-libs/starknet-staking/blob/main/docs/spec.md#change_reward_address-1) function | |
| Exiting a delegation pool | Invoke the delegation pool contract's [`exit_delegation_pool_intent`](https://github.com/starkware-libs/starknet-staking/blob/main/docs/spec.md#exit_delegation_pool_intent) and [`exit_delegation_pool_action`](https://github.com/starkware-libs/starknet-staking/blob/main/docs/spec.md#exit_delegation_pool_action) function | `exit_delegation_pool_action` should be invoked only after the appropriate [waiting period](#latencies) has ended |
| Exiting a delegation pool | Invoke the delegation pool contract's [`exit_delegation_pool_intent`](https://github.com/starkware-libs/starknet-staking/blob/main/docs/spec.md#exit_delegation_pool_intent) and [`exit_delegation_pool_action`](https://github.com/starkware-libs/starknet-staking/blob/main/docs/spec.md#exit_delegation_pool_action) function | `exit_delegation_pool_action` should be invoked only after the appropriate [waiting period](#latencies) has ended |