Skip to main content
SUBMIT A PRSUBMIT AN ISSUElast edit: May 16, 2025

Bittensor EVM Smart Contracts

Full Ethereum virtual machine (EVM) compatibility is now available on subtensor (the blockchain in Bittensor). 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.

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

Networks

You can deploy smart contracts on Bittensor main net (aka 'finney'), test network, or on your own locally deployed Bittensor chain.

Network details
MAINNETTESTNETLOCALNET
RPC URLhttps://lite.chain.opentensor.aihttps://test.chain.opentensor.aihttp://localhost:9944
Chain ID964945see below
Test TAONoneAvailable on requestUse Alice account
Set-up GuideEVM Testnet with Metamask WalletEVM Localnet with Metamask Wallet for setting up a Local net.

Available Precompiles

The following precompiles are available on the Bittensor EVM:

Standard Ethereum Precompiles
  • ECRecover (0x1) - Recover the address associated with the public key from elliptic curve signature
  • Sha256 (0x2) - SHA-256 hash function
  • Ripemd160 (0x3) - RIPEMD-160 hash function
  • Identity (0x4) - Identity function (returns input data)
  • Modexp (0x5) - Modular exponentiation
  • Sha3FIPS256 (0x400) - SHA3-256 hash function (FIPS variant)
  • ECRecoverPublicKey (0x401) - Recover the public key from an elliptic curve signature
Bittensor-Specific Precompiles
  • Ed25519Verify - Verify Ed25519 signatures
  • BalanceTransfer - Transfer TAO between accounts
  • StakingPrecompile
  • StakingPrecompileV2 (0x805) - Main staking operations including:
    • addStake - Add stake to a hotkey
    • removeStake - Remove stake from a hotkey
    • moveStake - Move stake between hotkeys
    • transferStake - Transfer stake between coldkeys
    • getTotalColdkeyStake - Get total stake for a coldkey
    • getTotalHotkeyStake - Get total stake for a hotkey
    • getStake - Get stake between specific hotkey and coldkey
    • addProxy - Add a proxy delegate
    • removeProxy - Remove a proxy delegate
  • SubnetPrecompile - Manage subnet operations
  • MetagraphPrecompile - Interact with the metagraph
  • NeuronPrecompile - Manage neuron operations
  • UidLookupPrecompile

Ethereum vs Bittensor EVM Smart Contracts

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.

When we say “smart contracts on Bittensor” we refer to the new EVM compability feature in the Bittensor subtensor blockchain. When this EVM feature is turned ON, it allows the subtensor blockchain to execute Ethereum-compatible smart contracts. Note that all operations performed by this new subtensor EVM feature are executed solely on the subtensor blockchain, not on the Ethereum blockchain.

Local blockchain vs public subtensorLocal blockchain vs public subtensor Local blockchain vs public subtensorLocal blockchain vs public subtensor
Install Dependencies
Get started by installing dependencies first.
READ MORE
EVM Testnet with Metamask
Learn how to set up your Metamask wallet with EVM testnet.
READ MORE
EVM Localnet with Metamask
Set up your Metamask wallet for a localnet with EVM feature.
READ MORE
EVM Mainnet with Metamask
Learn how to set up your Metamask wallet with EVM mainnet.
READ MORE
Configure Hardhat for subtensor EVM
Using Hardhat? Configure it to work with subtensor EVM.
READ MORE
Configure Remix IDE for subtensor EVM
Remix IDE configuration to use with subtensor EVM.
READ MORE
TAO transfer from Metamask to SS58
Learn how to transfer TAO from Metamask to SS58.
READ MORE
Transfer TAO between two H160 addresses
Learn how to transfer TAO between two Ethereum H160 addresses.
READ MORE
Stake with a smart contract
Stake to a hotkey using precompiled smart contract.
READ MORE
Verify ed25519 with a precompile
Verify an ed25519 signature on subtensor EVM.
READ MORE
Troubleshooting
How to troubleshoot the most common issues.
READ MORE