# remove-proxy (/docs/tx/remove-proxy)

The (delegate, proxy\_type, delay) triple must match the original
`add_proxy` exactly — a mismatch fails with NotFound rather than removing
a different delegation. The proxy deposit reserved at add time is returned
to the signer. Check current delegations with `btcli query proxies`.

| Signer    | Origin                                 | Pallet | Wraps                                                            |
| --------- | -------------------------------------- | ------ | ---------------------------------------------------------------- |
| `coldkey` | signed account (pallet role may apply) | Proxy  | [`Proxy.remove_proxy`](/code/pallets/proxy/src/lib.rs#L285-L296) |

## Parameters [#parameters]

| Parameter       | Type    | Required | Description                                                 |
| --------------- | ------- | -------- | ----------------------------------------------------------- |
| `delegate_ss58` | string  | yes      | Delegate whose authorization to revoke.                     |
| `proxy_type`    | string  | no       | Type the delegation was granted with (must match exactly).  |
| `delay`         | integer | no       | Delay the delegation was granted with (must match exactly). |

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 remove-proxy \
  --delegate <ss58|name> --dry-run
btcli tx remove-proxy \
  --delegate <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.RemoveProxy(delegate_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("remove_proxy", {...}, wallet)
```

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

`Proxy.remove_proxy` — [`pallets/proxy/src/lib.rs#L287`](/code/pallets/proxy/src/lib.rs#L285-L296):

```rust
#[pallet::call_index(2)]
#[pallet::weight(T::WeightInfo::remove_proxy(T::MaxProxies::get()))]
pub fn remove_proxy(
    origin: OriginFor<T>,
    delegate: AccountIdLookupOf<T>,
    proxy_type: T::ProxyType,
    delay: BlockNumberFor<T>,
) -> DispatchResult {
    let who = ensure_signed(origin)?;
    let delegate = T::Lookup::lookup(delegate)?;
    Self::remove_proxy_delegate(&who, delegate, proxy_type, delay)
}
```

Delegates to [`remove_proxy_delegate`](/code/pallets/proxy/src/lib.rs#L986).

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