Transactions

swap-coldkey-announced

Execute a previously announced coldkey swap (after the delay has passed).

View as Markdown

Step two of the two-step migration: reveals the new coldkey and moves everything the signing coldkey owns — balance, stake, and subnet ownership — to it. Irreversible once included. The revealed key must hash to exactly what announce_coldkey_swap committed to, and the call fails if the announcement delay has not elapsed, no announcement exists, or the swap is frozen by a dispute. After it succeeds, the old coldkey is empty; all future operations sign with the new coldkey.

SignerPalletWraps
coldkeySubtensorModuleSubtensorModule.swap_coldkey_announced

Parameters

ParameterTypeRequiredDescription
new_coldkey_ss58stringyesColdkey receiving everything; must match the previously announced hash 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

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

btcli tx swap-coldkey-announced \
  --new-coldkey <ss58|name> --dry-run
btcli tx swap-coldkey-announced \
  --new-coldkey <ss58|name> -w my_coldkey

Python

import bittensor as sub
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = sub.SwapColdkeyAnnounced(new_coldkey_ss58="5F...")

async with sub.Client("finney") as client:
    plan = await client.plan(intent, wallet)   # fee, effects, policy — no submission
    result = await client.execute(intent, wallet)
    if not result.success:
        print(result.error.code, result.error.remediation)

Or build it by op name, as an agent would:

await client.execute_tool("swap_coldkey_announced", {...}, wallet)