Transactions

claim-root-with-hotkey

Redeem accrued root dividends (basket shares) for one validator.

View as Markdown

Redeems the signing coldkey's owed shares on the given validator only: that basket pays out pro-rata (subnet alpha holdings are sold to TAO at the current pool price) and the proceeds are staked back to root on the same validator. Other validators' accrued yield is left untouched. Claims whose estimated payout is below the chain's claim threshold (see root_claim_threshold) are silently skipped and keep accruing. Orphaned dust holdings in the basket (subnets outside the validator's current weight vector, worth less than the same threshold) are consolidated into the fund's root (TAO) slot as a side effect, so the per-holding claim fee shrinks over time; curated positions are left to compound. Since spec 468 a claim also leaves dust rows unsold: a holding worth less than min(1 TAO, 0.1% of the fund's anchored NAV), or one where this claimant's own slice is worth less than 0.0001 TAO, is neither sold nor paid — provided the slice is worth at most 0.01 TAO (the forfeit cap; bigger slices of small rows are sold as before). The whole entitlement is still settled, so those slices stay in the fund for the remaining holders (event BasketClaimDustSkipped). The transaction fee is charged by work actually done: holdings redeemed pay full weight, holdings merely scanned (including skipped dust rows) pay a small per-row cost, and a claim that is admitted and then fails pays for the work it did rather than the declared envelope. Since runtime 495 the chain reserves weight for this validator's own fund: its stored basket rows and its queued dividend credits, up to a fund of 258 claim units (256 subnets, the root cash slot and the validator). It refunds the unused part after. A runtime before 495 admits a fund of 130 claim units; the check before signing uses the limit of the connected runtime. A larger fund is refused with RootClaimTooHeavy. So is a claim that follows, in the same transaction (a batch, for example), a swap_basket buy or a hotkey swap that gave the fund a new row: send that claim in a later transaction. plan and btcli root claim --dry-run show reserved versus spent, warn when the spent fee exceeds accrued yield, and refuse when free TAO cannot cover the reserve. Preview per-validator payouts with root_basket_owed_breakdown.

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

Parameters

ParameterTypeRequiredDescription
hotkey_ss58stringyesValidator whose accrued basket yield to claim.

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 claim-root-with-hotkey \
  --hotkey <ss58|name> --dry-run
btcli tx claim-root-with-hotkey \
  --hotkey <ss58|name> -w my_coldkey

Python

import bittensor as bt
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = bt.ClaimRootWithHotkey(hotkey_ss58="5F...")

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("claim_root_with_hotkey", {...}, wallet)

On-chain implementation

SubtensorModule.claim_root_with_hotkey — pallets/subtensor/src/macros/dispatches.rs#L2218:

#[pallet::call_index(148)]
#[pallet::weight(
    Pallet::<T>::root_claim_hotkey_declared_weight_for(&hotkey)
)]
pub fn claim_root_with_hotkey(
    origin: OriginFor<T>,
    hotkey: T::AccountId,
) -> DispatchResultWithPostInfo {
    let coldkey: T::AccountId = ensure_signed(origin)?;
    // Admission failures keep the declared envelope (see `claim_root`).
    // The declaration was sized before this transaction ran. It does not cover a
    // row that a trade or a key swap added to the fund since then.
    ensure!(
        !Self::basket_rows_opened_in_current_transaction(&hotkey),
        Error::<T>::RootClaimTooHeavy
    );
    // The count of the fund that sized the declaration. A fund above the limit
    // has none.
    let Some(work) = Self::root_claim_hotkey_work(&hotkey) else {
        return Err(Error::<T>::RootClaimTooHeavy.into());
    };

    // The counts of the fund are work of this call, also when the claim fails.
    // The work counters of the claim do not count them.
    let sizing = Self::root_claim_hotkey_sizing_weight(work.rows, work.queued);
    let admitted =
        Self::root_claim_admission_weight(Self::root_claim_hotkey_declared_work())
            .max(sizing);
    // The claim starts with the settlement of the claimant's deferred-dividend
    // debts. The work counters of the claim do not count it.
    let settlement =
        Self::root_claim_debt_settlement_weight(Self::root_claim_debts(&hotkey, &coldkey));
    let outcome = Self::do_root_claim_tracked(coldkey.clone(), vec![hotkey]).map_err(
        |(done, error)| {
            Self::fail_with_weight(
                error,
                Self::root_claim_actual_weight(1, 0, &done)
                    .saturating_add(admitted)
                    .saturating_add(settlement),
            )
        },
    )?;
    Self::maybe_add_coldkey_index(&coldkey);

    let weight = Self::root_claim_actual_weight(1, 0, &outcome)
        .saturating_add(settlement)
        .saturating_add(sizing);
    Ok((Some(weight), Pays::Yes).into())
}

Delegates to basket_rows_opened_in_current_transaction, root_claim_hotkey_work, root_claim_hotkey_sizing_weight.

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