# fund-evm-key (/docs/tx/fund-evm-key)

An EVM account's native balance lives at its ss58 *mirror* address
(`blake2_256("evm:" ++ h160)`). This intent computes the mirror and
transfers TAO to it; the funds then appear as the EVM account's balance
in MetaMask or any Ethereum tool (displayed with 18 decimals there:
1 TAO = 1e18). Like any transfer this is irreversible — and only the
holder of the EVM private key can move the funds afterwards, so
double-check the address.

| Signer    | Origin                                 | Pallet   | Wraps                          |
| --------- | -------------------------------------- | -------- | ------------------------------ |
| `coldkey` | signed account (pallet role may apply) | Balances | `Balances.transfer_keep_alive` |

## Parameters [#parameters]

| Parameter     | Type              | Required | Description                                   |
| ------------- | ----------------- | -------- | --------------------------------------------- |
| `evm_address` | string            | yes      | EVM address to fund, as 0x-prefixed h160 hex. |
| `amount_tao`  | number \| `"all"` | yes      | How much TAO to send.                         |

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

## CLI [#cli]

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

```bash
btcli tx fund-evm-key \
  --evm-address <value> \
  --amount-tao <amount|all> --dry-run
btcli tx fund-evm-key \
  --evm-address <value> \
  --amount-tao <amount|all> -w my_coldkey
```

## Python [#python]

```python
import bittensor as bt
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = bt.FundEvmKey(evm_address="...", 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](/docs/concepts/client).) Or build the intent by op name, as
an agent would:

```python
result = sub.execute_tool("fund_evm_key", {...}, wallet)
```

## On-chain implementation [#on-chain-implementation]

`Balances.transfer_keep_alive` is implemented by Substrate's `pallet_balances`, outside this repository's pallets.

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