ParentKeys
Storage Map v195 → v490 · 1 shape changeParent hotkeys for a child hotkey on a subnet .
Explore chainThe Big Picture
The reverse of ChildKeys. A child hotkey can have multiple parents delegating stake proportions. ParentKeys lets you see who's backing a child and with what proportions.
Why This Matters
Who is delegating stake to this child? ParentKeys shows all parents and their proportions. Essential for understanding a child's total backing.
Example Scenario
Query ParentKeys(netuid=1, child_hotkey=Y) returns [(5000, parent_A), (10000, parent_B)]. Parent A gives 50% of their stake to Y; Parent B gives 100% to Y.
Common Questions
- Can a child have multiple parents?
- Yes, multiple validators can designate the same hotkey as a child. Each contributes their proportion independently.
- How do I calculate total effective stake?
- Sum (parent_stake × proportion) for all parents. This is the child's total delegated stake.
Use Cases
- Check which validators are backing a child hotkey
- Calculate total effective stake from all parents
- Build reverse delegation graphs
- Verify child key configurations
- Research stake flow patterns
From Chain Metadata
DMAP ( child, netuid ) --> Vec<(proportion,parent)>
Purpose & Usage
Purpose
Reverse lookup for child-parent relationships - find who's delegating stake to this child.
Common Query Patterns
- Query parents for a child on a subnet
- Verify parent-child relationships
- Calculate total stake from all parents
Notes
- Returns Vec<(proportion, parent)>
Migration Notes
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
Vec<(proportion,parent)> (Vec<(u64, AccountId)>)
Default Value
Absent keys read as this value — querying a key that has never been written returns this default, not an error or empty result.
Relationships
Modified By
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 ParentKeys storage
const child = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const netuid = 1;
const result = await api.query.SubtensorModule.ParentKeys.getValue(child, netuid);
console.log("ParentKeys:", result);On-Chain Activity
100K to 1M writes
#159 most written storage item
Modified by both user extrinsics and runtime hooks
As of block 9,385,000
Version History
- key :
(AccountId, u16)→(AccountId, NetUid)
Runtime Info
View Source- Pallet
- SubtensorModule
- Storage Kind
- Map
- First Version
- v195
- Current Version
- v490