# move-lock (/docs/tx/move-lock)

Re-points the signing coldkey's entire stake lock on the subnet at the
destination hotkey, carrying the locked mass with it. Accrued conviction
is preserved only when the origin and destination hotkeys are owned by
the same coldkey (e.g. rotating your own validator hotkeys); if the
destination hotkey belongs to a different coldkey, conviction resets to
zero and matures again from scratch. The destination hotkey must exist
on chain (fails with `HotKeyAccountNotExists`). Fails if there is no
existing lock on the subnet to move.

| Signer    | Origin                                 | Pallet          | Wraps                                                                                       |
| --------- | -------------------------------------- | --------------- | ------------------------------------------------------------------------------------------- |
| `coldkey` | signed account (pallet role may apply) | SubtensorModule | [`SubtensorModule.move_lock`](/code/pallets/subtensor/src/macros/dispatches.rs#L2280-L2289) |

## Parameters [#parameters]

| Parameter                 | Type    | Required | Description                  |
| ------------------------- | ------- | -------- | ---------------------------- |
| `netuid`                  | integer | yes      | Subnet the lock lives on.    |
| `destination_hotkey_ss58` | string  | yes      | Hotkey the lock is moved to. |

Address parameters (`--hotkey`, `--coldkey`, `--dest`, ...) accept a raw ss58
address, an address-book or proxy-book name, or a local wallet/hotkey name.

## CLI [#cli]

Preview with `--dry-run` (shows fee, effects, and policy result without
submitting), then submit:

```bash
btcli tx move-lock \
  --netuid <int> \
  --destination-hotkey <ss58|name> --dry-run
btcli tx move-lock \
  --netuid <int> \
  --destination-hotkey <ss58|name> -w my_coldkey
```

## Python [#python]

```python
import bittensor as bt
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = bt.MoveLock(netuid=1, destination_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](/docs/concepts/client).) Or build the intent by op name, as
an agent would:

```python
result = sub.execute_tool("move_lock", {...}, wallet)
```

## On-chain implementation [#on-chain-implementation]

`SubtensorModule.move_lock` — [`pallets/subtensor/src/macros/dispatches.rs#L2282`](/code/pallets/subtensor/src/macros/dispatches.rs#L2280-L2289):

```rust
#[pallet::call_index(137)]
#[pallet::weight(<T as crate::pallet::Config>::WeightInfo::move_lock())]
pub fn move_lock(
    origin: OriginFor<T>,
    destination_hotkey: T::AccountId,
    netuid: NetUid,
) -> DispatchResult {
    let coldkey = ensure_signed(origin)?;
    Self::do_move_lock(&coldkey, &destination_hotkey, netuid)
}
```

Delegates to [`do_move_lock`](/code/pallets/subtensor/src/staking/lock.rs#L1749).

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