Skip to main content

Bittensor EVM Smart Contracts

Last updated: Aug 03, 2026

A full ethereum virtual machine (EVM) runtime operates as an application layer on top of the Bittensor blockchain (Subtensor). This allows users to:

  • deploy most EVM smart contracts on subtensor without changing the code,
  • interact with deployed smart contracts on the subtensor blockchain, and
  • access standard Ethereum JSON-RPC methods.
info

Bittensor EVM smart contracts are executed solely on the Bittensor blockchain, not on the Ethereum blockchain.

See:

EVM and Subtensor wallets on the Bittensor blockchian

Bittensor wallets are based on Polkadot-style SS58 addresses, whereas Ethereum uses H160 addresses.

The holder of a private key for an SS58 address based on the corresponding public key can sign transactions on any Bittensor chain for that address. Anyone who creates key-pairs using btcli wallet, for example, holds the private key and the corresponding seed phrase, and hence can sign Bittensor transactions for that wallet.

Similarly, creating an Ethereum wallet gives you control of the H160 private key for the corresponding public key.

info

You can easily convert an H160 address to an SS58 address, or vice versa, but this does not yield the corresponding private key. This means that if you create a wallet in Bittensor, you will not be able to sign Ethereum contracts with it, nor versa.

The HashedAddressMapping

Every EVM call that touches Substrate state (staking, registering, setting weights) requires a Substrate Account—AccountId32. The runtime derives this from the H160 address using a one-way hash:

AccountId32 = Blake2b_256("evm:" ++ h160_bytes)

This is called HashedAddressMapping. It is deterministic — the same H160 always produces the same AccountId32 — but irreversible. You cannot reconstruct an H160 private key from the AccountId32.

How it works

When a smart contract calls a precompile function—for example, addStake on StakingV2, the contract's own H160 address is hashed to produce the coldkey for the stake position. The stake is held by the contract on-chain, not by the user who called the contract.

Use the AddressMapping precompile (0x80C) to compute the Substrate coldkey for any EVM address.

Types of EVM wallets

In the context of Bittensor EVM we can distinguish between the types of wallets available:

TypeCreated withCan signUsed for
EVM walletMetaMask or any Ethereum key generatorEVM transactions, precompile callsInteracting with smart contracts, calling precompiles
Bittensor walletbtcli wallet, Bittensor SDKSubstrate extrinsicsStaking via btcli/SDK, key operations, governance
Gas fees on Bittensor EVM

The Bittensor EVM uses the standard Ethereum gas model. Gas fees are paid in TAO (not a separate fee token). Always ensure that you have enough TAO in required the EVM wallet to cover the gas fees for each transaction.

Ethereum vs Bittensor EVM smart contract runtime

On the Ethereum network, nodes such as full nodes, validator nodes and archive nodes run the Ethereum Virtual Environment (EVM) run-time environment. Smart contracts operate under this EVM. See the below high-level diagram.

info

Note that all operations performed by Bittensor EVM are executed solely on the Bittensor blockchain, not on the Ethereum blockchain.

Local blockchain vs public subtensorLocal blockchain vs public subtensor Local blockchain vs public subtensorLocal blockchain vs public subtensor