MinerCollateral

Storage Map v437 → current

Registration collateral state for a (netuid , hotkey , coldkey ) stake position.

Explore chain
Queried by: minersvalidatorsdevelopersanalytics

The Big Picture

A miner can post collateral against its registration. Instead of paying it up front, the chain captures it from earnings until the floor is met, then lets it drain back out as the miner keeps earning.

Use Cases

  • Explain why credited incentive or take is less than the epoch assigned
  • Track collateral build-up and release for a hotkey

From Chain Metadata

NMAP ( netuid, hotkey, coldkey ) --> MinerCollateralState Standing registration collateral of a `(hotkey, coldkey)` stake position on a subnet. Keyed by coldkey so nominators on the same hotkey are never charged for the owner's bond. The entry persists across deregistration and is only removed when fully drained through earned emission.

Purpose & Usage

Purpose

Hold the collateral lock that captures part of a hotkey earnings until a miner-set floor is reached, and releases it back as earnings continue above the floor.

Common Query Patterns

  • Query by (netuid, hotkey, coldkey)
  • Absent once fully drained with no floor set

Notes

  • Settled at every epoch by settle_miner_collateral (pallets/subtensor/src/subnets/collateral.rs L474-L487 at da06f033, v452), called from the coinbase for the full miner incentive and for the validator take on both dividend legs. Nominator and root-claimable shares are never capturable.
  • Below the floor, up to min(capturable, shortfall) is captured and staked to the hotkey itself, never to an AutoStakeDestination. Above the floor, min(drain_ratio × emission, locked − min_locked) is released to withdrawable stake. Present since v437.

Query Keys

#NameTypeDescription
1
netuid
NetUid netuid (NetUid, hashed key component)
2
hotkey
AccountId hotkey (AccountId, hashed key component) (hex -> SS58)
3
coldkey
AccountId coldkey (AccountId, hashed key component) (hex -> SS58)

Stored Value

MinerCollateralState (MinerCollateralState)

Default Value

None (absent keys return no value)

Optional storage: querying a key that has never been written returns no value (None) — do not assume a zero default.

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 MinerCollateral storage
const netuid = 1;
const hotkey = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const coldkey = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";

const result = await api.query.SubtensorModule.MinerCollateral.getValue(netuid, hotkey, coldkey);
console.log("MinerCollateral:", result);

On-Chain Activity

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

More than 10M writes

#76 most written storage item

Write Source Calls + Hooks

Modified by both user extrinsics and runtime hooks

As of block 9,385,000

Runtime Info

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