The Big Picture
POW registration requires solving a computational puzzle. Difficulty controls how hard that puzzle is. When many people try to register, difficulty rises (like Bitcoin mining). When registration cools off, difficulty drops. It's a self-balancing mechanism that keeps registration accessible but not free.
Why This Matters
Thinking about POW registration? Difficulty tells you how much compute you'll need. High difficulty might make burn registration more economical. This is essential for cost planning.
Example Scenario
Query Difficulty(netuid=1) returns 10000000. This is the target difficulty. Your POW solution must produce a hash below this target. Lower target = harder to find valid solutions = more compute needed.
Common Questions
- How does difficulty adjust?
- Based on TargetRegistrationsPerInterval. If actual registrations exceed target, difficulty increases. If below target, difficulty decreases. Check AdjustmentInterval for frequency.
- Should I use POW or burn?
- Compare the electricity/hardware cost to solve the POW against the current Burn cost. On popular subnets, burn is often cheaper for occasional registrations.
- What's the unit?
- Difficulty is a u64 target value. Your POW hash must be less than this value. Higher number = easier (more valid hashes), lower number = harder.
- Are there limits?
- Yes, check MinDifficulty and MaxDifficulty for the bounds. Difficulty won't go below or above these.
Use Cases
- Estimate computational cost before POW registration
- Choose between POW and burn registration based on cost
- Monitor subnet popularity through difficulty proxy
- Build registration cost estimators
- Track network activity via difficulty adjustments
Purpose & Usage
Purpose
Control registration computational cost - harder difficulty means more computation needed to register.
Common Query Patterns
- Query by netuid before attempting POW registration
- Monitor difficulty changes over time
- Compare difficulty across subnets
Query Keys
| # | Name | Type | Description |
|---|---|---|---|
| 1 | key1 | u16 | key1 (u16) |
Stored Value
Relationships
Modified By
Related Events
Code Examples
import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";
const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });
// Query Difficulty storage
const key1 = 0;
const result = await api.query
[stringCamelCase("SubtensorModule")]
[stringCamelCase("Difficulty")](
key1
);
console.log("Difficulty:", result.toHuman());Runtime Info
View Source- Pallet
- SubtensorModule
- Storage Kind
- Map
- First Version
- v101
- Current Version
- v393