Transactions

reveal-weights

Reveal previously committed weights (legacy salt-based commit-reveal).

View as Markdown

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.

SignerPalletWraps
hotkeySubtensorModuleSubtensorModule.reveal_weights

Parameters

ParameterTypeRequiredDescription
netuidintegeryesSubnet whose miners the weights score.
uidsarray of integeryesMiner UIDs exactly as committed, as a list parallel to weights.
weightsarray of numberyesWeights exactly as committed, as a list parallel to uids.
saltarray of integeryesSalt used when the commit was made; must match to reveal.
version_keyintegernoVersion 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

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

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

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:

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