Skip to main content

Auto-Claim Rewards

The validator can claim your staking rewards automatically. Once the unclaimed rewards reach a configured threshold, the validator sends a claim_rewards transaction to the staking contract. This transaction will transfer the rewards to the designated reward address.

To configure this, 5 new flags are made available. Full descriptions are available in Configuration Options:

  • reward-address sets the account that sends the claim_rewards transactions. It must be either the staker address or the staker's reward address.
  • reward-priv-key (or reward-signer-url) to sign for the claim_rewards transactions.
  • reward-claim-threshold is the amount after which a claim_rewards transaction will trigger.
  • reward-claim-max-fee is the maximum fee you're willing to pay to execute this transaction.

There are Metrics endpoints made available for this feature.

You can add these new flags to your current config:

docker run --network host \
--user "$(id -u):$(id -g)" \
-v /path/to/config.json:/app/config/config.json \
nethermind/starknet-staking-v2 \
--config /app/config/config.json \
--reward-address "0x789" \
--reward-signer-url "http://localhost:8081" \
--reward-claim-threshold 100 \
--reward-claim-max-fee 1000000000000000000
Delegation pools

Only the staker's own rewards are claimed, which include its commission on the delegated stake. Rewards of the delegation pool members are sent directly to the pool contracts by the staking protocol and claimed by the members themselves, so they are not affected by this feature.

Reward account balance

The reward account pays the fee of the claim transactions, so it needs enough STRK to cover it. When the feature is enabled, the balance of the reward account is checked against --balance-threshold at startup and after every attestation window, just like the operational account, and reported through the validator_attestation_reward_balance and validator_attestation_reward_below_threshold metrics.

External Signing​

The reward account can be signed for externally using the same HTTP protocol as the operational account. The external signer must hold the private key of the reward account, so it is usually a separate signer instance from the one used for attestations. It must be running when the validator starts, since its availability is checked at startup.