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

The foundation of the keep-the-coldkey-offline setup: sign this once from
the coldkey, then let the delegate submit day-to-day calls with
`proxy_for=<this account>`. The chain reserves a small deposit from the
signer per delegation (returned on removal). The delegate can act within
`proxy_type` immediately (or after announcing, if `delay` > 0) — grant
only to keys you control or fully trust.

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

## Parameters [#parameters]

| Parameter       | Type    | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| --------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `delegate_ss58` | string  | yes      | Key that will be allowed to sign for this account.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `proxy_type`    | string  | no       | Scope of calls the delegation covers. One of: Any, Owner, NonCritical, NonTransfer, Senate, NonFungible, Triumvirate, Governance, Staking, Registration, Transfer, SmallTransfer, RootWeights, ChildKeys, SudoUncheckedSetCode, SwapHotkey, SubnetLeaseBeneficiary, RootClaim. Triumvirate, Senate, Governance, and RootWeights are deprecated on the current runtime: they deny all calls, so a proxy of those types can dispatch nothing. Prefer the narrowest type that covers your use; Any can do everything the account can, including transfers. |
| `delay`         | integer | no       | Announcement delay in blocks: the delegate must announce each call and wait this long before executing it, giving you time to veto. 0 executes immediately.                                                                                                                                                                                                                                                                                                                                                                                             |

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 add-proxy \
  --delegate <ss58|name> --dry-run
btcli tx add-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.AddProxy(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("add_proxy", {...}, wallet)
```

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

`Proxy.add_proxy` — [`pallets/proxy/src/lib.rs#L267`](/code/pallets/proxy/src/lib.rs#L265-L276):

```rust
#[pallet::call_index(1)]
#[pallet::weight(T::WeightInfo::add_proxy(T::MaxProxies::get()))]
pub fn add_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::add_proxy_delegate(&who, delegate, proxy_type, delay)
}
```

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

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