Using Flare Stake Tool
Staking works by locking funds for a period of time to support a specific network validator. The guide details out how to stake using the flare-stake-tool CLI.
Understand staking on Flare.
When validator owners stake to their own nodes they self-bond, whereas all other participants are said to delegate their stake to that validator. Note that delegating your stake to a validator is different from FTSO delegation.
Participants choose how much to stake and for how long their stake will be locked. The minimum values are:
| Self-bond | Delegation | |
|---|---|---|
| Minimum amount | 1M FLR | 50K FLR |
| Minimum duration | 60 days | 14 days |
On Coston2, the minimum durations are 7 days for a self-bond and 24 hours for a delegation.
At the end of every reward epoch (i.e. 3.5 days on Flare Mainnet), participants are rewarded according to how well their chosen validator performed in that period.
Limits
The amount that you can stake and the rewards you can gain by staking are restricted by these limits:
-
Delegation factor: Limits the total amount that can be staked to a validator to its self-bond, which is the amount validators stake to their own nodes, times the delegation factor, which is 15. For example, if a validator has a self-bond stake of 1M FLR, the total sum of all stakes, including delegations, cannot exceed 15M FLR. This limit allows for 14M FLR of delegations.
-
Staking cap: Limits the reward performance of individual validators to 5% of the total staked amount. If you stake your funds on a validator with more than 5% of the total staked amount, you receive less FLR in reward. To maximize your reward, delegate your staking funds to a validator with less than 5% of the total staked amount of FLR.
-
Maximum number of validators: Rewards, FlareDrops, and governance vote power only apply for up to 3 different validators at a time. On Flare and Coston2, the stake tool therefore refuses a stake or delegation to a fourth validator while stakes to three others are still active.
Given that the Flare network uses two independent underlying chains, there is one extra step that must be considered. Funds must be transferred from the C-chain, where smart contracts run, to the P-chain, where staking happens. After the staking period expires and funds are unlocked, they can be transferred back to the C-chain.
Prerequisites
Install the following tools:
- Node.js 24 or newer (which includes npm)
Setup
-
Install the
flare-stake-toolCLI:npm install @flarenetwork/flare-stake-tool -gLedger supportLedger support needs the USB module
node-hid, whose install script npm runs when it installs the tool. If your npm is configured withignore-scripts=true, run that script afterwards:npm rebuild node-hid --global --ignore-scripts=false -
Verify installation:
flare-stake-tool --versionThe tool prints its version, which must be 5.x:
5.2.0 -
You can specify the account from which staking will take place in different ways - using Ledger or using a private key. The only recommended way is to use a Ledger device.
Using Ledger (recommended)
-
Connect your Ledger device to your computer and unlock it. Launch the Ledger Wallet (previously called Ledger Live) application and navigate to the My Ledger tab and ensure your device firmware is up-to-date.
-
In the App Catalog tab, search for Flare, Click Install. The Flare app shows P-chain transactions decoded on the device. The Avalanche app also works, but it signs P-chain transactions by their hash and needs blind signing enabled in its settings. The Ethereum app signs only C-chain transactions, such as claiming rewards; the tool refuses it for P-chain transactions and for moving funds between the chains.
Blind signingClaiming rewards is a contract call that every app signs blindly, because Ledger has no clear-signing data for Flare's contracts. Enable blind signing in the app's settings before you claim, and check the tool's summary of the transaction before you confirm it. When the tool asks the device to sign a hash, it prints the hash first: approve only if the device shows the same one.
App SizeOn a Ledger Nano S, you may need to remove other apps if space is insufficient.
-
Exit Ledger Wallet and ensure the device is not connected to any other applications like MetaMask. Open the Flare app on your Ledger device.
-
Open a terminal and run the following command to start the staking tool in interactive mode:
flare-stake-tool interactive -
After the welcome banner, the tool prompts you to connect your wallet:
? How do you want to connect your wallet? (Use arrow keys)
> Ledger
Private Key (not recommended!)
QuitSelect Ledger using the arrow keys and press Enter.
-
The next prompt asks you to choose the network:
? Which network do you want to connect to? (Use arrow keys)
> Flare (mainnet)
Songbird (canary)
Coston2 (testnet)
Coston (testnet)
LocalHost (devnet)Select Flare (mainnet) and press Enter.
The tool then asks which derivation path to use: BIP44 (Default) (
m/44'/60'/0'/0/n) or Ledger Live (m/44'/60'/n'/0/0), the path Ledger Wallet uses for its accounts. Choose the one your account was created with. A "Fetching Addresses..." message appears briefly. -
The tool will then display a list of addresses linked to your Ledger device, select the desired address and press Enter. The Ledger then shows that address: check that it matches the address in the terminal, and approve it on the device. Ensure this address has a sufficient
FLRbalance for transaction fees and staking. Funds can be transferred later if needed.The main menu will now appear:
? What do you want to do? (Use arrow keys)
View chain addresses
> Check on-chain balance
View stakes
Get validator info
Move assets from C-chain to P-chain
Move assets from P-chain to C-chain
Add a validator node
Delegate to a validator node
Import Funds (exported, not yet imported)
Transfer funds to another P-chain address
Claim staking rewards
Add an auto-renewed validator node
Change the auto-renew period of a validator node
QuitAs an example, select Check on-chain balance and press Enter. The tool displays the C-chain and P-chain balances and returns to the main menu. Select Quit to exit.
After completing the setup, a ctx.json file is created in the current folder.
This file stores the selected account details, allowing you to skip the setup process on subsequent uses from the same folder.
Using private key
Using a private key stored in a plain text file is insecure and should be avoided whenever possible. It is highly recommended to use Ledger instead.
-
Create a text file (e.g.
/home/wallet/pvtKeyFile) in a secure folder accessible only to you. -
Open the file and insert one of the following lines, with your key between the quotes:
PRIVATE_KEY_HEX="<64 hexadecimal characters>"
PRIVATE_KEY_CB58="<key in CB58 format>"Use
PRIVATE_KEY_HEXif your key is 64 hexadecimal characters, orPRIVATE_KEY_CB58if it's in CB58 format. Don't add anything after the closing quote: the tool reads a comment there as part of the key and refuses it. -
Open a terminal and run the following command to start the staking tool in interactive mode:
flare-stake-tool interactive -
After the welcome banner, the tool prompts you to connect your wallet:
? How do you want to connect your wallet? (Use arrow keys)
Ledger
> Private Key (not recommended!)
QuitSelect Private Key using the arrow keys and press Enter.
-
Enter the full path of your private key file and press Enter:
? Enter Path to Private Key file (E.g. /home/wallet/pvtKeyFile): -
The next prompt asks you to choose the network:
? Which network do you want to connect to? (Use arrow keys)
> Flare (mainnet)
Songbird (canary)
Coston2 (testnet)
Coston (testnet)
LocalHost (devnet)Select Flare (mainnet) and press Enter.
-
The main menu will now appear:
? What do you want to do? (Use arrow keys)
View chain addresses
> Check on-chain balance
View stakes
Get validator info
Move assets from C-chain to P-chain
Move assets from P-chain to C-chain
Add a validator node
Delegate to a validator node
Import Funds (exported, not yet imported)
Transfer funds to another P-chain address
Claim staking rewards
Add an auto-renewed validator node
Change the auto-renew period of a validator node
QuitAs an example, select Check on-chain balance and press Enter. The tool displays the C-chain and P-chain balances and returns to the main menu. Select Quit to exit.
Check validator info
-
Note down the
NodeIDof the validator you want to stake to:-
If you created the validator, retrieve its
NodeID,publicKeyandproofOfPossessionby running:curl \
--location 'http://localhost:9650/ext/info' \
--header 'Content-Type: application/json' \
--data '{ "jsonrpc":"2.0", "id":1, "method":"info.getNodeID" }' -
If you want to stake to somebody else's validator, get a JSON list of all validators by running:
flare-stake-tool info validators
-
-
Note down the desired staking end time: The stake starts when the network accepts the transaction. When staking to an existing validator, the end time must be inside the period when the validator is active. For an auto-renewed validator, it must be inside the validator's current cycle. Otherwise the tool refuses the delegation before anything is signed.
Move funds to P-chain
-
Check your C-chain and P-chain balances by selecting the Check on-chain balance option when executing:
flare-stake-tool interactiveYour currently available funds on the C-chain and P-chain are shown in the last lines. Funds currently staked are locked and are not reflected in the P-chain balance. They will become automatically available when the staking period expires.
? How do you want to connect your wallet? Ledger
You already have a ctx.json with the following parameters:
Wallet: ledger
Public Key: ●●●●●●●●●●●●●●●●
Network: flare
Eth Address: 0x●●●●●●●●
? Do you wish to continue with this? Yes
? What do you want to do? Check on-chain balance
Balances on the network "flare"
C-chain 0x●●●●●●●●: 100000 FLR
P-chain P-flare●●●●●●●●: 50000 FLRIf you already have funds on the P-chain, skip the next step.
-
Select the Move assets from C-chain to P-chain option when executing:
flare-stake-tool interactiveYou are asked the amount of FLR you want to transfer:
? What do you want to do? Move assets from C-chain to P-chain
? Enter amount (in FLR): 50000
? Enter fee (in FLR) (Enter accepts 0.011 FLR: twice the current base fee, headroom for a rise before it lands):Transaction FeesWhen transferring from the C-chain to the P-chain, the export's fee is paid from the C-chain, and the import's fee is taken from the funds that arrive on the P-chain. Make sure you leave enough funds on the C-chain for the export's fee, or it will fail.
-
Transfers between chains are made of two operations: an export from the C-chain followed by an import to the P-chain. Therefore, you are asked to confirm two transactions. Before each one, the tool shows what it is about to sign: check the account, the amount and the fee before you confirm.
Please approve export transaction
About to sign exportCP on flare:
Account: 0x●●●●●●●● / P-flare●●●●●●●●
Amount: 50000 FLR from the C-chain to the P-chain
Fee: 0.011 FLR
? Sign and send this transaction? Yes
Transaction with hash ●●●●●●●● built and sent to the network
Fee paid: 0.011 FLR
Please approve import transaction
About to sign importCP on flare:
Account: 0x●●●●●●●● / P-flare●●●●●●●●
Amount: ●●●●●●●● FLR to the P-chain
Fee: ●●●●●●●● FLR
? Sign and send this transaction? Yes
Transaction with hash ●●●●●●●● built and sent to the network
Fee paid: ●●●●●●●● FLR
If you encounter any issues during this process, refer to the Troubleshooting section.
Stake
-
After you have funds on the P-chain, execute the following command and select the appropriate option:
flare-stake-tool interactive-
If you are going to delegate to your own node (self-bonding), select Add a validator node.
-
If you are going to stake to another node (delegation), select Delegate to a validator node (You may need to scroll down to see this option).
-
-
You then need to provide the following information:
- amount: Amount must be provided in FLR units.
- NodeID and end time: Use the values noted down from the setup.
If you are adding a validator node, you also need to provide the proof of possession BLS public key and BLS signature.
Retrieve these details using the following command:
curl -X POST --data '{
"jsonrpc":"2.0",
"id" :1,
"method" :"info.getNodeID"
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info | jqThe output will be similar to the following:
{
"jsonrpc": "2.0",
"result": {
"nodeID": "NodeID-CGeHNYkQJX4qb21x976PEcNt3FqsUZfXL",
"nodePOP": {
popBLSPublicKey ---> "publicKey": "0xb6a40b905128c010e4d7b0cbd6f7b7912a1da9a6022a8c720887b5183a4f2f109c678027316ae4757f7f987f1fa5addb",
popBLSSignature ---> "proofOfPossession": "0xb9394ef2992a77a3b70440c2fdb3b2a53f23fb8579460322b69a290bf3de7fafc2665b155b5300c08a1e7bcb45bb7eaf0ca7f596650b0423f61f329744e37f6908c1d7e4191378d5f0ff7fd7f8abd02d37a2be9dd95635a0b1f744b043cb5d9e"
}
},
"id": 1
} -
If you selected Add a validator node, you have to set the delegation fee. This is the percentage of all rewards that the node owner keeps. The rest is split proportionally between the self-bond and all delegators that contributed stake. 10 means 10%, so the maximum value is 100. On Flare and Coston2, the minimum is 20%, which is also what the tool uses when you press Enter.
? What do you want to do? Add a validator node
? Enter amount (in FLR): 1000000
? Enter NodeId (E.g. NodeID-FQKTLuZHEsjCxPeFTFgsojsucmdyNDsz1): NodeID-●●●●●●●●
? Enter end time (unix seconds, e.g. 1693185095, or a duration from now such as 2d12h): ●●●●●●●●
? Enter delegation fee (E.g. 10; Enter accepts 20%): 20
? Please enter the popBLSPublicKey: 0x●●●●●●●●
? Please enter the popBLSSignature: 0x●●●●●●●● -
The tool shows a summary of the transaction, including the account, network, amount, node, end time and fee, and asks you to confirm it. After you confirm, approve the transaction on your hardware wallet.
? Sign and send this transaction? YesYour stake is now locked and starts accruing rewards once the network accepts the transaction. When the end time arrives, the funds will be automatically unlocked.
If you encounter any issues, refer to Troubleshooting.
Auto-renewed validators
Since the Helicon upgrade (go-flare v1.15.1), a validator can be registered without an end time. Its stake is renewed automatically every period, as long as the node keeps at least 90% uptime in each cycle, until you stop it. If the node misses the uptime requirement, the validator ends with its current cycle and its stake is returned.
-
Select Add an auto-renewed validator node when executing
flare-stake-tool interactive. Instead of an end time, the tool asks for the validation period, in seconds or as a duration such as60d. The period must be within the network's minimum and maximum stake duration. -
To change the period from the next cycle on, select Change the auto-renew period of a validator node. A period of
0stops renewal, and the stake is returned at the end of the current cycle. Only the validator authority, by default the address that registered the validator, can change the period.
The same operations are available as commands:
flare-stake-tool addAutoRenewedValidator -n <nodeId> -a <amount> --period 60d --delegation-fee <delegation-fee> --pop-bls-public-key <popBlsPublicKey> --pop-bls-signature <popBlsSignature> --ledger --network flare
flare-stake-tool setAutoRenewedValidatorConfig -n <nodeId> --period 0 --ledger --network flare
Check Stake
-
To list your own stakes and delegations, run:
flare-stake-tool info stakesOr select View stakes in interactive mode. The command uses the account saved in
ctx.jsonby the Ledger setup; for a private-key account, add--env-path <path to your key file> --network flare. The tool lists each stake with its node, amount, end time and transaction ID, then the number of different validators you stake to and the total:Stakes on the network "flare"
P-flare●●●●●●●●: 2 stakes on 2 nodes (at most 3 nodes at once on flare)
delegation NodeID-●●●●●●●● 50000 FLR, ends 2026-12-01T00:00:00.000Z (1796083200), tx ●●●●●●●●
validation NodeID-●●●●●●●● 1000000 FLR, ends 2027-01-01T00:00:00.000Z (1798761600), tx ●●●●●●●●
Total staked: 1050000 FLRCheck that the node, amount and end time match the values you configured. For an auto-renewed validator, the line shows the end of its current cycle. Add
--jsonto get the same information as JSON, for scripts. -
For the details of the validators themselves, such as their delegation fee, uptime and delegations, run
flare-stake-tool info validators. It prints all current validators as JSON, with amounts (weight) in nFLR: 1 FLR is 1,000,000,000 nFLR.
Move funds back to C-chain
-
Finally, you also have the option to move your P-chain funds back to the C-chain where they can participate in the wider ecosystem. You can only transfer P-chain funds that are not currently locked in any stake. Select the Move assets from P-chain to C-chain option when executing:
flare-stake-tool interactive -
You are asked the amount of FLR you want to transfer. The prompt offers your whole spendable P-chain balance, less the export's fee: press Enter to move all of it, or type another amount.
? What do you want to do? Move assets from P-chain to C-chain
? Enter amount (in FLR): 50000Transaction FeesWhen transferring from the P-chain to the C-chain, the export's fee is paid from the P-chain, and the import's fee is taken from the funds that arrive on the C-chain. Make sure you leave enough funds on the P-chain for the export's fee, or it will fail.
-
Again, the transfer between the two chains require you to confirm two transactions.
Please approve export transaction
? Sign and send this transaction? Yes
Transaction with hash ●●●●●●●● built and sent to the network
? Enter fee (in FLR) (Enter accepts 0.011 FLR: twice the current base fee, headroom for a rise before it lands):
Please approve import transaction
? Sign and send this transaction? Yes
Transaction with hash ●●●●●●●● built and sent to the network
If you encounter any issues, refer to Troubleshooting.
Claiming staking rewards
At the end of every reward epoch, participants are rewarded according to how well their chosen validator performed in that period, but these rewards are not claimable yet. Every 4 reward epochs, rewards are accumulated in a dedicated smart contract and can then be claimed from the Flare Stake CLI tool:
-
Select the Claim staking rewards option when executing:
flare-stake-tool interactiveYou are shown the amount of pending rewards and are asked how much you want to claim (in FLR):
? What do you want to do? Claim staking rewards
State of rewards for 0x●●●●●●●●:
Total rewards: 2000 FLR
Claimed rewards: 1010 FLR
Unclaimed rewards: 990 FLR -
Claim all or a portion of the rewards and optionally choose to wrap them or not:
- Claim All
- Claim Partial
? Do you want to claim all unclaimed rewards? (total unclaimed: 990 FLR) Yes
? Should claimed rewards be wrapped? Yes? Do you want to claim all unclaimed rewards? (total unclaimed: 990 FLR) No
? Please enter the amount to claim: 100
? Should claimed rewards be wrapped? Yes -
Decide the recipient address for the rewards - defaults to the address you used to connect to the Flare Stake Tool.
? Please enter the recipient address (default address is reward owner): 0x●●●●●●●●You are then asked to confirm the claim transaction and approve it on your hardware wallet.
? Sign and send this transaction? Yes
Transaction with hash 0x●●●●●●●● built and sent to the network
Transfer P-chain funds to another P-chain address
-
You can transfer P-chain funds to another P-chain address by selecting the Transfer funds to another P-chain address option:
flare-stake-tool interactive? What do you want to do?
❯ Transfer funds to another P-chain address
Claim staking rewards
Add an auto-renewed validator node -
Select the amount to transfer and the destination P-chain address:
? Enter amount (in FLR): 100
? Enter destination P-chain address: P-flare●●●●●●●●
? Sign and send this transaction? Yes
Transaction with hash ●●●●●●●● built and sent to the network
Troubleshooting
Details
T1. Cannot connect to Ledger device, no Device, cannot retrieve addresses, or similar.
Make sure:
- The device is connected and the Flare (or Avalanche) app is open.
- No other application like Ledger Wallet or MetaMask is connected to the device.
- The device is not in stand-by mode.
- You are not running on Windows from a Linux terminal (WSL). Use a native Windows console instead.
Details
T2. Insufficient funds.
Make sure enough funds will remain after a transaction to pay for the transaction fees. If too much time has elapsed between the transaction's creation and its confirmation on the Ledger, the calculated fee might be incorrect. Try the operation again. The network might be congested and the calculated fees might not be high enough. Try the operation again after a while.
Details
T3. Import transaction failed and the funds have vanished.
Transfer operations require an export and an import transaction. If the export succeeds, but then the import fails, it looks like the funds have disappeared from both chains, but they are still retrievable.
Import the funds using the interactive tool:
-
If you are moving funds from the C-chain to the P-chain:
flare-stake-tool interactive? What do you want to do?
❯ Import Funds (exported, not yet imported)? Please select the destination chain to which you want to import your funds? (Use arrow keys)
❯ P -
If you are moving funds from the P-chain to the C-chain:
flare-stake-tool interactive? What do you want to do?
❯ Import Funds (exported, not yet imported)? Please select the destination chain to which you want to import your funds? (Use arrow keys)
❯ C
Details
T4. The Ledger USB module node-hid has no binary.
npm installed the tool without running the install script of node-hid, the module that talks to the Ledger, for example because your npm is configured with ignore-scripts=true.
Every command works except those that use the Ledger.
Run the script with:
npm rebuild node-hid --global --ignore-scripts=false
Details
T5. The Ledger Ethereum app cannot sign P-chain or atomic transactions.
The Ethereum app signs only C-chain transactions. Open the Flare app on the device and retry.
FAQs
Details
F1. How do I register my address manually?
You can register your address manually using the block explorer and the AddressBinder smart contract.
-
Retrieve the public key that generated the accounts you want to use. From a terminal, run:
flare-stake-tool info addressesAs with
info stakes, add--env-path <path to your key file> --network flarefor a private-key account. Copy the hexadecimal string starting with0xin the last line.Addresses on the network "flare"
P-chain address: P-flare●●●●●●●●
C-chain address hex: 0x●●●●●●●●
secp256k1 public key: 0x●●●●●●●●●●●●●●●● -
Retrieve the
AddressBindercontract address from theFlareContractRegistry. -
Enter the address of the
AddressBindercontract in the block explorer, and go to the Write Contract tab. -
Click on Connect Wallet. You do not need to use the same account as the one you are binding.
-
Locate the
registerPublicKeymethod and paste the public key from step 1 into the_publicKeyfield. -
Click on Write and confirm the transaction from your wallet.
If the transaction is successful, your account's P-chain and C-chain addresses are now bound.
Details
F2. How do I claim rewards manually?
You can claim rewards manually using the block explorer and the ValidatorRewardManager smart contract.
- Retrieve the
ValidatorRewardManagercontract address from theFlareContractRegistry. - Enter the address of the
ValidatorRewardManagercontract in the block explorer, and go to the Write Contract tab. - Click on Connect Wallet. You need to connect the account for which you are claiming.
- Locate the
claimmethod and enter the following information:_rewardOwner: C-chain address that accrued the rewards._recipient: Address where the rewards must be sent._rewardAmount: Amount to claim. Find the pending amount using thegetStateOfRewardsmethod in the Read Contract tab._wrap: Whether the rewards should be also wrapped, as a convenience.
- Click on Write and confirm the transaction from your wallet.
If the transaction is successful, the reward is transferred to the specified recipient.