From 87af521a5608544357ce7a0f986360524930cb22 Mon Sep 17 00:00:00 2001 From: Jackalgirl <88459050+Jackalgirl@users.noreply.github.com> Date: Wed, 14 Jan 2026 18:39:34 -0600 Subject: [PATCH 1/4] Update subnet-deregistration.md (owner refunds) Added an explanatory note in the section about owner refunds to explain the more complicated state of owner refunds, as per the discussion between Doug Sillars and Vune in the general channel of the OTF Discord server on 14 January 2026. As this is based on a non-coder's interpretation of what they said, please review with extreme prejudice. Thanks! --- docs/subnets/subnet-deregistration.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/subnets/subnet-deregistration.md b/docs/subnets/subnet-deregistration.md index 6702164e4..507b1dbb3 100644 --- a/docs/subnets/subnet-deregistration.md +++ b/docs/subnets/subnet-deregistration.md @@ -102,11 +102,14 @@ When a subnet is deregistered, all alpha tokens in that subnet are liquidated an ``` Where `owner_received_emission_in_tao` is the TAO value of the owner's cut of all emissions received during the subnet's lifetime. -3. **Enumerate alpha Holders**: All alpha token holders and their stake amounts are collected + :::info **Note:** the above calculation only applies to subnets number 64+ that were registered *after* the dTAO upgrade, but prior to the implementation of post-dTAO subnet deregistration, which went into on 01 October 2025 (50400 blocks after the reimplementation of subnet deregistration via [BIT-0016](https://github.com/opentensor/bits/pull/29). For subnets 1-63, registered prior to the implementation of dTAO, there is no owner refund (owners were already refunded when the dTAO upgrade went into effect). For subnets registered after 01 October 2025 (50400 blocks after the reimplementation of subnet deregistration via [BIT-0016](https://github.com/opentensor/bits/pull/29), there is **no refund for owners** -- the owner refund is equal to the emission that the owner earns after registration.) +::: + +4. **Enumerate alpha Holders**: All alpha token holders and their stake amounts are collected -4. **Extract TAO Pool**: The subnet's TAO pool (`SubnetTAO`) is extracted for distribution +5. **Extract TAO Pool**: The subnet's TAO pool (`SubnetTAO`) is extracted for distribution -5. **Distribution**: TAO is distributed proportionally to alpha holders: +6. **Distribution**: TAO is distributed proportionally to alpha holders: - Each holder receives: `(holder_alpha_value / total_alpha_value) * pool_tao` - TAO is credited directly to each holder's coldkey free balance From 772bffbc33aa6fe4d9ebb0f16f0ae7d40a121f30 Mon Sep 17 00:00:00 2001 From: Dera Okeke Date: Thu, 15 Jan 2026 16:03:54 +0100 Subject: [PATCH 2/4] coldkey swap announcement --- docs/learn/announcements.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/learn/announcements.md b/docs/learn/announcements.md index 1754f7660..2a7ba8d1f 100644 --- a/docs/learn/announcements.md +++ b/docs/learn/announcements.md @@ -6,6 +6,19 @@ title: "Announcements and Developments" This page tracks recent and upcoming changes to the Bittensor protocol and other major events in the Bittensor ecosystem. +**January, 2026** + +## Updated coldkey swap mechanism + +**Status**: In development + +- **What**: Coldkey swap transitions from a schedule-based system to an "Announce-and-Execute" workflow, requiring users to finalize the swap after a mandatory delay. +- **Key Features**: + - Swaps are no longer automatic. After announcing, the user must execute the swap by providing the destination coldkey to verify it against the announced hash. + - A default waiting period of 36,000 blocks (~5 days) must elapse before the announced swap can be executed. + - To prevent spam or frontrunning, a 7,200-block (~1 day) buffer is required after the initial delay expires before a new announcement can be submitted. + - The source coldkey is locked upon announcement. Once executed, all TAO, delegated stakes, and subnet ownership transfer to the destination key. + **December, 2025** ## Upcoming TAO halving From 0cc2aa17a705168312de492a5e336222b92b5f7c Mon Sep 17 00:00:00 2001 From: Dera Okeke Date: Thu, 15 Jan 2026 19:17:02 +0100 Subject: [PATCH 3/4] subnet dereg updates --- docs/subnets/subnet-deregistration.md | 54 +++++++++++++++++---------- 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/docs/subnets/subnet-deregistration.md b/docs/subnets/subnet-deregistration.md index 6702164e4..5999f6254 100644 --- a/docs/subnets/subnet-deregistration.md +++ b/docs/subnets/subnet-deregistration.md @@ -15,14 +15,15 @@ The subnet deregistration feature deployed on September 17, 2025, with a 7-day d ::: Subnet deregistration addresses network efficiency issues: + - Removes underperforming subnets that consume TAO emissions without providing value. - Unlocks TAO resources locked in underperforming subnet pools -| Parameter | Value | Description | -|-----------|-------|-------------| -| **Subnet Limit** | 128 | Maximum number of occupied subnet slots | -| **Immunity Period** | 4 months (864000 blocks) | Protection period from subnet deregistration -| **Rate Limiting** | 4 days (28800 blocks) | Minimum time between registrations/deregistrations | +| Parameter | Value | Description | +| ------------------- | ------------------------ | -------------------------------------------------- | +| **Subnet Limit** | 128 | Maximum number of occupied subnet slots | +| **Immunity Period** | 4 months (864000 blocks) | Protection period from subnet deregistration | +| **Rate Limiting** | 2 days (14400 blocks) | Minimum time between registrations/deregistrations | ## The Automated Deregistration Process @@ -33,16 +34,19 @@ The process begins when the subnet limit is reached and a new subnet attempts to Source: [`do_register_network()`](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/subnets/subnet.rs#L146-158) ### Selection Criteria + The subnet to deregister is the subnet with lowest EMA (Exponential Moving Average) price among non-immune subnets. Source code: [`get_network_to_prune()`](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/coinbase/root.rs#L753-795) The subnet price EMA uses the standard EMA formula: + $$ \mathrm{EMA}^{(t)} = \alpha \times \mathrm{current\_price} + (1 - \alpha) \times \mathrm{EMA}^{(t-1)} $$ Where $\alpha$ is calculated dynamically based on subnet age: + $$ \alpha = \frac{\mathrm{base\_alpha} \times \mathrm{blocks\_since\_start}}{\mathrm{blocks\_since\_start} + \mathrm{halving\_blocks}} $$ @@ -54,25 +58,32 @@ $$ This EMA value is recalculated for the subnet each time the coinbase function runs. See also: + - [Navigating Subtensor Codebase: Coinbase Implementation](../navigating-subtensor/emissions-coinbase) - [Exponential Moving Averages (EMAs) in Bittensor](../learn/ema.md). - ### Immunity Protection + Network immunity period is currently 4 months from registration block. - - Formula: `current_block < registered_at + network_immunity_period` - - Source code: [Immunity check](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/coinbase/root.rs#L768-770) + +- Formula: `current_block < registered_at + network_immunity_period` +- Source code: [Immunity check](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/coinbase/root.rs#L768-770) + ### Rate Limiting -Deregistration can occur at most every once every 4 days (coordinated with registration rate). - - Block-based timing: 28800 blocks ≈ 4 days at 12s/block - - [Source code](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/utils/rate_limiting.rs#L27) + +Deregistration can occur at most every once every 2 days (coordinated with registration rate). + +- Block-based timing: 14400 blocks ≈ 2 days at 12s/block +- [Source code](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/utils/rate_limiting.rs#L27) See [Rate Limits in Bittensor](../learn/chain-rate-limits.md). ## Special Cases and Edge Conditions ### All Subnets Immune + If all subnets are still within their immunity period, the system will: + 1. Return `None` from [`get_network_to_prune()`](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/coinbase/root.rs#L753-795) 2. Registration fails with `SubnetLimitReached` error 3. No subnet is deregistered until at least one becomes eligible @@ -80,36 +91,41 @@ If all subnets are still within their immunity period, the system will: ### Tied EMA Prices When multiple subnets have identical EMA prices: + 1. Select the subnet with the earliest registration timestamp 2. Implementation: [Tie-breaking logic](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/coinbase/root.rs#L774-781) ## Token Liquidation -When a subnet is deregistered, all alpha tokens in that subnet are liquidated and the subnet's TAO pool is distributed to alpha holders and to refunding the subnet owner for their lock cost minus the emissions they've received. +When a subnet is deregistered, all alpha tokens in that subnet are swapped back to TAO and distributed to the subnet's alpha holders. The subnet’s TAO reserve is then allocated to these holders and used to refund the subnet owner’s lock cost minus the emissions they've received. ### Takeaways -**Distribution Method**: Largest-remainder for fair rounding -**Owner Protection**: Owner gets refund minus emissions already received -**Immediate Effect**: All alpha tokens are destroyed and cannot be recovered +- **Distribution Method**: Largest-remainder for fair rounding +- **Owner Protection**: Owner gets refund minus emissions already received +- **Immediate Effect**: All alpha tokens are destroyed and cannot be recovered ### Liquidation Steps 1. **Dissolve Liquidity Pools**: All liquidity pools in the subnet's AMM pools are dissolved -2. **Calculate Owner Refund**: The subnet owner's refund is calculated as: +2. **Alpha-to-TAO conversion**: All alpha tokens are converted to TAO and added to the subnet's TAO reserve +3. **Calculate Owner Refund**: The subnet owner's refund is calculated as: + ``` refund = max(0, lock_cost - owner_received_emission_in_tao) ``` + Where `owner_received_emission_in_tao` is the TAO value of the owner's cut of all emissions received during the subnet's lifetime. -3. **Enumerate alpha Holders**: All alpha token holders and their stake amounts are collected +4. **Enumerate alpha Holders**: All alpha token holders and their stake amounts are collected -4. **Extract TAO Pool**: The subnet's TAO pool (`SubnetTAO`) is extracted for distribution +5. **Extract TAO Pool**: The subnet's TAO pool (`SubnetTAO`) is extracted for distribution -5. **Distribution**: TAO is distributed proportionally to alpha holders: +6. **Distribution**: TAO is distributed proportionally to alpha holders: - Each holder receives: `(holder_alpha_value / total_alpha_value) * pool_tao` - TAO is credited directly to each holder's coldkey free balance **Source Code**: + - [`destroy_alpha_in_out_stakes()`](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/staking/remove_stake.rs#L444-623) - [`prune_network()`](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/coinbase/root.rs#L377) From 6c5e90c19c87d216e6a25e7096fef2452890a0d6 Mon Sep 17 00:00:00 2001 From: Dera Okeke Date: Thu, 15 Jan 2026 23:15:30 +0100 Subject: [PATCH 4/4] subnet owner refund --- docs/subnets/subnet-deregistration.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/subnets/subnet-deregistration.md b/docs/subnets/subnet-deregistration.md index d56e742e4..e276e9d23 100644 --- a/docs/subnets/subnet-deregistration.md +++ b/docs/subnets/subnet-deregistration.md @@ -97,12 +97,12 @@ When multiple subnets have identical EMA prices: ## Token Liquidation -When a subnet is deregistered, all alpha tokens in that subnet are swapped back to TAO and distributed to the subnet's alpha holders. The subnet’s TAO reserve is then allocated to these holders and used to refund the subnet owner’s lock cost minus the emissions they've received. +When a subnet is deregistered, all alpha tokens in that subnet are swapped back to TAO and distributed to the subnet's alpha holders. The subnet’s TAO reserve is then allocated to these holders and used to refund any applicable lock cost to the subnet owner, minus the emissions they have received. ### Takeaways - **Distribution Method**: Largest-remainder for fair rounding -- **Owner Protection**: Owner gets refund minus emissions already received +- **Owner Protection**: Owners receive a lock cost refund, where applicable, minus emissions already received - **Immediate Effect**: All alpha tokens are destroyed and cannot be recovered ### Liquidation Steps @@ -117,8 +117,13 @@ When a subnet is deregistered, all alpha tokens in that subnet are swapped back Where `owner_received_emission_in_tao` is the TAO value of the owner's cut of all emissions received during the subnet's lifetime. - :::info **Note:** the above calculation only applies to subnets number 64+ that were registered *after* the dTAO upgrade, but prior to the implementation of post-dTAO subnet deregistration, which went into on 01 October 2025 (50400 blocks after the reimplementation of subnet deregistration via [BIT-0016](https://github.com/opentensor/bits/pull/29). For subnets 1-63, registered prior to the implementation of dTAO, there is no owner refund (owners were already refunded when the dTAO upgrade went into effect). For subnets registered after 01 October 2025 (50400 blocks after the reimplementation of subnet deregistration via [BIT-0016](https://github.com/opentensor/bits/pull/29), there is **no refund for owners** -- the owner refund is equal to the emission that the owner earns after registration.) -::: +:::info Subnet owner refund +The total amount returned to a subnet owner upon deregistration depends on when the subnet was registered. The refund is categorized as follows: + +- Legacy subnets registered before DTAO receive no refund as the owners were already compensated during the initial DTAO upgrade. +- Subnets registered after DTAO but before the implementation of subnet deregistration (**Oct 1, 2025**) receive a full refund. The total subnet owner payout equals the original Locked TAO (`Lock Refund + Emissions Received`). +- Subnets registered after DTAO and after the implementation of subnet deregistration (**Oct 1, 2025**) receive subnet owner emissions only. There are no lock cost refunds since the registration costs are burned. + ::: 4. **Enumerate alpha Holders**: All alpha token holders and their stake amounts are collected