Skip to content

Coldkey swap rework#184

Open
chideraao wants to merge 19 commits intomainfrom
coldkey-swap
Open

Coldkey swap rework#184
chideraao wants to merge 19 commits intomainfrom
coldkey-swap

Conversation

@chideraao
Copy link

@chideraao chideraao commented Jan 7, 2026

Updating docs with new coldkey swap mechanism.

opentensor/subtensor#2251

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 7, 2026

Deploying developer-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2c0a99a
Status: ✅  Deploy successful!
Preview URL: https://49b9991c.developer-docs-6uq.pages.dev
Branch Preview URL: https://coldkey-swap.developer-docs-6uq.pages.dev

View logs

The [`dispute_coldkey_swap`](https://github.com/opentensor/subtensor/blob/devnet-ready/pallets/subtensor/src/macros/dispatches.rs#:~:text=pub%20fn%20dispute_coldkey_swap) extrinsic is only callable by a coldkey with an active swap announcement. If no swap has been initiated, the process returns a [`ColdkeySwapAnnouncementNotFound`](https://github.com/opentensor/subtensor/blob/devnet-ready/pallets/subtensor/src/macros/errors.rs#:~:text=ColdkeySwapAnnouncementNotFound) error.
:::

After a coldkey swap is disputed, the legitimate owner must contact the Triumvirate to prove ownership of the coldkey. The coldkey remains frozen until the Triumvirate resolves the dispute and [manually resets it](https://github.com/opentensor/subtensor/blob/devnet-ready/pallets/subtensor/src/macros/dispatches.rs#:~:text=pub%20fn%20reset_coldkey_swap).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
After a coldkey swap is disputed, the legitimate owner must contact the Triumvirate to prove ownership of the coldkey. The coldkey remains frozen until the Triumvirate resolves the dispute and [manually resets it](https://github.com/opentensor/subtensor/blob/devnet-ready/pallets/subtensor/src/macros/dispatches.rs#:~:text=pub%20fn%20reset_coldkey_swap).
After a coldkey swap is disputed, the legitimate owner must contact the Triumvirate to prove ownership of the coldkey. The coldkey remains frozen until the Triumvirate resolves the dispute and [manually resets it](https://github.com/opentensor/subtensor/blob/822452f0bc205490c5ada2f2a04ad7b56ef7cc0a/pallets/subtensor/src/macros/dispatches.rs#L2470-L2490).


# Rotate/Swap your Coldkey

This page describes how to _rotate_ or _swap_ the coldkey in your wallet. Because the coldkey controls your access to your wallet, this is the equivalent of 'changing your password', although it is more complex, due to the nature of blockchain cryptography.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It sounds a bit confusing/inaccurate, because the coldkey in some way IS my wallet, the password of my coldkey is the mnemonic/seed phrase (private key).

Copy link

@MichaelTrestman MichaelTrestman Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This page describes how to _rotate_ or _swap_ the coldkey in your wallet. Because the coldkey controls your access to your wallet, this is the equivalent of 'changing your password', although it is more complex, due to the nature of blockchain cryptography.
This page describes how to _rotate_ or _swap_ the coldkey in your wallet. Because the coldkey private key controls your access to your wallet, this operation is the equivalent of 'changing your password', although it is more complex, due to the nature of blockchain cryptography.

how about this?

Copy link

@mcjkula mcjkula Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of being the equivalent of changing the password, it's like creating a new user (because the user ID/public key will be different), while migrating all the data from the user onto the new one.

NOTE: Not that this should be used to describe the procedure.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i mean the key rotation is like changing your password

Not really though, right? Because you don't keep the same user/"account" (as in wallet), you have to create a second one that you also control (that has it's own user ID/public key and password/private key) and then swap to that one.

Changing the password could be understood just changing the mnemonic/private key, because it got leaked, so then the question would be why I need a new coldkey etc.


This page describes how to _rotate_ or _swap_ the coldkey in your wallet. Because the coldkey controls your access to your wallet, this is the equivalent of 'changing your password', although it is more complex, due to the nature of blockchain cryptography.

It is *critical* to swap your coldkey if you think it has been leaked, as your coldkey secures your wallet's identity and assets.
Copy link

@mcjkula mcjkula Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not the "wallet" that has an identity, but the keys. I could have an identity on my coldkey (which would be arguably seen as the identity of my "wallet"), and each of my hotkeys could have a different identity.

Currently the waiting/locked period is **36,000 blocks** (~ **5 days**).

3. Disputation or Finalization
1. [Disputing a coldkey swap](#dispute-a-coldkey-swap) prevents the execution of the swap and locks the coldkey. At this point, the triumvirate is required to resolve the dispute. The coldkey private key is required to dispute a swap.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's not as important but just as a thought, in the "Initiation" it's already mentioned that the wallet is locked, then in "Disputation" it mentions that it locks the coldkey.

  1. Ideally the terminology would remain consistent or is there a specific reason/intend to what is meant by wallet here?
  2. the locking could potentially be clarified more, because it looks like the coldkey is being locked twice, so a user may ask what is disputing doing when it's already locked after announcing (because it blocks/locks all remaining ones like announcing/re-announcing, disputing, finalizing).

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • It mentions that the wallet "remains" locked, but as mentioned before it is completely locked at this point (where as the previous "lock" has some whitelisted extrinsics)
  • The execute_coldkey_swap() extrinsic doesn't seem to exist, it would be the swap_coldkey_announced() instead
  • "Disputes are no longer allowed", I can't seem to find that in the code of the coldkey swap. It only checks if an announcement exists and if not already disputed.
  • Option to re-announce isn't listed or shown as an option. I could think it's intentional as to showcase a "successful" swap process?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants