Transactions

terminate-lease

Terminate an ended lease and take subnet ownership (beneficiary only).

View as Markdown

Ends the lease and transfers full subnet ownership to the beneficiary: contributor dividends stop and the subnet becomes an ordinary owned subnet. Only the lease's beneficiary can call it, and only after the lease's end block has passed — earlier attempts fail, and perpetual leases (no end block) can never be terminated this way. Check the lease's end block with the lease read before calling.

SignerPalletWraps
coldkeySubtensorModuleSubtensorModule.terminate_lease

Parameters

ParameterTypeRequiredDescription
lease_idintegeryesLease to terminate (see the leases read).
hotkey_ss58stringnoBeneficiary hotkey recorded as the subnet's owner hotkey; defaults to the wallet's hotkey.

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 terminate-lease \
  --lease-id <int> --dry-run
btcli tx terminate-lease \
  --lease-id <int> -w my_coldkey

Python

import bittensor as sub
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = sub.TerminateLease(lease_id=0)

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("terminate_lease", {...}, wallet)