Transactions

transfer-stake

Transfer stake ownership to another coldkey.

View as Markdown

Hands the position itself to the destination coldkey: after this call that coldkey — not you — controls and can unstake those funds, so this is a transfer of value and is irreversible. Double-check the destination address. The stake stays on the same hotkey by default; pass a destination hotkey to re-delegate it in the same call (dispatched as transfer_stake_and_hotkey). It can also land on a different subnet, swapping through both pools (with slippage) when the netuids differ. Fails with TransferDisallowed when the subnet owner has disabled stake transfers on the origin or destination subnet. A spend-cap policy treats this as an unbounded spend and blocks it until the cap is raised. Use move_stake to re-delegate without changing owners.

SignerOriginPalletWraps
coldkeysigned account (pallet role may apply)SubtensorModuleSubtensorModule.transfer_stake, SubtensorModule.transfer_stake_and_hotkey

Parameters

ParameterTypeRequiredDescription
dest_coldkey_ss58stringyesColdkey that becomes the new owner of the stake.
hotkey_ss58stringyesHotkey the stake is held on (the validator backing the position).
origin_netuidintegeryesSubnet the stake currently sits on.
dest_netuidintegeryesSubnet the stake ends up on. When it differs from the origin, the position is swapped through both subnet pools, which can incur slippage on each leg.
amount_alphanumber | "all"yesHow much of the position to hand over (an explicit amount; all is not accepted).
dest_hotkey_ss58stringnoHotkey the stake lands on. Defaults to the origin hotkey (the position stays with the same validator).

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 transfer-stake \
  --dest-coldkey <ss58|name> \
  --hotkey <ss58|name> \
  --origin-netuid <int> \
  --dest-netuid <int> \
  --amount-alpha <amount|all> --dry-run
btcli tx transfer-stake \
  --dest-coldkey <ss58|name> \
  --hotkey <ss58|name> \
  --origin-netuid <int> \
  --dest-netuid <int> \
  --amount-alpha <amount|all> -w my_coldkey

Python

import bittensor as bt
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = bt.TransferStake(dest_coldkey_ss58="5F...", hotkey_ss58="5F...", origin_netuid=0, dest_netuid=0, amount_alpha=1.0)

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

On-chain implementation

SubtensorModule.transfer_stakepallets/subtensor/src/macros/dispatches.rs#L1301:

#[pallet::call_index(86)]
#[pallet::weight(<T as crate::pallet::Config>::WeightInfo::transfer_stake())]
pub fn transfer_stake(
    origin: OriginFor<T>,
    destination_coldkey: T::AccountId,
    hotkey: T::AccountId,
    origin_netuid: NetUid,
    destination_netuid: NetUid,
    alpha_amount: AlphaBalance,
) -> DispatchResult {
    Self::do_transfer_stake(
        origin,
        destination_coldkey,
        hotkey,
        origin_netuid,
        destination_netuid,
        alpha_amount,
    )
}

Delegates to do_transfer_stake.

SubtensorModule.transfer_stake_and_hotkeypallets/subtensor/src/macros/dispatches.rs#L2385:

#[pallet::call_index(143)]
#[pallet::weight(<T as crate::pallet::Config>::WeightInfo::transfer_stake_and_hotkey())]
pub fn transfer_stake_and_hotkey(
    origin: OriginFor<T>,
    destination_coldkey: T::AccountId,
    origin_hotkey: T::AccountId,
    destination_hotkey: T::AccountId,
    origin_netuid: NetUid,
    destination_netuid: NetUid,
    alpha_amount: AlphaBalance,
) -> DispatchResult {
    Self::do_transfer_stake_and_hotkey(
        origin,
        destination_coldkey,
        origin_hotkey,
        destination_hotkey,
        origin_netuid,
        destination_netuid,
        alpha_amount,
    )
}

Delegates to do_transfer_stake_and_hotkey.

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