Transactions

evm-withdraw

Claim TAO deposited to the coldkey's truncated EVM mirror.

View as Markdown

Every native account controls one EVM address: the first 20 bytes of its public key (the truncated mapping). TAO sent from MetaMask to that address's mirror can be pulled into the native account with this call — the EVM-to-substrate path that needs no EVM gas. The flow: send TAO from the EVM wallet to the address shown by btcli evm deposit-address, then claim it with btcli evm claim-deposit (or btcli tx evm-withdraw). This is not btcli evm send-to-ss58, which spends from a stored EVM key via the balance-transfer precompile. Fails if the mirror holds less than the amount.

SignerOriginPalletWraps
coldkeysigned account (pallet role may apply)EVMEVM.withdraw

Parameters

ParameterTypeRequiredDescription
amount_taonumber | "all"yesHow much TAO to pull from the mirror.

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 evm-withdraw \
  --amount-tao <amount|all> --dry-run
btcli tx evm-withdraw \
  --amount-tao <amount|all> -w my_coldkey

Python

import bittensor as bt
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = bt.EvmWithdraw(amount_tao=1.0)

sub = bt.Subtensor()
plan = sub.plan(intent, wallet)   # fee, effects, policy — no submission
result = sub.execute(intent, wallet)
if not result.success:
    print(result.error.code, result.error.remediation)

(bt.Subtensor is also the async client — async with bt.Subtensor() as client: — see The client.) Or build the intent by op name, as an agent would:

result = sub.execute_tool("evm_withdraw", {...}, wallet)

On-chain implementation

EVM.withdraw is implemented by Frontier's pallet_evm (vendored under vendor/frontier), outside this repository's pallets.

Every file is browsable under /code exactly as built into the runtime, or as plain text under /code/raw/<path> (index: /code/index.json).