Exiting the Staking Protocol
Exiting the staking protocol involves either unstaking your STRK tokens as a validator or undelegating your stake as a delegator. Both processes require you to first signal your intent to exit, followed by an action to finalize the process after a waiting period.
Unstaking as a Validator
Validators can unstake their STRK tokens, which involves pausing rewards and exiting the staking contract.
-
The validator must not currently be in the unstake process.
-
Signal Unstake Intent:
-
Using a Starknet block explorer, navigate to the staking contract.
-
In the contract interface, locate and select the
unstake_intent
function. -
Submit the transaction to initiate the unstake process. This will record the unstake intent, pause rewards collection, and set a waiting period.
-
-
Finalize Unstake:
-
After the waiting period has passed, return to the staking contract.
-
In the contract interface, locate and select the
unstake_action
function. -
Enter the following parameters:
-
In
staker_address
, enter the validator’s address.
-
-
Submit the transaction to finalize the unstaking process and transfer the staked STRK tokens back to the validator’s account.
-
Any address can initiate the |
Ensure that enough time has passed since signaling your unstake intent. If the waiting period has not expired, the |
Undelegating as a Delegator
Delegators can undelegate part or all of their stake from a validator’s delegation pool by following a similar process. The amount
parameter determines how much of the stake will be undelegated, and it must be less than or equal to the total delegated amount.
-
A Starknet-compatible block explorer or CLI tool.
-
The delegator must not currently be in the undelegation process.
-
The contract address of the delegation pooling contract.
-
Signal Undelegation Intent:
-
Using a Starknet block explorer, navigate to the delegation pooling contract.
-
In the contract interface, locate and select the
exit_delegation_pool_intent
function. -
Enter the
amount
parameter, which determines the size of the undelegation. The amount must be less than or equal to your total delegated amount. -
Submit the transaction to initiate the undelegation process. This will record the undelegation intent for the specified amount, pause rewards collection, and set a waiting period.
-
-
Finalize Undelegation:
-
After the waiting period has passed, return to the delegation pooling contract.
-
In the contract interface, locate and select the
exit_delegation_pool_action
function. -
Enter the following parameters:
-
In
pool_member
, enter the delegator’s address.
-
-
Submit the transaction to finalize the undelegation process and transfer the undelegated STRK tokens (based on the amount previously specified) back to the delegator’s account.
-
Any address can initiate the |
Ensure that enough time has passed since signaling your undelegation intent. If the waiting period has not expired, the |
Additional Notes
-
When a validator unstakes, any unclaimed rewards are automatically transferred to the reward address before the stake is returned.
-
Similarly, when a delegator undelegates, any unclaimed rewards are automatically transferred to the delegator’s reward address.
For more details on the staking and delegation processes, see Staking Contract Architecture.