Transactions

set-root-claim-type

Set how a coldkey's root alpha emission is claimed.

View as Markdown

Controls what happens to root dividends when they are claimed (see claim_root): Swap converts all alpha emission to TAO (the chain default), Keep keeps everything as subnet alpha, and KeepSubnets keeps alpha on the listed subnets while swapping the rest. The setting is per-coldkey and persists until changed again; it does not move anything already claimed. Read it back with the root_claim_type read.

SignerOriginPalletWraps
coldkeysigned account (pallet role may apply)SubtensorModuleSubtensorModule.set_root_claim_type

Parameters

ParameterTypeRequiredDescription
claim_typestringnoHow root alpha emission is claimed. One of: Swap, Keep, KeepSubnets. Swap converts all alpha emission to TAO, Keep keeps everything as alpha, KeepSubnets keeps alpha only on the subnets given via --subnets and swaps the rest.
subnetsarraynoNetuids to keep alpha on; required for KeepSubnets, invalid otherwise.

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 set-root-claim-type --dry-run
btcli tx set-root-claim-type -w my_coldkey

Python

import bittensor as bt
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = bt.SetRootClaimType()

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.) Or build the intent by op name, as an agent would:

result = sub.execute_tool("set_root_claim_type", {...}, wallet)

On-chain implementation

SubtensorModule.set_root_claim_typepallets/subtensor/src/macros/dispatches.rs#L1918:

#[pallet::call_index(122)]
#[pallet::weight(<T as crate::pallet::Config>::WeightInfo::set_root_claim_type())]
pub fn set_root_claim_type(
    origin: OriginFor<T>,
    new_root_claim_type: RootClaimTypeEnum,
) -> DispatchResult {
    let coldkey: T::AccountId = ensure_signed(origin)?;

    if let RootClaimTypeEnum::KeepSubnets { subnets } = &new_root_claim_type {
        ensure!(!subnets.is_empty(), Error::<T>::InvalidSubnetNumber);
    }

    Self::maybe_add_coldkey_index(&coldkey);

    Self::change_root_claim_type(&coldkey, new_root_claim_type);
    Ok(())
}

Delegates to maybe_add_coldkey_index, change_root_claim_type.

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