|
| 1 | +# BIT-0006: Sub-subnets |
| 2 | + |
| 3 | +- **BIT Number:** 0006 |
| 4 | +- **Title:** Sub-subnets |
| 5 | +- **Author(s):** Rhef, Greg Zaitsev |
| 6 | +- **Discussions-to:** [URL for discussion thread] |
| 7 | +- **Status:** Draft |
| 8 | +- **Type:** Core |
| 9 | +- **Created:** 2025-06-13 |
| 10 | +- **Updated:** 2025-06-13 |
| 11 | + |
| 12 | +## 🔍 Abstract |
| 13 | + |
| 14 | +This BIT proposes the introduction of subsubnets, a hierarchical layer within each subnet to support multiple, independent weight spaces, emissions, and incentive flows under a single subnet umbrella. Subsubnets enable fine-grained control over miner task allocation, incentive distribution, and validator decision-making. Each subnet can define up to 8 subsubnets, with weights and rewards tracked independently per subsubnet. |
| 15 | + |
| 16 | +## 🔧 Motivation |
| 17 | + |
| 18 | +Subnets today treat miner weights as a single flat structure, limiting expressivity in multi-task or multi-objective networks. Introducing subsubnets allows a single subnet to support multiple distinct task markets, enabling specialized incentive tracking, validator scoring, and emission logic per group. This facilitates complex workloads, parallel task handling, and flexible protocol design without fragmenting network security or duplicating validator logic. |
| 19 | + |
| 20 | +## 🧪 Specification |
| 21 | + |
| 22 | +### Subsubnet Limits |
| 23 | +- Each subnet defines a `desired_subsubnet_limit` hyperparameter (default = 1). |
| 24 | +- A global limit `global_subsubnet_limit_per_subnet` acts as a ceiling. |
| 25 | +- The active value `subsubnet_limit_in_force` is updated every subnet superblock (every 20 tempos) as: |
| 26 | + |
| 27 | +``` |
| 28 | +subsubnet_limit_in_force = min( |
| 29 | + desired_subsubnet_limit, |
| 30 | + global_subsubnet_limit_per_subnet, |
| 31 | + subsubnet_limit_in_force_last + global_subsubnet_decrease_per_subnet_superblock |
| 32 | +) |
| 33 | +``` |
| 34 | + |
| 35 | +### Weight Operations |
| 36 | +- `set_weights`, `commit_weights`, and `reveal_weights` accept a `subsubnet_id` argument. |
| 37 | +- Legacy operations default to `subsubnet_id = 0`. |
| 38 | +- Weight writes are disallowed above the current `subsubnet_limit_in_force`. |
| 39 | + |
| 40 | +### Validator Permissions |
| 41 | +- Only the subnet owner or sudo can change the `desired_subsubnet_limit` or emission proportions. |
| 42 | +- Validators may set weights for any subsubnet within the current limit. |
| 43 | + |
| 44 | +### Emission Logic |
| 45 | +- Emission is distributed across subsubnets according to a configured ratio (default Fibonacci: [1, 2, 3, 5, 8, 13, 21, 34]). |
| 46 | +- Each subsubnet computes trust, consensus, and incentive separately. |
| 47 | +- Final vtrust is aggregated across subsubnets weighted by their emissions. |
| 48 | +- Rounding is preserved across subsubnet splits to ensure exact conservation of emitted tokens. |
| 49 | + |
| 50 | +### Edge Cases |
| 51 | +- If a subsubnet has zero consensus, it enters “Yuma emergency mode” and allocates emission proportional to stake. |
| 52 | +- Miners without weights in a subsubnet receive no emission from it. |
| 53 | +- Subsubnets with no miners are gracefully handled. |
| 54 | + |
| 55 | +### Compatibility |
| 56 | +- Subnets with a single subsubnet behave exactly as today (ID 0). |
| 57 | +- Legacy miners/validators interoperate with subsubnet-enabled subnets via `subsubnet_id = 0`. |
| 58 | +- Storage and RPC interfaces remain backward-compatible. |
| 59 | + |
| 60 | +## ✅ Rationale |
| 61 | + |
| 62 | +Subsubnets allow a single subnet to support multiple incentive partitions, enabling more advanced use cases (e.g. routing, filtering, classification, multitask models). They preserve validator overhead by avoiding new subnets while enabling greater expressivity. The design enforces strict backward compatibility and safe transitions when limits change. |
| 63 | + |
| 64 | +## 📘 Reference Implementation |
| 65 | + |
| 66 | +- Will be implemented in the `subtensor` core repo. |
| 67 | +- Interfaces for weight setting, emission, and validator ranking will be extended to include `subsubnet_id`. |
| 68 | + |
| 69 | +## 🧱 Backward Compatibility |
| 70 | + |
| 71 | +- All existing weight operations apply to `subsubnet_id = 0`. |
| 72 | +- Subnets not opting into subsubnets will remain functionally identical. |
| 73 | +- Miners and validators on older versions will continue functioning under subsubnet_id 0. |
| 74 | + |
| 75 | +## 📈 Test Cases |
| 76 | + |
| 77 | +See BIT test document `subsubnet_test_plan.bit`. |
| 78 | + |
| 79 | +## 💬 Discussion |
| 80 | + |
| 81 | +- Emission proportion customization per subsubnet opens design space for subnet-specific task prioritization. |
| 82 | +- Validator voting on miner subsubnet weights (via kappa) may be used for consensus and reward routing. |
| 83 | +- Handling of dynamic emission distribution and cleanups when limits decrease must be conservative and race-free. |
| 84 | + |
| 85 | +## 🛠️ Future Work |
| 86 | + |
| 87 | +- **Custom Emission Proportions**: Subnet owners will be able to customize the proportion of emission allocated to each subsubnet, enabling tailored incentive strategies based on task complexity or utility. |
| 88 | + |
| 89 | +- **Dynamic Global Subsubnet Limit**: A globally enforced ceiling on subsubnet counts will be adjustable over time. Reductions to this limit will automatically trigger cleanup of excess subsubnet data across all subnets. |
| 90 | + |
| 91 | +- **Hyperparameter Governance**: Subnet owners will gain control over additional subsubnet-specific hyperparameters beyond the subsubnet limit, allowing more granular tuning of behavior. |
| 92 | + |
| 93 | +- **Validator-Driven Incentive Routing**: Using the kappa stake majority mechanism, validators may vote to adjust miner incentive shares within subsubnets, supporting flexible prioritization of behaviors and tasks. |
| 94 | + |
| 95 | +- **Additional Governance Extensions**: Future extensions may include subsubnet-specific pruning policies, trust calculation curves, or dynamic validator selection strategies. |
| 96 | + |
| 97 | + |
| 98 | +## 🔐 Security Considerations |
| 99 | + |
| 100 | +The introduction of subsubnets introduces additional state surfaces and per-subsubnet tracking, which must be secured against manipulation: |
| 101 | + |
| 102 | +- **Permission Enforcement**: Only subnet owners or sudo must be able to modify `desired_subsubnet_limit`, emission proportions, or trigger subsubnet resets. Improper permission checks could allow hostile takeovers of reward logic. |
| 103 | + |
| 104 | +- **Weight Isolation**: Weights across subsubnets must remain isolated. Cross-contamination could allow miners to gain rewards in unintended subsubnets. |
| 105 | + |
| 106 | +- **Rounding and Overflow**: Emission rounding and aggregation must be implemented carefully to prevent underflow/overflow or token inflation. |
| 107 | + |
| 108 | +- **Backward Compatibility**: Any logic paths introduced for subsubnet IDs must default to safe values (e.g., subsubnet_id = 0) to avoid denial-of-service for legacy miners and validators. |
| 109 | + |
| 110 | +- **Cleanups**: When limits are decreased, weight purging must be idempotent and bounded to prevent validator or miner state desynchronization. |
| 111 | + |
| 112 | +## © Copyright |
| 113 | + |
| 114 | +This document is licensed under [The Unlicense](https://unlicense.org/). |
0 commit comments