# miner-collateral (/docs/query/miner-collateral)

Collateral is keyed by hotkey + coldkey so nominators on the same hotkey are
never charged for the owner's bond. When `coldkey_ss58` is omitted, the
hotkey owner is used.

`locked_alpha` is non-withdrawable stake released through earned incentive
at `drain_ratio` alpha per alpha earned; `min_locked_alpha` is the
miner-set floor the lock self-maintains around (the drain stops at it and
incentive fills any shortfall); `earned_alpha` is lifetime incentive since
the collateral entry existed. Derived: `headroom_alpha` (draining portion
above the floor), `shortfall_alpha` (capture in progress below the floor),
and `releasable_work_alpha` (incentive still needed to release the
headroom). The lock survives deregistration and is credited on
re-registration.

**Category:** Mining & collateral

## Parameters [#parameters]

| Parameter      | Type    | Description                                                         |
| -------------- | ------- | ------------------------------------------------------------------- |
| `netuid`       | integer | Subnet to query.                                                    |
| `hotkey_ss58`  | string  | Miner hotkey of the bonded stake position.                          |
| `coldkey_ss58` | string  | Coldkey of the bonded stake position. Defaults to the hotkey owner. |

## CLI [#cli]

```bash
btcli query miner-collateral --netuid <integer> --hotkey <ss58|name> --coldkey <ss58|name> --json
```

## Python [#python]

Namespace method (autocomplete, signature help):

```python
import bittensor as bt

sub = bt.Subtensor()
result = sub.collateral.miner_collateral(netuid=1, hotkey_ss58="5F...", coldkey_ss58="5F...")
```

Or dispatch by name, as an agent would:

```python
result = sub.read("miner_collateral", netuid=1, hotkey_ss58="5F...", coldkey_ss58="5F...")
```

Async is the same surface awaited: `async with bt.Subtensor() as client:`.

## On-chain implementation [#on-chain-implementation]

* Storage [`SubtensorModule.Owner`](/code/pallets/subtensor/src/lib.rs#L1290)

Every file is browsable under [/code](/code) exactly as built into the runtime.
