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
sncast
account namedstaker
holding at least the minimum required amount of STRK tokens with its address exported using:For deploying and funding ansncast
account on Sepolia, see Deploying a new Sepolia account.
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
To review the addresses of all BTC tokenizations (“BTC wrappers”), use the staking contract’s
get_active_tokens
function.- 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 ()