Stake Operations

Staking

Transfer TAO between coldkeys and hotkeys, converting to/from subnet-specific Alpha tokens.

Click items to navigate to their reference pages.

The Big Picture

Staking is how you put your TAO to work. When you stake, your TAO enters a subnet's Alpha pool and you receive Alpha tokens representing your share of the pool. These Alpha tokens determine your weight in emission distribution. More Alpha = more earnings.

Why This Matters

Staking is the primary way TAO holders earn yield. Your stake weight determines your share of subnet emissions, and the exchange rate between TAO and Alpha means timing affects returns.

Example Scenario

Alice stakes 100 TAO to hotkey H on subnet 1. The Alpha pool has 1000 TAO and 1500 Alpha, so her 100 TAO converts to ~130 Alpha at the current rate (100 × 1500/1100). She now holds 130 Alpha of ~1630 total, giving her ~8% of the stake weight.

Common Questions

Is staking the same as buying Alpha?
Effectively yes — staking deposits TAO into the pool and mints Alpha proportionally. The Alpha represents your pool share.
Can I lose TAO when unstaking?
If the Alpha price dropped since you staked (more TAO was unstaked from the pool), you receive less TAO back. The exchange rate is dynamic.

Use Cases

  • Earning yield on TAO holdings
  • Supporting specific subnets and validators
  • Moving stake between hotkeys and subnets
  • Managing multi-subnet stake portfolios

Staking is the primary mechanism for network participation. TAO holders stake to hotkeys on specific subnets, which converts their TAO to Alpha tokens in the subnet's pool. This Alpha represents their stake weight for emission distribution. Unstaking converts Alpha back to TAO.

The staking mechanism handles balance transfers, Alpha conversion math, and updates to all stake-tracking storage items. It enforces minimum stake requirements and existential deposit rules.

Miners can configure an AutoStakeDestination per (coldkey, netuid) to redirect incentive emissions to a different hotkey, allowing earned stake to auto-compound to a preferred validator.

Triggers

  • User submits add_stake, remove_stake, or move_stake call
  • Batch operations via add_stake_multiple

Inputs (5)

ItemTypeRole
add_stake SubtensorModulecallAdd stake from coldkey to hotkey
remove_stake SubtensorModulecallRemove stake from hotkey to coldkey
move_stake SubtensorModulecallMove stake between hotkeys
Account SystemstorageColdkey free balance
AutoStakeDestination SubtensorModulestoragePer (coldkey, netuid) redirect target for incentive emission auto-staking

Outputs (6)

ItemTypeRole
StakeAdded SubtensorModuleeventEmitted when stake is added
StakeRemoved SubtensorModuleeventEmitted when stake is removed
Alpha SubtensorModulestoragePer-hotkey-per-coldkey Alpha share balance
TotalStake SubtensorModulestorageNetwork-wide total staked TAO
TotalHotkeyAlpha SubtensorModulestorageTotal Alpha on a specific hotkey per subnet
StakeMoved SubtensorModuleeventEmitted when stake is moved between hotkeys/subnets

Source Files

pallets/subtensor/src/staking/add_stake.rs
do_add_stake()
pallets/subtensor/src/staking/remove_stake.rs
do_remove_stake()
pallets/subtensor/src/staking/move_stake.rs
do_move_stake()
pallets/subtensor/src/coinbase/run_coinbase.rs
drain_pending()
Lines: 557-579

Formulas

Stake Balance Transfer

TAO is transferred from coldkey free balance to the subnet's Alpha pool. The Alpha received depends on the pool exchange rate.

// Staking:
free_balance -= tao_amount
alpha_received = swap_tao_for_alpha(tao_amount, pool)
stake[hotkey][coldkey] += alpha_received

// Unstaking:
tao_received = swap_alpha_for_tao(alpha_amount, pool)
stake[hotkey][coldkey] -= alpha_amount
free_balance += tao_received

Existential Deposit Check

After staking, the coldkey must retain at least the existential deposit (500 RAO) to keep the account alive.

free_balance check uses Substrate Preservation::Preserve flag
// Existential deposit (500 RAO) enforced by balance pallet

Related Workflows

add-stakeremove-stakemove-stake

Version History

v101 Basic staking operations
v200 Delegation support for staking to delegate hotkeys
v290 Stake converted to Alpha tokens (dTAO)
v300 Rate limiting on stake operations
v350 Added move_stake and transfer_stake operations
v374 Batch staking operations for efficiency