Staking Module
The ZIGChain Staking Module is based on the Cosmos SDK - Staking Module but with the specific parameters that you can find in the Staking Parameters section.
If you want to understand more about the Consensus, Slashing and Validators Selection, please check our Validators FAQ.
If you are looking for the fast commands, you can use the Validator Quick Sheet.
Staking Parameters
⚠️ These values may change via governance proposals. Always confirm using the CLI or API.
The Staking module in ZIGChain has set up the following parameters:
Parameters | Testnet Value | Mainnet Value |
---|---|---|
bond_denom | uzig | uzig |
historical_entries | 10,000 | 10,000 |
max_entries | 7 | 7 |
max_validators | 4 | 4 |
min_commission_rate | 0% | 0% |
unbonding_time | 504h0m0s (21d) | 504h0m0s (21d) |
Parameters Overview
bond_denom
Description: The denomination (token name) of the currency that can be staked
- Validators and delegators must bond tokens in this denomination to participate in network activities.
Default: uzig
historical_entries
Description: Specifies the number of historical entries to persist for slashing and rewards calculation.
- Historical entries are used to track changes in validator sets, rewards, and slashing events over time.
- This parameter is crucial for maintaining an accurate record of past state changes, especially during redelegations and reward distributions.
Default: 10,000
max_entries
Description: The maximum number of entries allowed for both unbonding delegations and redelegations.
- This parameter limits the number of concurrent unbonding or redelegation operations a delegator can have at any given time
- Ensuring a cap on these entries helps maintain the efficiency of the staking module and reduces the risk of abuse.
Default: 7
max_validators
Description: Defines the number of validators that can be part of the active validator set.
- Only the top
max_validators
ranked by stake will participate in consensus and receive block rewards. - This parameter affects the network's decentralization, security, and performance.
Default: 100
min_commission_rate
Description: The minimum commission rate that validators are required to charge on delegator rewards.
Default: 0
unbonding_time
Description: The period delegators must wait to unfreeze their staked tokens after initiating an unbonding request.
- During this unbonding period, delegators cannot transfer or redelegate their tokens, and they do not earn staking rewards.
- This cooldown period is crucial for maintaining network security by preventing rapid withdrawal of staked assets in response to potential network attacks.
Default: 504h (21 days)
Staking CLI Quick Sheet
If you’re interested in running your own validator, check out our Set up a Validator Guide.
Fetch Staking Params
zigchaind query staking params
Get list of validators:
zigchaind query staking validators
Create a file with your validator info:
PUBKEY=$(zigchaind tendermint show-validator)
bash -c "cat > /tmp/your_validator.txt" << EOM
{
"pubkey": $PUBKEY,
"amount": "1000000uzig",
"moniker": "validator's name",
"identity": "optional identity signature (ex. UPort or Keybase)",
"website": "validator's (optional) website",
"security": "validator's (optional) security contact email",
"details": "validator's (optional) details",
"commission-rate": "0.1",
"commission-max-rate": "0.2",
"commission-max-change-rate": "0.01",
"min-self-delegation": "10"
}
EOM
Create your validator:
zigchaind tx staking create-validator /tmp/your_validator.txt \
--from=zuser1 \
--chain-id="zigchain-1" \
--gas="auto" \
--gas-prices="0.00025uzig" \
--gas-adjustment=1.5
Confirm transaction and get your validator address:
zigchaind query tx $TXHASH --chain-id="zigchain-1" | grep raw_log
VALIDATOR_OP_ADDRESS=$(zigchaind q tx $TXHASH \
--output json | jq -r '.tx.body.messages[0].validator_address')
Check your validator status:
zigchaind query staking validator $VALIDATOR_OP_ADDRESS
Edit your validator information:
zigchaind tx staking edit-validator \
--commission-rate 0.05 \
--details "YOUR_DETAILS" \
--identity "YOUR_KEYBASE_ID" \
--min-self-delegation "100" \
--new-moniker "Your new moniker name" \
--website "YOUR_WEBSITE_URL" \
--security-contact "YOUR_EMAIL" \
--chain-id zigchain-1 \
--from zuser1 \
--gas-adjustment 1.5 \
--gas auto \
--gas-prices="0.00025uzig"
Stake/Delegate with a validator:
zigchaind tx staking delegate $VALIDATOR_ADDRESS $STAKE_AMOUNT \
--from $ACCOUNT --chain-id zigchain-1 --gas-adjustment 1.5 \
--gas auto --gas-prices="0.00025uzig"
Get the Stakings on a Validator:
zigchaind query staking validator $VALIDATOR_ADDRESS
Get Delegation between address and validator:
zigchaind query staking delegation \
$ACCOUNT_ADDRESS $VALIDATOR_ADDRESS
Get Delegations made by one delegator:
zigchaind query staking delegations $ACCOUNT_ADDRESS
Get Delegations made to one validator:
zigchaind query staking delegations-to $VALIDATOR_ADDRESS
Get Validator Info for given delegator validator pair:
zigchaind query staking delegator-validator \
$ACCOUNT_ADDRESS $VALIDATOR_ADDRESS
Get All Validators Info for given delegator address:
zigchaind query staking delegator-validators $ACCOUNT_ADDRESS
Unstake from a validator:
zigchaind tx staking unbond $VALIDATOR_ADDRESS $UNSTAKE_AMOUNT \
--from zuser1 --chain-id zigchain-1 --gas-adjustment 1.5 \
--gas auto --gas-prices="0.00025uzig"
Get Unbonding Delegation between address and validator:
zigchaind query staking unbonding-delegation \
$ACCOUNT_ADDRESS $VALIDATOR_ADDRESS
Query Unbonding Delegations made by one delegator:
zigchaind query staking unbonding-delegations $ACCOUNT_ADDRESS
Get Unbonding Delegations made from one validator:
zigchaind query staking unbonding-delegations-from $VALIDATOR_ADDRESS