# coldkey-lock (/docs/query/coldkey-lock)

`locked_alpha` is denominated in the subnet's alpha and rolled forward
(decayed) to the current block; `is_perpetual` locks do not decay.

**Category:** Locks & conviction

## Parameters [#parameters]

| Parameter      | Type    | Description                 |
| -------------- | ------- | --------------------------- |
| `coldkey_ss58` | string  | Coldkey whose lock to read. |
| `netuid`       | integer | Subnet to query.            |

## CLI [#cli]

```bash
btcli query coldkey-lock --coldkey <ss58|name> --netuid <integer> --json
```

## Python [#python]

Namespace method (autocomplete, signature help):

```python
import bittensor as bt

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

Or dispatch by name, as an agent would:

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

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

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

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

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