Transactions

set-perpetual-lock

Enable or disable perpetual lock mode for a coldkey on a subnet.

View as Markdown

Switches how the signing coldkey's stake lock on the subnet behaves over time: perpetual mode keeps the lock (and its conviction) in force indefinitely, while decaying mode lets it wind down over time so the stake eventually becomes liquid again. A per-coldkey, per-subnet setting that moves no funds by itself — it changes the behavior of locks created with lock_stake. Enabling perpetual mode means the locked stake stays illiquid until you switch back to decaying and the lock runs off.

SignerPalletWraps
coldkeySubtensorModuleSubtensorModule.set_perpetual_lock

Parameters

ParameterTypeRequiredDescription
netuidintegeryesSubnet whose lock mode is changed.
enabledbooleanyesTrue for perpetual mode (lock never decays), false for decaying mode.

Address parameters (--hotkey, --coldkey, --dest, ...) accept a raw ss58 address, an address-book or proxy-book name, or a local wallet/hotkey name.

CLI

Preview with --dry-run (shows fee, effects, and policy result without submitting), then submit:

btcli tx set-perpetual-lock \
  --netuid <int> \
  --enabled <true|false> --dry-run
btcli tx set-perpetual-lock \
  --netuid <int> \
  --enabled <true|false> -w my_coldkey

Python

import bittensor as sub
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = sub.SetPerpetualLock(netuid=1, enabled=True)

async with sub.Client("finney") as client:
    plan = await client.plan(intent, wallet)   # fee, effects, policy — no submission
    result = await client.execute(intent, wallet)
    if not result.success:
        print(result.error.code, result.error.remediation)

Or build it by op name, as an agent would:

await client.execute_tool("set_perpetual_lock", {...}, wallet)