add_stake

Call Re-added v101 → v219, v233 → current #2

Transfers TAO from coldkey 's free balance to stake on a hotkey .

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: stakersdelegatorsvalidatorswallets

The Big Picture

Staking is how you put your TAO to work. Your stake earns emissions based on the hotkey's subnet performance. Stake to validators (delegates) for passive income, or stake to your own hotkey to boost your mining/validating power.

Why This Matters

Liquid TAO sitting in your wallet earns nothing. Staking it to a productive hotkey earns you a share of their emissions. This is the fundamental way to grow your TAO holdings without running infrastructure.

Example Scenario

You have 100 TAO and want passive income. You find a validator with good performance and low take. You call add_stake(hotkey=validator, netuid=1, amount=100 TAO). Your TAO converts to Alpha on subnet 1, staked to that validator. Now you earn a share of their emissions.

Common Questions

How quickly do I start earning?
Immediately after the transaction confirms. Your stake is active from the next block.
Can I stake to any hotkey?
Yes, if they're registered on the target subnet. You don't need permission to stake to a delegate, but non-delegates can only receive stake from their own coldkey.

Use Cases

  • Stake to your own hotkey to increase validator power
  • Delegate to a validator to earn passive income
  • Increase your stake for better subnet positioning

From Chain Metadata

Adds stake to a hotkey. The call is made from the coldkey account linked in the hotkey. Only the associated coldkey is allowed to make staking and unstaking requests. This protects the neuron against attacks on its hotkey running in production code.

Part of: Stake Operations

Input Parameters

#NameTypeDescription
0
hotkey
AccountId Validator's hot wallet to stake to (hex -> SS58)
1
netuid
u16 Subnet/network identifier (0-65535)
2
amount_staked
u64 amount_staked (u64) (RAO -> TAO (/ 10^9))

Permissions

Origin
Signed
Required Role
Authorization Checks
  • Coldkey must be associated with the target hotkey

Requirements

  • Signer (coldkey) has sufficient free balance
  • Hotkey is registered on at least one subnet
  • Amount meets minimum stake requirement
  • Coldkey is authorized to stake to this hotkey

Effects

Postconditions

  • Coldkey balance decreased by stake amount
  • Hotkey's total stake increased
  • Network's TotalStake increased

Side Effects

  • May update alpha stake on subnet
  • May affect validator ranking if staking to validator

Possible Errors

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Build add_stake call
const hotkey = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const netuid = 1;
const amount_staked = 1_000_000_000n;

const call = api.tx[stringCamelCase("SubtensorModule")][stringCamelCase("add_stake")](
  hotkey,
  netuid,
  amount_staked
);

On-Chain Activity

Usage Frequency
●●●●●○ Core 1M–10M extrinsics

Primary protocol calls

#11 most used call

Success Rate Near-certain

Over 95% of submissions succeed

As of block 7,429,232

Version History

v101 block 1 2 args
v233 block 4,920,350 3 args Current

Runtime Info

View Source
Pallet Index
7
Call Index
2
First Version
v101
Current Version
v393