Overview
Welcome to the second installment of the Help secure Starknet guide! đĄď¸ After running your own full node, you can take an additional step to help secure Starknet by becoming a validator. While running a node already contributes to the networkâs decentralization, becoming a validator allows you to earn rewards while taking on additional responsibilities. This installment of the series will therefore walk you through the validator onboarding process, including staking STRK tokens, setting your commission, opening a delegation pool, and verifying that the procedure was successful.The steps in this installment are demonstrated on Sepolia. For the equivalent addresses on Mainnet, see Chain information.
Prerequisites
Besides the prerequisites for running a full node, becoming a Starknet validator requires three accounts deployed on either Sepolia or Mainnet. To follow this guide, these account should be configured as follows:To understand the role of the each account, read more about validator addresses in the staking protocol.
-
An account with its address exported using:
-
An account with its address exported using:
-
An
sncastaccount namedstakerholding at least the minimum required amount of STRK tokens with its address exported using:
Staking STRK
To become a validator, you must stake least the minimum required amount of STRK tokens by locking them into Starknetâs Staking contract.Approving STRK transfer
To stake your STRK tokens, you first need to approve the transfer of STRK tokens from your staking address to the Staking contract. To do so, use your staking address to invoke the STRK token contractâsapprove function with the following parameters:
- The Staking contractâs address
- The number of STRK tokens to stake
- The STRK contractâs address on Sepolia
- The Staking contractâs address on Sepolia and 1 STRK (STRK has 18 decimals)
Locking STRK
Once the transfer is approved, you can lock your STRK tokens into the Staking contract by using your staking address to invoke the Staking contractâsstake function with the following parameters:
- The address to set as your rewards address
- The address to set as your operational address
- The number of STRK tokens to stake
The number of STRK tokens to stake must match the number specified in the
approve function.- The Staking contractâs address on Sepolia
- 1 staked STRK (STRK has 18 decimals), delegation pooling enabled, and 100/10,000 = 1% commission
Setting commission
Once your STRK tokens are locked, you can initialize your commission by using your staking address to invoke the Staking contractâsset_commission function with the following parameters:
- The commission rate to set for your delegation pool, as a percentage with precision where 10,000 represents 100%
- The Staking contractâs address on Sepolia
- 100/10,000 = 1% commission
Opening delegation pools
Once your commission is initialized, you can open a delegation pool by using your staking address to invoke the Staking contractâsset_open_for_delegation function with the following parameters:
- The token address to set for your delegation pool
- The Staking contractâs address on Sepolia
- The STRK contractâs address on Sepolia
Getting information
To verify that the staking procedure has been successful, you can call the Staking contractâsget_staker_info_v1 function with your staking address as parameter.
For example, the following can be used to verify your staking on Sepolia:
- The Staking contractâs address on Sepolia
- Indicates successfully getting the stakerâs info
- The validatorâs rewards address
- The validatorâs operational address
- The validatorâs stake
- The validatorâs index
- The validatorâs unclaimed rewards
- Indicates successfully getting the delegation poolâs info
- The delegation poolâs stake
- The delegation poolâs unclaimed rewards
- The delegation poolâs commission ()