# subnet-convictions (/docs/query/subnet-convictions)

Per hotkey: locked mass, conviction, and the estimated blocks until its
own conviction strictly exceeds 18% of the subnet's eligible alpha.
Eligible alpha is `SubnetAlphaOut - SubnetProtocolAlpha - AlphaBurned`
(saturating at zero). `change_subnet_owner_if_needed` reassigns
ownership when the subnet is at least \~1 year old (2,629,800 blocks) and
the highest-conviction hotkey holds more than 18% of eligible alpha on
its own, at which point that hotkey's coldkey becomes the subnet owner.
The gate measures a single hotkey — exactly 18% is not enough — so
`leader_hotkey` and `leader_blocks_to_threshold` describe the current
conviction leader's standing against the gate, while the subnet-wide
`total_conviction_alpha` is reported for context only and never gates
the takeover. Projections assume the lock rates and alpha accounting
stay constant.

**Category:** Locks & conviction

## Parameters [#parameters]

| Parameter | Type    | Description      |
| --------- | ------- | ---------------- |
| `netuid`  | integer | Subnet to query. |

## CLI [#cli]

```bash
btcli query subnet-convictions --netuid <integer> --json
```

## Python [#python]

Namespace method (autocomplete, signature help):

```python
import bittensor as bt

sub = bt.Subtensor()
result = sub.locks.subnet_convictions(netuid=1)
```

Or dispatch by name, as an agent would:

```python
result = sub.read("subnet_convictions", netuid=1)
```

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

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

* Storage [`SubtensorModule.HotkeyLock`](/code/pallets/subtensor/src/lib.rs#L1787)
* Storage [`SubtensorModule.DecayingHotkeyLock`](/code/pallets/subtensor/src/lib.rs#L1799)
* Storage [`SubtensorModule.OwnerLock`](/code/pallets/subtensor/src/lib.rs#L1811)
* Storage [`SubtensorModule.DecayingOwnerLock`](/code/pallets/subtensor/src/lib.rs#L1815)
* Storage [`SubtensorModule.SubnetOwnerHotkey`](/code/pallets/subtensor/src/lib.rs#L2228)
* Storage [`SubtensorModule.SubnetAlphaOut`](/code/pallets/subtensor/src/lib.rs#L1614)
* Storage [`SubtensorModule.SubnetProtocolAlpha`](/code/pallets/subtensor/src/lib.rs#L1618)
* Storage `AlphaAssets.AlphaBurned`
* Storage [`SubtensorModule.UnlockRate`](/code/pallets/subtensor/src/lib.rs#L1853)
* Storage [`SubtensorModule.MaturityRate`](/code/pallets/subtensor/src/lib.rs#L1849)
* Storage [`SubtensorModule.NetworkRegisteredAt`](/code/pallets/subtensor/src/lib.rs#L2162)

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