# set-subnet-emission-weights (/docs/tx/set-subnet-emission-weights)

Dispatches `AdminUtils.sudo_set_subnet_emission_weights` for the named
slots. The signer must be the subnet's owner coldkey (root may also call
it). With `renormalize` the untouched owner/validator/miner slots are
rescaled so the vector still sums to one; without it the merged vector is
submitted as given. Every accepted set makes the chain re-solve the
subnet's effective TAO weight so root stakers earn their baseline share of
emission (what they would earn with the default validator share and the
global TaoWeight) — the pre-sign plan shows that share and the resulting
weight, and lists every rule the chain would reject (including a validator
share too low to reach the baseline), so a bad vector is caught before
signing. Owners may change the vector once per week per subnet.

| Signer    | Origin       | Pallet     | Wraps                                                                                             |
| --------- | ------------ | ---------- | ------------------------------------------------------------------------------------------------- |
| `coldkey` | subnet owner | AdminUtils | [`AdminUtils.sudo_set_subnet_emission_weights`](/code/pallets/admin-utils/src/lib.rs#L2692-L2715) |

## Verify [#verify]

After inclusion, confirm the effect with the
[`subnet-emission-weights`](/docs/query/subnet-emission-weights) read:

```bash
btcli query subnet-emission-weights --netuid <integer> --json
```

## Parameters [#parameters]

| Parameter     | Type                                      | Required | Description                                                                                                                                                                                                                                                                                                                                                               |
| ------------- | ----------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `netuid`      | integer                                   | yes      | Subnet to configure; the signer must be its owner.                                                                                                                                                                                                                                                                                                                        |
| `slots`       | array of \['integer', 'string']           | yes      | Slots to set, by name or uid: 0 burn, 1 recycle, 2 owner, 3 validator, 4 miner. Omitted owner/validator/miner slots keep their current share; omitted burn/recycle are zero.                                                                                                                                                                                              |
| `values`      | array of \['integer', 'number', 'string'] | yes      | New share for each slot, pairwise with `slots`: a 0..1 fraction (0.41), a percentage ("41%"), or raw u64 parts of 2^64-1. Rules: burn = recycle = 0; owner \<= 33% (>= 18% on lease-created subnets); validator \<= 50% and high enough that root's baseline share of emission is reachable (see `btcli subnets emission show`); miner >= 33%; all five sum to exactly 1. |
| `renormalize` | boolean                                   | no       | Keep the named slots as given and rescale the other owner/validator/miner slots proportionally so the vector sums to 1 (the miner slot absorbs rounding). Without it, the update is applied verbatim and must already sum to 1.                                                                                                                                           |

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 set-subnet-emission-weights \
  --netuid <int> \
  --slots <a,b,c> \
  --values <a,b,c> --dry-run
btcli tx set-subnet-emission-weights \
  --netuid <int> \
  --slots <a,b,c> \
  --values <a,b,c> -w my_coldkey
```

## Python [#python]

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

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = bt.SetSubnetEmissionWeights(netuid=1, slots=[...], values=[...])

sub = bt.Subtensor()
plan = sub.plan(intent, wallet)   # fee, effects, policy — no submission
result = sub.execute(intent, wallet)
if not result.success:
    print(result.error.code, result.error.remediation)
```

(`bt.Subtensor` is also the async client — `async with bt.Subtensor() as client:`
— see [The client](/docs/concepts/client).) Or build the intent by op name, as
an agent would:

```python
result = sub.execute_tool("set_subnet_emission_weights", {...}, wallet)
```

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

`AdminUtils.sudo_set_subnet_emission_weights` — [`pallets/admin-utils/src/lib.rs#L2694`](/code/pallets/admin-utils/src/lib.rs#L2692-L2715):

```rust
#[pallet::call_index(114)]
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_subnet_emission_weights())]
pub fn sudo_set_subnet_emission_weights(
    origin: OriginFor<T>,
    netuid: NetUid,
    uids: Vec<u16>,
    values: Vec<u64>,
) -> DispatchResult {
    let maybe_owner = pallet_subtensor::Pallet::<T>::ensure_sn_owner_or_root_with_limits(
        origin,
        netuid,
        &[Hyperparameter::EmissionWeights.into()],
    )?;
    pallet_subtensor::Pallet::<T>::ensure_admin_window_open(netuid)?;

    pallet_subtensor::Pallet::<T>::do_set_subnet_emission_weights(netuid, uids, values)?;

    pallet_subtensor::Pallet::<T>::record_owner_rl(
        maybe_owner,
        netuid,
        &[Hyperparameter::EmissionWeights.into()],
    );
    Ok(())
}
```

Every file is browsable under [/code](/code) exactly as built into the runtime, or as plain text under `/code/raw/<path>` (index: [`/code/index.json`](/code/index.json)).
