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).

Conviction locks: a lock is a coldkey-wide floor (stake hotkey and lock hotkey may differ). Amounts at or below free (unlocked) alpha transfer without moving the lock. Amounts above free pull locked mass with the stake — that locked portion must land on the receiver's existing lock hotkey or the call fails with LockHotkeyMismatch. Fix: keep hotkey_ss58 as the hotkey that holds the stake and set dest_hotkey_ss58 to the receiver's lock hotkey (see btcli stake list / btcli conviction show). Pulling from the lock hotkey when the stake still sits elsewhere fails with NotEnoughStakeToWithdraw. See the conviction guide's "Transferring locked stake" section.

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. Pass all to hand over the entire origin position; on chain (spec 469+) alpha_amount = u64::MAX means the same and is resolved against the live position at execution, so a figure copied from a StakeAdded event — which can read one rao above the position — is not needed. A call that fails is charged the work it did, not its declared weight.

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, or all.
dest_hotkey_ss58stringnoHotkey the stake lands on. Defaults to the origin hotkey. Required when the transfer moves locked alpha and the receiver already locks to a different hotkey — pass their lock hotkey (see btcli stake list / btcli conviction show).

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="5G...destination", hotkey_ss58="5F...", origin_netuid=1, dest_netuid=2, 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_stake — pallets/subtensor/src/macros/dispatches.rs#L1386:

#[pallet::call_index(86)]
#[pallet::weight((
    <T as crate::pallet::Config>::WeightInfo::transfer_stake()
        .saturating_add(Pallet::<T>::staking_hotkeys_walk_bound()),
    DispatchClass::Normal,
    Pays::Yes
))]
pub fn transfer_stake(
    origin: OriginFor<T>,
    destination_coldkey: T::AccountId,
    hotkey: T::AccountId,
    origin_netuid: NetUid,
    destination_netuid: NetUid,
    alpha_amount: AlphaBalance,
) -> DispatchResultWithPostInfo {
    let coldkey = ensure_signed(origin.clone())?;
    Self::with_actual_weight(
        Self::do_transfer_stake(
            origin,
            destination_coldkey,
            hotkey,
            origin_netuid,
            destination_netuid,
            alpha_amount,
        ),
        <T as crate::pallet::Config>::WeightInfo::transfer_stake()
            .saturating_add(Self::staking_hotkeys_walk_actual(&coldkey)),
    )
}

Delegates to with_actual_weight, do_transfer_stake, staking_hotkeys_walk_actual.

SubtensorModule.transfer_stake_and_hotkey — pallets/subtensor/src/macros/dispatches.rs#L2796:

#[pallet::call_index(143)]
#[pallet::weight((
    <T as crate::pallet::Config>::WeightInfo::transfer_stake_and_hotkey()
        .saturating_add(Pallet::<T>::staking_hotkeys_walk_bound()),
    DispatchClass::Normal,
    Pays::Yes
))]
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,
) -> DispatchResultWithPostInfo {
    let coldkey = ensure_signed(origin.clone())?;
    Self::with_actual_weight(
        Self::do_transfer_stake_and_hotkey(
            origin,
            destination_coldkey,
            origin_hotkey,
            destination_hotkey,
            origin_netuid,
            destination_netuid,
            alpha_amount,
        ),
        <T as crate::pallet::Config>::WeightInfo::transfer_stake_and_hotkey()
            .saturating_add(Self::staking_hotkeys_walk_actual(&coldkey)),
    )
}

Delegates to with_actual_weight, do_transfer_stake_and_hotkey, staking_hotkeys_walk_actual.

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