AutoStakeDestination
Storage Map v315 → v472 · 2 shape changesHotkey that receives a coldkey 's miner incentive on a subnet , instead of the mining hotkey .
Explore chainThe Big Picture
Miner incentive is always staked at the epoch. By default it stakes to the mining hotkey; this map lets a coldkey point it at another hotkey on the same subnet, for example a validator it wants to compound into. It applies to incentive only. Dividends stay on the hotkey that earned them.
Why This Matters
Mining on a subnet but want the earnings to accumulate on a different hotkey? This is the switch. Without it, incentive stakes to the mining hotkey itself; it is never paid out as free balance.
Example Scenario
Query AutoStakeDestination(coldkey=you, netuid=1) returns hotkey_X. Incentive earned by your miners on subnet 1 is staked to hotkey_X at each epoch and AutoStakeAdded fires. If it returns None, the incentive stakes to each mining hotkey with no event.
Common Questions
- How do I enable auto-stake?
- Use the set_auto_stake_destination call to configure where rewards should go. You can set different destinations for different subnets.
- Can I auto-stake to a different validator?
- Yes, you can set any hotkey as your auto-stake destination - doesn't have to be one you own.
- Does auto-stake work cross-subnet?
- Each subnet has its own auto-stake destination. You configure per-subnet where rewards go.
- What if the destination hotkey deregisters?
- Auto-stake to a non-existent destination may fail. Monitor your destinations and update if validators deregister.
Use Cases
- Check where your rewards will auto-stake
- Verify auto-stake configuration is correct
- Build wallet UIs showing auto-stake status
- Calculate compound yield projections
- Debug why rewards aren't appearing in expected location
From Chain Metadata
DMAP ( cold, netuid )--> hot | Returns the hotkey a coldkey will autostake to with mining rewards.
Purpose & Usage
Purpose
Redirect miner (incentive) emission at the epoch. When set for (coldkey, netuid), the liquid incentive earned by any hotkey owned by that coldkey is staked to the destination hotkey rather than to itself.
Common Query Patterns
- Query destination by coldkey-netuid
- Check if auto-stake is configured
- Verify auto-stake setup before relying on it
Notes
- Scope. The only crediting reader is distribute_dividends_and_incentives (run_coinbase.rs L773-L796 at da06f033, v452), inside the miner incentive loop. Validator dividends and the validator take are not redirected; they always land on the earning hotkey.
- Default. Without an entry the incentive is staked to the mining hotkey itself. Emission is never paid to free balance in either case. AutoStakeAdded is emitted only when a destination is set.
- Collateral first. From v437 settle_miner_collateral may capture part of the incentive into MinerCollateral on the mining hotkey; only the remainder goes to the destination.
- Setter checks (macros/dispatches.rs set_auto_stake_destination): the subnet must exist, the destination hotkey must be registered on it, and setting the same hotkey again fails.
Migration Notes
key type changed from AccountId to (AccountId, u16)
Update decoders: SCALE encoding is positional, so any signature change (added, removed, or type-changed fields, or storage shape changes) shifts byte offsets and existing decoders will misparse this item. Re-derive types from the new metadata.
key type changed from (AccountId, u16) to (AccountId, NetUid)
Update decoders: SCALE encoding is positional, so any signature change (added, removed, or type-changed fields, or storage shape changes) shifts byte offsets and existing decoders will misparse this item. Re-derive types from the new metadata.
Query Keys
Stored Value
hot (AccountId)
Default Value
Optional storage: querying a key that has never been written returns no value (None) — do not assume a zero default.
Decoding the value
AccountId (32-byte hex)Bittensor uses SS58 prefix 42 for both hotkeys and coldkeys. The 32 bytes are sr25519 public keys.
value as `0x${string}` // 32-byte AccountIdRelationships
Modified By
Related Events
Code Examples
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443
const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);
// Query AutoStakeDestination storage
const cold = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const netuid = 1;
const result = await api.query.SubtensorModule.AutoStakeDestination.getValue(cold, netuid);
console.log("AutoStakeDestination:", result);Version History
- key :
AccountId→(AccountId, u16) - hashers :
Blake2_128Concat→Blake2_128Concat,Identity
- key :
(AccountId, u16)→(AccountId, NetUid)
Runtime Info
View Source- Pallet
- SubtensorModule
- Storage Kind
- Map
- First Version
- v315
- Current Version
- v472