How to Delegate with Unlocked FLOW
This document outlines the steps a token holder can take to delegate
with normal, unlocked FLOW tokens to a node using the FlowIDTableStaking
contract.
This guide covers delegation with unlocked FLOW tokens. Please see the locked delegating guide for delegating with locked tokens from the Flow community sale.
Setup
Register as a Delegator
To register as a delegator, the token holder can use the Register Delegator (SC.19) transaction with the following arguments:
Argument | Type | Description |
---|---|---|
id | String | The ID of the node to delegate to. |
amount | UFix64 | The number of FLOW tokens to delegate. |
This transaction registers the account as a delegator to the node ID they specified.
Delegate New Tokens
The token holder can delegate additional tokens after registering as a delegator.
Note: this transaction delegates additional tokens to the same node that was registered in the setup phase.
To delegate new tokens, the token holder can use the Delegate New FLOW (SC.20) transaction with the following arguments:
Argument | Type | Description |
---|---|---|
amount | UFix64 | The number of FLOW tokens to delegate. |
Re-delegate Unstaked Tokens
After delegated tokens become unstaked, the token holder can choose to re-delegate the unstaked tokens to the same node.
To delegate unstaked tokens, the token holder can use the Re-delegate Unstaked FLOW (SC.21) transaction with the following arguments:
Argument | Type | Description |
---|---|---|
amount | UFix64 | The number of unstaked FLOW tokens to delegate. |
Re-delegate Rewarded Tokens
After earning rewards from delegation, the token holder can choose to re-delegate the rewarded tokens to the same node.
To delegate rewarded tokens, the token holder can use the Re-delegate Rewarded FLOW (SC.22) transaction with the following arguments:
Argument | Type | Description |
---|---|---|
amount | UFix64 | The number of rewarded FLOW tokens to delegate. |
Unstake Delegated Tokens
The token holder can submit a request to unstake their delegated tokens at any time. If the tokens aren't staked yet, they will be uncommitted and available to withdraw.
To unstake delegated tokens, the token holder can use the Unstake Delegated FOW (SC.23) transaction with the following arguments:
Argument | Type | Description |
---|---|---|
amount | UFix64 | The number of FLOW tokens to unstake. |
Note: unstaked delegated tokens will be held by the central staking contract for a period of time (the rest of the current epoch plus all of the next epoch) before they are released to the token holder. Once the tokens are released (unstaked), they can be claimed via the Withdraw Unstaked Tokens action below.
Withdraw Unstaked Tokens
After delegated tokens become unstaked, the token holder can withdraw them from the central staking contract.
To withdraw unstaked tokens, the token holder can use the Withdraw Unstaked FLOW (SC.24) transaction with the following arguments:
Argument | Type | Description |
---|---|---|
amount | UFix64 | The number of unstaked FLOW tokens to withdraw. |
This transaction moves the unstaked tokens back into the FlowToken.Vault
owned by the token holder.
Withdraw Rewarded Tokens
After earning rewards from delegation, the token holder can withdraw them from the central staking contract.
To withdraw rewarded tokens, the token holder can use the Withdraw Rewarded FLOW (SC.25) transaction with the following arguments:
Argument | Type | Description |
---|---|---|
amount | UFix64 | The number of rewarded FLOW tokens to withdraw. |
This transaction moves the rewarded tokens back into the FlowToken.Vault
owned by the token holder.
Delegate to Multiple Nodes from the Same Account
Currently, the default delegating transactions can only be used as they are to stake one node per account.
If a token holder wants to create a second delegating relationship using the transactions as is, they must create a new account and transfer their tokens to the new account.
It is possible to have multiple delegator objects per account by storing the node objects at different storage paths, but this would require small changes to these transactions to use the new storage paths.
Stake from the Same Account
An account that registers as a delegator can also register as a staked node in the same account. See the Staking Guide for how to register a node.