StakingColdkeys
Storage Map v334 → currentReverse index mapping coldkey to its position.
Explore chainQueried by: analyticsdevelopers
The Big Picture
Reverse lookup for the StakingColdkeysByIndex storage. StakingColdkeys maps a coldkey to its u64 index and StakingColdkeysByIndex maps back, so the pair gives bidirectional access to the staking coldkey set, sized by NumStakingColdkeys. The value is an index, not a flag.bidirectional access to the set of staking coldkeys.
Use Cases
- Check if coldkey is in staking set
- Get coldkey's index position
Purpose & Usage
Purpose
Lookup a coldkey's position in the staking index.
Common Query Patterns
- Query by coldkey address
Query Keys
| # | Name | Type | Description |
|---|---|---|---|
| 1 | coldkey coldkey raw: key1 | AccountId [u8; 32] | key1 (AccountId) (hex -> SS58) |
Stored Value
Value in RAO (÷10⁹ for TAO)
RAO -> TAO (/ 10^9)
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.
Relationships
Modified By
Related Events
AddStakeBurnAggregatedLimitedStakeAddedAggregatedLimitedStakeRemovedAggregatedStakeAddedAggregatedStakeRemovedAggregatedUnstakeAllAlphaFailedAggregatedUnstakeAllAlphaSucceededAggregatedUnstakeAllFailedAggregatedUnstakeAllSucceededAllBalanceUnstakedAndTransferredToNewColdkeyAutoStakeAddedColdkeySwappedStakeAddedStakeRemovedStakeTransferred
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 StakingColdkeys storage
const key1 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const result = await api.query.SubtensorModule.StakingColdkeys.getValue(key1);
console.log("StakingColdkeys:", result);On-Chain Activity
Write Frequency
●●●●○○ Medium 100K–1M est. writes
100K to 1M writes
#189 most written storage item
Write Source Calls + Hooks
Modified by both user extrinsics and runtime hooks
As of block 9,385,000
Runtime Info
View Source- Pallet
- SubtensorModule
- Storage Kind
- Map
- First Version
- v334
- Current Version
- v490