Transactions

set-auto-stake

Auto-stake future mining rewards on a subnet to a chosen hotkey.

View as Markdown

Sets the coldkey's autostake destination for the subnet: all future rewards earned there are automatically staked to the chosen hotkey (defaulting to the wallet's own hotkey) instead of accumulating unstaked. A configuration change only — it moves no funds by itself and applies just to that subnet. The hotkey must be registered on the subnet (HotKeyNotRegisteredInSubNet), and setting the hotkey that is already the destination fails (SameAutoStakeHotkeyAlreadySet). Call it again with a different hotkey to redirect; read the current setting back with the auto_stake read.

SignerPalletWraps
coldkeySubtensorModuleSubtensorModule.set_coldkey_auto_stake_hotkey

Parameters

ParameterTypeRequiredDescription
netuidintegeryesSubnet whose future rewards are auto-staked.
hotkey_ss58stringnoHotkey the rewards are staked to. Defaults to the wallet's own hotkey.

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-auto-stake \
  --netuid <int> --dry-run
btcli tx set-auto-stake \
  --netuid <int> -w my_coldkey

Python

import bittensor as sub
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = sub.SetAutoStake(netuid=1)

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