# reveal-weights (/docs/tx/reveal-weights)

Completes the old two-step commit-reveal flow: the uids, weights, salt, and
version key must hash to exactly what was committed earlier. The reveal is
valid on exactly one epoch — the commit's epoch plus the subnet's reveal
period; revealing earlier fails, and once that epoch has passed the commit
is expired and dropped. The chain hashes the quantized u16 values, so the
inputs here must be the same values passed at commit time (`build()`
re-normalizes floats: identical proportions produce identical u16s).
Signed by the hotkey that made the commit. Only needed for legacy
salt-based commits — the timelocked path used by `set_weights` and
`commit_weights` is auto-revealed by the chain and never needs this call.

| Signer   | Pallet          | Wraps                            |
| -------- | --------------- | -------------------------------- |
| `hotkey` | SubtensorModule | `SubtensorModule.reveal_weights` |

## Parameters [#parameters]

| Parameter     | Type             | Required | Description                                                     |
| ------------- | ---------------- | -------- | --------------------------------------------------------------- |
| `netuid`      | integer          | yes      | Subnet whose miners the weights score.                          |
| `uids`        | array of integer | yes      | Miner UIDs exactly as committed, as a list parallel to weights. |
| `weights`     | array of number  | yes      | Weights exactly as committed, as a list parallel to uids.       |
| `salt`        | array of integer | yes      | Salt used when the commit was made; must match to reveal.       |
| `version_key` | integer          | no       | Version key used when the commit was made.                      |

Address parameters (`--hotkey`, `--coldkey`, `--dest`, ...) accept a raw ss58
address, an address-book or proxy-book name, or a local wallet/hotkey name.

## CLI [#cli]

Preview with `--dry-run` (shows fee, effects, and policy result without
submitting), then submit:

```bash
btcli tx reveal-weights \
  --netuid <int> \
  --uids <a,b,c> \
  --weights <a,b,c> \
  --salt <a,b,c> --dry-run
btcli tx reveal-weights \
  --netuid <int> \
  --uids <a,b,c> \
  --weights <a,b,c> \
  --salt <a,b,c> -w my_coldkey
```

## Python [#python]

```python
import bittensor as sub
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = sub.RevealWeights(netuid=1, uids=[...], weights=[...], salt=[...])

async with sub.Client("finney") as client:
    plan = await client.plan(intent, wallet)   # fee, effects, policy — no submission
    result = await client.execute(intent, wallet)
    if not result.success:
        print(result.error.code, result.error.remediation)
```

Or build it by op name, as an agent would:

```python
await client.execute_tool("reveal_weights", {...}, wallet)
```
