TotalHotkeyShares

Storage Map Poll per tempo v233 → v411 Changed in v411

Legacy total shares per (hotkey , netuid ), stored as FixedU128 { bits }. Superseded by TotalHotkeySharesV2 at v401.

Explore chain
Queried by: validatorsdelegatorsstakersanalytics

The 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

#NameTypeDescription
1
hotkey hotkey
raw: key1
AccountId key1 (AccountId) (hex -> SS58)
2
netuid netuid
raw: key2
u16 key2 (u16)

Stored Value

value (FixedU128)

Decoding the value

FixedU128

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

Common bug
Indexers reading both this and TotalHotkeySharesV2 with a uniform `.bits` accessor get 0 from V2 (V2 uses SafeFloat {mantissa, exponent}, NOT {bits}). See coexistsWith.valueEncodingDiffers.
value as bigint // PAPI decodes FixedU128 as bigint of raw bits

Relationships

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.

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

Write Frequency
●●●●●● Ultra-High >10M est. writes

>10M estimated writes

#5 most written storage item

Write Source User Extrinsics

Modified via user-submitted extrinsics

As of block 7,429,232

Version History

v233 block 4,920,350 Added
v235–v237 · runtime versions skipped on chain (never deployed)
v238 block 4,936,550 Internal re-bind
v241–v243 · runtime versions skipped on chain (never deployed)
v244 block 4,999,897 Internal re-bind
v266–v272 · runtime versions skipped on chain (never deployed)
v273 block 5,659,032 Internal re-bind
v275–v275 · runtime versions skipped on chain (never deployed)
v276 block 5,781,672 Internal re-bind
v278–v289 · runtime versions skipped on chain (never deployed)
v290 block 5,947,548 Internal re-bind
v307–v314 · runtime versions skipped on chain (never deployed)
v315 block 6,414,634 Internal re-bind
v316–v319 · runtime versions skipped on chain (never deployed)
v320 block 6,523,566 Internal re-bind
v327–v333 · runtime versions skipped on chain (never deployed)
v334 block 6,811,690 Internal re-bind
v353–v360 · runtime versions skipped on chain (never deployed)
v361 block 7,063,679 Internal re-bind
v363–v364 · runtime versions skipped on chain (never deployed)
v365 block 7,135,419 Internal re-bind
v386–v390 · runtime versions skipped on chain (never deployed)
v391 block 7,782,857 Internal re-bind
v394–v400 · runtime versions skipped on chain (never deployed)
v401 block 8,036,576 Internal re-bind
v403–v410 · runtime versions skipped on chain (never deployed)
v411 block 8,283,784 Internal re-bind Current

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v233
Current Version
v411
Population
sparse-by-value (~115,186 entries)