# locks-for-hotkey (/docs/query/locks-for-hotkey)

The reverse of `locks_for_coldkey`: scans the `LockingColdkeys`
reverse index for the coldkeys with a non-zero lock pointed at the
hotkey, then loads each lock record. This is the target-side view — a
subnet owner can see which coldkeys are building conviction toward a
hotkey, not just the locks their own coldkey created.

**Category:** Locks & conviction

## Parameters [#parameters]

| Parameter     | Type    | Description              |
| ------------- | ------- | ------------------------ |
| `hotkey_ss58` | string  | Hotkey the locks target. |
| `netuid`      | integer | Subnet to query.         |

## CLI [#cli]

```bash
btcli query locks-for-hotkey --hotkey <ss58|name> --netuid <integer> --json
```

## Python [#python]

Namespace method (autocomplete, signature help):

```python
import bittensor as bt

sub = bt.Subtensor()
result = sub.locks.locks_for_hotkey(hotkey_ss58="5F...", netuid=1)
```

Or dispatch by name, as an agent would:

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

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

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

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

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