TotalHotkeyShares
Storage Map Poll per tempo v233 → v411 Changed in v411Legacy total shares per (hotkey , netuid ), stored as FixedU128 { bits }. Superseded by TotalHotkeySharesV2 at v401.
Explore chainThe Big Picture
Shares are the internal accounting unit for tracking proportional ownership. When you stake, you receive shares proportional to your contribution. TotalHotkeyShares is the sum of all shares - divide your shares by this to get your ownership percentage.
Why This Matters
What's your share of this validator? (Your shares / TotalHotkeyShares) = your percentage. This determines your cut of any emissions the validator earns.
Example Scenario
Query TotalHotkeyShares(hotkey=validator_X) returns 10000000000. You have 1000000000 shares. Your ownership = 1B / 10B = 10%. You receive 10% of emissions after validator take.
Common Questions
- How are shares different from alpha?
- Shares track proportional ownership. Alpha is the stake itself. Share prices can vary - early stakers might get more shares per alpha if the pool has grown.
- Can I have a large share of a small validator?
- Yes. A small validator has fewer TotalHotkeyShares, so the same stake gives you a larger percentage. Higher risk (validator may underperform) but potentially higher share of earnings.
Use Cases
- Calculate your percentage ownership of a validator
- Track share dilution as new delegators join
- Build share-based emission calculators
- Analyze stake distribution fairness
- Research delegator dynamics
From Chain Metadata
DMAP ( hot, netuid ) --> total_alpha_shares | Returns the number of alpha shares for a hotkey on a subnet.
Purpose & Usage
Purpose
Track proportional ownership for rewards - the denominator for share-based calculations. Both this storage and V2 are populated with disjoint key sets at v411; consumers must check both.
Common Query Patterns
- Query by (hotkey, netuid)
- Calculate individual share percentages
- Track share dilution over time
- Fall through to TotalHotkeySharesV2 if no entry found
Query Keys
Stored Value
value (FixedU128)
Decoding the value
FixedU128Raw bits represent a Q64.64 fixed-point. Divide by 2^64 for the actual rational. Magnitude check: `bits > 0` tells you the entry is non-zero.
value as bigint // PAPI decodes FixedU128 as bigint of raw bitsRelationships
Related Storages
- TotalHotkeySharesV2 Superseded by Coexists with check both decodes differently V2 introduced at runtime v401 with SafeFloat (mantissa+exponent) value type. V2 holds entries for active stakers (all non-zero); legacy holds the historical population (most zero). Key sets verified DISJOINT at v411 (0 / 0 intersection across 115,186 legacy + 17,239 V2 entries). Legacy uses FixedU128 with { bits: u128 }; V2 uses SafeFloat with { mantissa: bigint, exponent: i64 }. An indexer that reads .bits uniformly silently gets zero from V2 entries.
Modified By
Related Events
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 TotalHotkeyShares storage
const key1 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const key2 = 0;
const result = await api.query.SubtensorModule.TotalHotkeyShares.getValue(key1, key2);
console.log("TotalHotkeyShares:", result);On-Chain Activity
>10M estimated writes
#5 most written storage item
Modified via user-submitted extrinsics
As of block 7,429,232
Version History
Runtime Info
View Source- Pallet
- SubtensorModule
- Storage Kind
- Map
- First Version
- v233
- Current Version
- v411
- Population
- sparse-by-value (~115,186 entries)