Coldkey Swap

Identity

Mechanism to transfer ownership of all hotkeys and stake from one coldkey to another.

Click items to navigate to their reference pages.

The Big Picture

Coldkey swap is the "account migration" tool for Bittensor. If your coldkey is compromised or you need to move to a new wallet, this mechanism transfers everything — hotkeys, stake, delegate status — to a new coldkey in a single operation. Safety delays prevent malicious swaps.

Why This Matters

If your coldkey is ever compromised, coldkey swap is your recovery mechanism. Understanding the delay and approval process is critical for emergency planning.

Example Scenario

A validator with 10,000 TAO staked detects suspicious activity on their coldkey. They schedule a swap to a fresh coldkey. After the safety period (~7 days), the swap executes if no one contests it. For stakes over a threshold, the senate must approve the swap.

Common Questions

Can I cancel a scheduled swap?
There is no explicit cancel. After ColdkeySwapRescheduleDuration blocks, you can reschedule a new swap which overwrites the pending one.
What happens to my stake during the delay?
Everything stays exactly as is during the delay period. Staking and unstaking still work normally from the old coldkey.

Use Cases

  • Emergency key rotation after compromise
  • Planned migration to hardware wallet
  • Organizational key management
  • Building account recovery tools

Coldkey swap allows users to migrate their entire identity to a new coldkey address. This transfers all hotkey associations, stake positions, delegate status, and other coldkey-linked data. The operation has a safety delay (ColdkeySwapScheduleDuration) before executing via the scheduler.

Triggers

  • User submits schedule_swap_coldkey call

Inputs (1)

ItemTypeRole
schedule_swap_coldkey SubtensorModulecallInitiate coldkey transfer

Outputs (1)

ItemTypeRole
ColdkeySwapped SubtensorModuleeventEmitted when swap completes

Source Files

pallets/subtensor/src/swap/swap_coldkey.rs
do_swap_coldkey()

Formulas

Swap Procedure

Coldkey swap migrates all associations from old coldkey to new coldkey in a single atomic operation after the safety delay.

1. Schedule swap: record (old_coldkey, new_coldkey, schedule_block)
2. Pay swap cost (get_key_swap_cost), burned from old coldkey
3. Wait ColdkeySwapScheduleDuration blocks
4. Scheduler executes: migrate all hotkeys, stake, delegate status
5. Emit ColdkeySwapped event

Version History

v300 Coldkey swap mechanism introduced
v340 Safety delay period extended
v360 Swap cost and schedule duration parameters tuned