# disassociate-hotkey (/docs/tx/disassociate-hotkey)

The reverse of `AssociateHotkey`. The chain refuses while anything still
refers to the hotkey: stake, a registration, children, take, a root fund or
claim, an auto-stake route, swap lineage, voting power, a lease payout, a
gamma deposit, a service, collateral or a lock.

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

## Parameters [#parameters]

| Parameter     | Type   | Required | Description                                 |
| ------------- | ------ | -------- | ------------------------------------------- |
| `hotkey_ss58` | string | no       | Hotkey to release from the signing coldkey. |

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 disassociate-hotkey --dry-run
btcli tx disassociate-hotkey -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.DisassociateHotkey()

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

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

`SubtensorModule.disassociate_hotkey` — [`pallets/subtensor/src/macros/dispatches.rs#L3469`](/code/pallets/subtensor/src/macros/dispatches.rs#L3467-L3472):

```rust
#[pallet::call_index(178)]
#[pallet::weight((Pallet::<T>::disassociate_hotkey_weight(), DispatchClass::Normal, Pays::Yes))]
pub fn disassociate_hotkey(origin: OriginFor<T>, hotkey: T::AccountId) -> DispatchResult {
    let coldkey = ensure_signed(origin)?;
    Self::do_disassociate_hotkey(&coldkey, &hotkey)
}
```

Delegates to [`do_disassociate_hotkey`](/code/pallets/subtensor/src/staking/account.rs#L17).

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