SetChildren
Event Re-added v195 → v212, v216 → v219, v233 → v247, v252 → v265, v273 → v277, v290 → v315, v320 → v326, v334 → v367, v372 → v377, v385 → current #74Emitted when child hotkeys are set for a parent hotkey .
View events on chainThe Big Picture
Child keys let a parent hotkey share its rewards with other hotkeys. This enables validator organizations where multiple people run infrastructure but earnings are automatically split. It's like having partners in your validator business - the chain handles the profit sharing automatically.
Why This Matters
Running a validator is resource-intensive. Child keys let you share rewards with infrastructure partners, referrers, or team members automatically. The parent sets proportions, and the chain distributes rewards accordingly. No manual splitting needed.
Example Scenario
You run a validator with a partner who provides servers. You set your partner's hotkey as a child at 30%. SetChildren fires with your hotkey as parent, their hotkey as child, and 30% proportion. Now when you earn 10 TAO, 3 TAO automatically goes to your partner.
Common Questions
- Can children have their own children?
- Yes, child keys can also set their own children, creating hierarchies. This enables complex organizational structures.
- How do children get their rewards?
- Automatically at emission time. No claiming needed. The proportion is applied before rewards are distributed, so children receive their share directly.
- Can I remove a child key?
- Yes, set new children without that key (or empty list). Changes go through a schedule delay to protect delegators from sudden changes.
Use Cases
- Set up validator organizations with reward sharing
- Create referral or affiliate structures
- Build validator pools with multiple operators
- Track parent-child relationships across the network
How to Use This Event
- → Monitor when validators add or change children
- → Track reward distribution structures
- → Build validator organization analysis tools
From Chain Metadata
The children of a hotkey have been set
Triggers
Emitted by
Preconditions
- Caller owns the parent hotkey
- Child hotkeys are valid accounts
- Proportions sum to valid total
Effects
Storage Modified
Postconditions
- ChildKeys storage updated for parent
- ParentKeys storage updated for children
- Stake distribution includes children
Side Effects
- Children receive portion of parent's rewards
- Parent's direct rewards reduced proportionally
Event Data
| # | Name | Type | Description |
|---|---|---|---|
| 0 | arg0 | AccountId | Event field #0 (AccountId) (hex -> SS58) |
| 1 | arg1 | u16 | Event field #1 (u16) |
| 2 | arg2 | Vec<(u64, AccountId)> Vec | Event field #2 (Vec<(u64, AccountId)>) |
Code Examples
import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";
const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });
// Subscribe to SetChildren events
api.query.system.events((events) => {
events
.filter(({ event }) =>
event.section === stringCamelCase("SubtensorModule") &&
event.method === "SetChildren"
)
.forEach(({ event }) => {
console.log("SetChildren:", event.data.toHuman());
});
});On-Chain Activity
Regular feature-level activity
#38 most emitted event
As of block 7,429,232
Version History
Runtime Info
View Source- Pallet Index
- 7
- Event Index
- 74
- First Version
- v195
- Current Version
- v393