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

EVM smart contracts on Bittensor

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
  • Access standard Ethereum JSON-RPC methods from this EVM compatibility layer on Subtensor, Bittensor's substrate blockchain.
notes
notedescription
EVM smart contracts execute on Bittensor, not Ethereum blockchainOperations performed by subtensor EVM are executed solely on the subtensor blockchain, not on the Ethereum blockchain.
1 TAO = 1e18 on subtensor EVMWhile working with the subtensor EVM, 1 TAO should be written as 1 followed by 18 zeroes, i.e., 1e18.
For example: const value = BigInt(0.5 * 1e18).toString();.
networks
MAINNETTESTNETLOCALNET
RPC URLhttps://lite.chain.opentensor.aihttps://test.chain.opentensor.aihttp://localhost:9944
Chain ID964945see below
Test TAONoneAvailable on requestUse Alice account

See section EVM 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

Run the below tutorials to learn how to use the EVM feature on the Bittensor blockchain.

Bittensor vs Ethereum Smart Contracts
A beginner-friendly introduction to EVM on Bittensor.
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
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
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