Docs

subnetInfo_getSubnetsInfo_v2 - Bittensor RPC Method

Retrieve the V2 SCALE-encoded subnet catalog for every active Bittensor subnet. Use it for subnet discovery, dashboard backends, and comparing live subnet state.

Overview

The subnetInfo_getSubnetsInfo_v2 method returns the newer subnet catalog format for the full Bittensor network. Like subnetInfo_getSubnetsInfo, it gives you a network-wide view of active subnets, but it is designed for newer runtimes that package more subnet state into a single SCALE payload.

Use this method when you need a single request that can drive subnet discovery, analytics backends, or control-plane tooling. It is especially useful when you want to compare many subnets at once instead of making one request per subnet.

Parameters

PositionNameTypeRequiredDescription
0atBlockHashNoOptional block hash to query a historical view of the subnet catalog. Pass null for the latest state.

Response

FieldTypeDescription
resultnumber[]JSON array of SCALE bytes representing the V2 subnet catalog returned by the Bittensor runtime

The byte array decodes to a vector of Bittensor SubnetInfov2-style structures. In practice, teams use the Bittensor SDK or a registered type registry to decode the payload into subnet-level metadata, economics, and configuration values.

Common decoded fields include:

FieldTypeDescription
netuidu16The subnet identifier
ownerAccountId32The subnet owner coldkey
identityOption<SubnetIdentity>Optional human-readable subnet metadata
max_allowed_uidsu16Maximum neuron slots allowed in the subnet
tempou16Blocks between subnet incentive steps
burnu64Current registration burn cost
network_connectVec<(u16, u16)>Deprecated connectivity field that is often empty on current runtimes
emission_valuesu64Placeholder emission field; use subnetInfo_getDynamicInfo for live subnet economics

SCALE Decoding

The shared Dwellir endpoint returns this payload as a JSON byte array, not as a hex string. Decode it with the Bittensor type registry that matches the target runtime.

Using bittensor Python SDK: Use the SDK when you want decoded subnet information without manually working through SCALE bytes. The SDK is the most practical option for dashboards, subnet catalogs, and analytics tooling.

Using @polkadot/api: Register the relevant Bittensor subnet info types before decoding the returned byte array. This is the better fit when you are already running a TypeScript service that consumes multiple Bittensor RPC methods.

When to prefer v2:

  • Use subnetInfo_getSubnetsInfo_v2 when your tooling expects the newer subnet-info layout.
  • Use subnetInfo_getSubnetsInfo when you need the older layout or when your decoder is already wired to the legacy type definitions.
  • Use subnetInfo_getDynamicInfo when you only need one subnet's live economics instead of the full catalog.

Code Examples

Query with Python

Python
import requests

url = 'https://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY'

payload = {
    'jsonrpc': '2.0',
    'method': 'subnetInfo_getSubnetsInfo_v2',
    'params': [None],
    'id': 1
}

response = requests.post(url, json=payload)
result = response.json()

scale_bytes = result['result']
print(f'Subnet catalog payload size: {len(scale_bytes)} bytes')

# Decode with a Bittensor-aware type registry or SDK.

Query with cURL

Bash
curl -X POST https://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY \
  -H 'Content-Type: application/json' \
  -d '{
    "jsonrpc": "2.0",
    "method": "subnetInfo_getSubnetsInfo_v2",
    "params": [null],
    "id": 1
  }'

Common Use Cases

  • Subnet discovery — Build a current list of active Bittensor subnets and their associated metadata.
  • Analytics backends — Snapshot network-wide subnet state before deeper per-subnet processing.
  • Explorer infrastructure — Power subnet overview pages without making dozens of individual requests.
  • Historical comparisons — Query the catalog at a specific block hash to compare how the subnet set changed over time.