ColdkeySuccessor

Storage Map v437 → current

Global map from an old coldkey to the coldkey that replaced it.

Explore chain
Queried by: analyticswalletsexchangesdevelopers

The Big Picture

Before v437 following a rotation meant scanning ColdkeySwapped events across history. These two lineage maps put the answer in state, which is the difference between needing an archive node and not.

Why This Matters

An address that stops appearing in your data may not have left. It may have rotated. Without checking lineage, a rotation reads as an exit followed by an unrelated arrival.

Example Scenario

A coldkey holding a large position disappears from your holder set. ColdkeySuccessor has an entry for it, so the position moved to a new key rather than being withdrawn.

Common Questions

Should I walk successors or read the root?
Read ColdkeyRoot for identity comparisons, since it is one lookup and is stable. Walk successors only when you specifically need the current tip, and treat the result as advisory.

Use Cases

  • Reconcile a portfolio across a key rotation
  • Attribute old activity to a current owner
  • Avoid treating a rotated key as a departed user

From Chain Metadata

MAP ( old_coldkey ) --> new_coldkey | global coldkey swap successor. Written on each successful coldkey swap so watchers can follow owner identity without an archive node. Global (not per-netuid) because a coldkey swap moves ownership everywhere at once.

Purpose & Usage

Purpose

Records owner-identity continuity across coldkey swaps so a consumer can follow a rotation forward without replaying archive history.

Common Query Patterns

  • Follow a historical coldkey to its replacement
  • Detect that an address seen in old data has since rotated

Notes

  • First appears at runtime v437.
  • Optional. Absent means the coldkey has not been swapped away from.
  • Global rather than per-subnet, because a coldkey swap moves ownership everywhere at once.
  • Walking successors to a tip is advisory. The runtime bounds the walk at 64 hops and clears a stale outgoing edge when a coldkey is written as a swap destination.
  • Prefer ColdkeyRoot for identity checks; use this map to move forward one hop at a time.

Query Keys

#NameTypeDescription
1
old_coldkey
AccountId [u8; 32]old_coldkey (AccountId, hashed key component) (hex -> SS58)

Stored Value

new_coldkey (AccountId)

hex -> SS58

Default Value

None (absent keys return no value)

Optional storage: querying a key that has never been written returns no value (None) — do not assume a zero default.

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 ColdkeySuccessor storage
const old_coldkey = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";

const result = await api.query.SubtensorModule.ColdkeySuccessor.getValue(old_coldkey);
console.log("ColdkeySuccessor:", result);

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v437
Current Version
v472