# channel-commitment (/docs/query/channel-commitment)

Reads the v2 runtime API and decodes the returned SCALE registration. On a
node without v2, reads the equivalent channel storage instead; both paths
distinguish this target from the legacy `commitment` read. The `revealed`
list reports plaintext and reveal blocks even after the active record is removed.

**Category:** Identity & commitments

## Parameters [#parameters]

| Parameter     | Type    | Description                                  |
| ------------- | ------- | -------------------------------------------- |
| `netuid`      | integer | Subnet containing the mechanism and hotkey.  |
| `mechid`      | integer | Mechanism whose independent channel to read. |
| `channel`     | integer | Independent channel index (0..255).          |
| `hotkey_ss58` | string  | Hotkey whose channel commitment to read.     |

## CLI [#cli]

```bash
btcli query channel-commitment --netuid <integer> --mechid <integer> --channel <integer> --hotkey <ss58|name> --json
```

## Python [#python]

Namespace method (autocomplete, signature help):

```python
import bittensor as bt

sub = bt.Subtensor()
result = sub.identity.channel_commitment(netuid=1, mechid=1, channel=1, hotkey_ss58="5F...")
```

Or dispatch by name, as an agent would:

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

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

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

* Storage [`Commitments.ChannelCommitmentOf`](/code/pallets/commitments/src/lib.rs#L309)
* Storage [`Commitments.ChannelRevealedCommitments`](/code/pallets/commitments/src/lib.rs#L322)

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