AutoStakeDestination

Storage Map v315 → v411 · 1 shape change

Auto-stake destination hotkey for a coldkey on a subnet .

Explore chain
Queried by: stakersdelegatorsvalidatorswallets

The Big Picture

Auto-stake enables automatic compounding. Instead of emissions going to your free balance (where you'd manually re-stake them), they automatically stake to a designated hotkey. Set it once and your stake compounds without any further action. This storage shows where each coldkey's rewards go.

Why This Matters

Earning rewards but want them automatically restaked? Auto-stake does that. This tells you which hotkey will receive your rewards. If not set, rewards go to free balance and you must manually stake.

Example Scenario

Query AutoStakeDestination(coldkey=you, netuid=1) returns hotkey_X. Your emissions from subnet 1 will automatically stake to hotkey_X. If it returns None/default, auto-stake isn't enabled.

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

Where rewards automatically stake - enables compound staking without manual intervention.

Common Query Patterns

  • Query destination by coldkey-netuid
  • Check if auto-stake is configured
  • Verify auto-stake setup before relying on it
Part of: Stake Operations

Migration Notes

v323 v326 Breaking

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.

Query Keys

#NameTypeDescription
1
cold
AccountId cold (AccountId, hashed key component) (hex -> SS58)
2
netuid
u16 netuid (u16, hashed key component)

Stored Value

hot (AccountId)

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 AccountId

Relationships

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

v315 block 6,414,634 Added
v324–v325 · runtime versions skipped on chain (never deployed)
v326 block 6,608,228 Shape changed
  • key : AccountId(AccountId, u16)
  • hashers : Blake2_128ConcatBlake2_128Concat,Identity
v327–v333 · runtime versions skipped on chain (never deployed)
v334 block 6,811,690 Internal re-bind
v353–v360 · runtime versions skipped on chain (never deployed)
v361 block 7,063,679 Internal re-bind
v386–v390 · runtime versions skipped on chain (never deployed)
v391 block 7,782,857 Internal re-bind
v394–v400 · runtime versions skipped on chain (never deployed)
v401 block 8,036,576 Internal re-bind Current

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v315
Current Version
v411