Transactions

associate-evm-key

Associate an EVM key with a hotkey on a subnet.

View as Markdown

Links an Ethereum-style (H160) address to the signing hotkey on one subnet, letting EVM-side activity be attributed to that neuron. Signed by the hotkey, and additionally proven by the EVM key itself: signature must be an EIP-191 personal-sign signature by the EVM key over the message hotkey_pubkey (32 bytes) ++ keccak_256(scale(block_number)), where the block number is SCALE-encoded (u64 little-endian). Use bittensor.evm.transactions.association_proof to produce it (it needs the EVM private key); a wrong message, block number, or key makes the chain reject the call. Prerequisites: the hotkey must be registered on netuid (else HotKeyNotRegisteredInSubNet) and have an owning coldkey, and re-association is rate-limited to once per 7,200 blocks (~1 day) per neuron.

SignerPalletWraps
hotkeySubtensorModuleSubtensorModule.associate_evm_key

Parameters

ParameterTypeRequiredDescription
netuidintegeryesSubnet on which the EVM key association is recorded.
evm_keystringyesEVM address to link to the hotkey, as 0x-prefixed H160 hex.
block_numberintegeryesBlock number the signature was produced for; part of the signed message.
signaturestringyesThe EVM key's ownership proof, as 0x-prefixed hex: an EIP-191 personal-sign signature over the hotkey public key concatenated with keccak_256 of the SCALE-encoded block number.

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 associate-evm-key \
  --netuid <int> \
  --evm-key <value> \
  --block-number <int> \
  --signature <value> --dry-run
btcli tx associate-evm-key \
  --netuid <int> \
  --evm-key <value> \
  --block-number <int> \
  --signature <value> -w my_coldkey

Python

import bittensor as sub
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = sub.AssociateEvmKey(netuid=1, evm_key="...", block_number=0, signature="...")

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