KeySwapCost

Constant v162 → v202, v205 → current u64

Fee for hotkey swapping operations.

Current Value

0.10 TAO (100000000 raw)

Conversion: ÷ 10^9 (RAO → TAO)

Relevant for: validatorsminersdevelopers

The Big Picture

Hotkey swapping lets you change your operational key without losing your neuron registration or stake. This is crucial for stakers - if a hotkey is compromised, swap it rather than re-registering. The cost prevents frivolous swaps while making legitimate key rotation affordable.

Why This Matters

Key rotation is a stakers best practice. Know this cost so you can budget for periodic hotkey changes without losing your position in the network.

Example

If KeySwapCost is 1 TAO and you suspect your hotkey was exposed, you pay 1 TAO to swap to a new hotkey. Your UID, stake, and registration remain intact. Without this feature, you'd have to deregister and re-register, potentially losing your slot.

Common Questions

How often should I rotate hotkeys?
Depends on your stakers posture. Enterprise operators might rotate quarterly; hobbyists might never rotate unless compromised. The cost makes frequent rotation expensive.
Can I swap to any hotkey?
The new hotkey must not already be registered. You can't swap to a hotkey that's already in use on the subnet.

From Chain Metadata

Cost of swapping a hotkey.

Use Cases

  • Hotkey swap
  • Fee calculations

Value History

VersionBlockChangeValue
v162#3,372,565Added1.00 TAO
v205#4,209,446Changed1.00 TAO → 0.10 TAO

Code Examples

import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query KeySwapCost constant
const value = await api.constants.SubtensorModule.KeySwapCost();
console.log("KeySwapCost:", value);
// Balance: divide by 10^9 for TAO
const tao = value / 1_000_000_000n;

Type Information

Type
u64
Byte Size
8 bytes
Encoding
fixed
Raw Hex
0x00e1f50500000000

Version History

v162 block 3,372,565 Added
v205 block 4,209,446 Shape modified Current

Runtime Info

Pallet
SubtensorModule
First Version
v162
Latest Version
v162
Current Runtime
v411