Becoming a Validator
Becoming a validator allows you to actively contribute to Starknet’s security and decentralization — and earn rewards for doing so.
To do this, you must stake at least the minimum required amount of $STRK tokens by locking them into the Starknet Staking Contract.
Installing Starkup
starkup is the official Cairo toolchain installer.
It helps you install and manage all tools required for Cairo development and interaction with Starknet smart contracts.
Install it with:
curl --proto '=https' --tlsv1.2 -sSf https://sh.starkup.sh | sh -s -- --version-set latest
Reload your shell environment to apply changes:
source /root/.bashrc
Verify that sncast is available in your PATH:
which sncast
Creating a Staking Account
To interact with the Starknet blockchain, you first need an account.
Create and deploy one using sncast (assuming your local RPC listens on port 9545):
sncast account create --name staker --url http://localhost:9545
After running this command, note the generated address and export it as your staker address:
export STAKER_ADDRESS=
Fund your new account with STRK to cover gas fees, then deploy it:
sncast account deploy --name staker --url http://localhost:9545
Approving $STRK Transfer
Before you can stake, you must approve the transfer of your $STRK tokens from your staking address to the Staking Contract.
sncast --account=staker invoke \
--contract-address=0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d \
--function=approve \
--arguments=0x00ca1702e64c81d9a07b86bd2c540188d92a2c73cf5cc0e508d949015e7e84a7,1000000000000000000 \
--network=mainnet
Parameters:
0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d— $STRK contract address0x00ca1702e64c81d9a07b86bd2c540188d92a2c73cf5cc0e508d949015e7e84a7— Mainnet Staking Contract address1000000000000000000— 1 $STRK token
Self-Staking $STRK Tokens
Once the transfer is approved, you can lock your tokens in the Staking Contract.
Use your staking address to invoke the contract’s stake function with the following parameters:
sncast --account=staker invoke \
--contract-address=0x00ca1702e64c81d9a07b86bd2c540188d92a2c73cf5cc0e508d949015e7e84a7 \
--function=stake \
--arguments=$STAKER_ADDRESS,$STAKER_ADDRESS,1000000000000000000 \
--network=mainnet
Parameters:
- First
$STAKER_ADDRESS— Address used as the rewards address - Second
$STAKER_ADDRESS— Address used as the operational address 1000000000000000000— Amount to stake (1 $STRK token)
Setting Commission
Validators can set a commission rate to receive a percentage of rewards generated by their delegators. The commission value is expressed in basis points, where 10,000 = 100%.
sncast --account=staker invoke \
--contract-address=0x00ca1702e64c81d9a07b86bd2c540188d92a2c73cf5cc0e508d949015e7e84a7 \
--function=set_commission \
--arguments=1000 \
--network=mainnet
Parameters:
0x00ca1702e64c81d9a07b86bd2c540188d92a2c73cf5cc0e508d949015e7e84a7— Staking Contract address1000— Commission rate (10%)
Opening Delegation Pools
Open your delegation pool to allow other users to delegate their stake to your validator.
Use the set_open_for_delegation function with the following parameters:
sncast --account=staker invoke \
--contract-address=0x00ca1702e64c81d9a07b86bd2c540188d92a2c73cf5cc0e508d949015e7e84a7 \
--function=set_open_for_delegation \
--arguments=0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d \
--network=mainnet
Parameters:
0x00ca1702e64c81d9a07b86bd2c540188d92a2c73cf5cc0e508d949015e7e84a7— Staking Contract address0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d— $STRK contract address
To verify active delegation pools and token wrappers, call the staking contract’s get_active_tokens function.
Improving Key Management
For improved security, it’s strongly recommended to separate your staking (validator) account from your operational (operator) account. This separation limits risk in case the operational key is ever compromised.
See the detailed instructions in Changing the Operational Address.