ParentKeys

Storage Map v195 → v490 · 1 shape change

Parent hotkeys for a child hotkey on a subnet .

Explore chain
Queried by: validatorsdelegatorsanalyticsdevelopers

The 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)>
Part of: Yuma ConsensusChild Hotkeys

Migration Notes

v424 v432 Breaking

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

#NameTypeDescription
1
child account
AccountId child (AccountId, hashed key component) (hex -> SS58)
2
netuid netuid
NetUid netuid (NetUid, hashed key component)

Stored Value

Vec<(proportion,parent)> (Vec<(u64, AccountId)>)

Default Value

0x00 (raw SCALE bytes)

Absent keys read as this value — querying a key that has never been written returns this default, not an error or empty result.

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 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

Write Frequency
●●●●○○ Medium 100K–1M est. writes

100K to 1M writes

#159 most written storage item

Write Source Calls + Hooks

Modified by both user extrinsics and runtime hooks

As of block 9,385,000

Version History

v195 block 3,791,350 Added
v425–v431 · runtime versions skipped on chain (never deployed)
v432 block 8,636,190 Shape changed Current
  • key : (AccountId, u16) → (AccountId, NetUid)

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v195
Current Version
v490