Transactions

add-proxy

Authorize a delegate key to sign calls on this account's behalf.

View as Markdown

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.

SignerOriginPalletWraps
coldkeysigned account (pallet role may apply)ProxyProxy.add_proxy

Parameters

ParameterTypeRequiredDescription
delegate_ss58stringyesKey that will be allowed to sign for this account.
proxy_typestringnoScope 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.
delayintegernoAnnouncement 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

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

btcli tx add-proxy \
  --delegate <ss58|name> --dry-run
btcli tx add-proxy \
  --delegate <ss58|name> -w my_coldkey

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.) Or build the intent by op name, as an agent would:

result = sub.execute_tool("add_proxy", {...}, wallet)

On-chain implementation

Proxy.add_proxypallets/proxy/src/lib.rs#L267:

#[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.

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