Docs

subnetInfo_getLockCost - Bittensor RPC Method

Retrieve the current TAO lock cost required to register a new subnet on the Bittensor network. Essential for subnet creation planning and cost analysis.

Overview

The subnetInfo_getLockCost method returns the current TAO lock cost required to register a new subnet on the Bittensor network. Creating a subnet requires locking a significant amount of TAO, and this cost fluctuates dynamically based on network demand -- when more subnets are being created, the lock cost increases; when subnet registrations slow down, it decreases.

The lock cost acts as an economic barrier to prevent spam subnet creation and ensure that subnet operators have meaningful skin in the game. The locked TAO is returned when the subnet is dissolved, but is at risk if the subnet is pruned for underperformance.

This method returns a single numeric value (in RAO, where 1 TAO = 10^9 RAO) and is not SCALE-encoded like other subnet methods.

Parameters

PositionNameTypeRequiredDescription
0atBlockHashNoOptional block hash to query at a specific block. Pass null for the latest state

Response

The result is a numeric lock cost in RAO (1 TAO = 1,000,000,000 RAO).

FieldTypeDescription
resultnumberThe current lock cost in RAO. Divide by 10^9 to get TAO

Unlike most other Bittensor custom RPC methods, this method returns a plain numeric value rather than a SCALE-encoded byte array. The result can be parsed directly as an integer without SCALE decoding.

How the Lock Cost Works

The lock cost is determined by a dynamic pricing mechanism:

  • Base cost: There is a minimum lock cost floor that prevents subnets from being created for trivial amounts
  • Demand scaling: As more subnets are registered, the cost increases exponentially. Each new subnet registration roughly doubles the cost for the next
  • Decay: When no new subnets are registered, the cost gradually decays back toward the floor over time
  • Maximum subnets: The network has a hard cap on the number of concurrent subnets. When this limit is reached, new subnets can only be created by replacing (pruning) the lowest-performing existing subnet
  • Lock vs. burn: The locked TAO is not burned -- it remains locked to the subnet and is returned if the subnet is dissolved by its owner. However, if the subnet is pruned by the network for underperformance, the lock may be lost

This creates a competitive market for subnet slots: operators must evaluate whether the lock cost is justified by the expected emissions their subnet will earn.

Code Examples

Using SubstrateExamples

Query with Python

Python
import requests
import json

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

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

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

if result.get('result') is not None:
    lock_cost_rao = int(result['result'])
    lock_cost_tao = lock_cost_rao / 1e9
    print(f'Current subnet lock cost: {lock_cost_tao:.4f} TAO')
    print(f'Lock cost in RAO: {lock_cost_rao:,}')
else:
    print('Could not fetch lock cost')

# With bittensor SDK:
# import bittensor as bt
# sub = bt.subtensor(network='finney')
# lock_cost = sub.get_subnet_burn_cost()
# print(f"Lock cost: {lock_cost / 1e9:.4f} TAO")

Full Python cost analysis

Python
import bittensor as bt
import requests
import json

sub = bt.subtensor(network='finney')

# Get current lock cost
lock_cost_rao = sub.get_subnet_burn_cost()
lock_cost_tao = lock_cost_rao / 1e9

# Get current network state for context
subnets = sub.get_all_subnets_info()
active_subnets = [s for s in subnets if s is not None]
total_subnets = len(active_subnets)

print(f"=== Subnet Registration Cost Analysis ===")
print(f"Current lock cost: {lock_cost_tao:,.2f} TAO ({lock_cost_rao:,} RAO)")
print(f"Active subnets: {total_subnets}")

# Estimate ROI: compare lock cost against potential emission income
# Average daily emission per subnet
total_daily_emissions = sum(
    (s.emission_value / 1e9) * 7200 for s in active_subnets
)
avg_daily_per_subnet = total_daily_emissions / total_subnets

print(f"\nTotal daily emissions (all subnets): {total_daily_emissions:,.2f} TAO")
print(f"Average daily emission per subnet: {avg_daily_per_subnet:,.2f} TAO")
print(f"Days to recover lock cost (at avg emission): {lock_cost_tao / avg_daily_per_subnet:,.0f}")
print(f"Annualized ROI (at avg emission): {(avg_daily_per_subnet * 365 / lock_cost_tao) * 100:,.1f}%")

# Track lock cost history by querying at past blocks
url = 'https://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY'
current_block = sub.block
check_blocks = [current_block - 7200, current_block - 7200 * 7]  # 1 day ago, 1 week ago

for blocks_ago_block in check_blocks:
    try:
        block_hash = sub.get_block_hash(blocks_ago_block)
        payload = {
            'jsonrpc': '2.0',
            'method': 'subnetInfo_getLockCost',
            'params': [block_hash],
            'id': 1
        }
        resp = requests.post(url, json=payload)
        past_cost = int(resp.json()['result']) / 1e9
        change = ((lock_cost_tao - past_cost) / past_cost) * 100
        print(f"Lock cost at block {blocks_ago_block}: {past_cost:,.2f} TAO ({change:+.1f}% change)")
    except Exception as e:
        print(f"Could not fetch historical cost: {e}")

Query with JavaScript

JavaScript
import { ApiPromise, WsProvider } from '@polkadot/api';

const provider = new WsProvider('wss://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY');
const api = await ApiPromise.create({ provider });

const lockCost = await api.rpc.subnetInfo.getLockCost();
const tao = Number(lockCost) / 1e9;
console.log(`Current subnet lock cost: ${tao.toFixed(4)} TAO`);

await api.disconnect();

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_getLockCost",
    "params": [null],
    "id": 1
  }'

Error Handling

Error ScenarioBehaviorRecommended Action
Node not syncedReturns stale cost dataCheck system_health for sync status
Invalid block hashReturns JSON-RPC errorVerify the block hash exists on chain
Method not foundError -32601Ensure node supports Bittensor custom RPCs
Result is zero or negativeShould not happen; indicates node issueRetry with a different node or check node health
Rate limit exceededHTTP 429Cache results; lock cost changes slowly (poll every few minutes)

Common Use Cases

  • Subnet creation planning — Check the current lock cost before committing to register a new subnet. Time your registration when costs are lower.
  • Cost monitoring — Track how the lock cost changes over time to understand network demand for new subnets.
  • Budget estimation — Calculate the total TAO required for subnet operations (lock cost + registration burns for neurons + staking).
  • Economic analysis — Study the relationship between lock cost dynamics and subnet creation/dissolution rates.
  • Alerting — Set up alerts when the lock cost drops below a threshold, signaling a good time to register.
  • ROI modeling — Compare the lock cost against expected subnet emissions to evaluate the investment case for creating a new subnet.
  • Competitive intelligence — Monitor lock cost trends to anticipate when new subnets are likely to be created.