diff --git a/docs/btcli.md b/docs/btcli.md
index 5dd8b4bf6..9e013acab 100644
--- a/docs/btcli.md
+++ b/docs/btcli.md
@@ -686,7 +686,7 @@ btcli wallet transfer [OPTIONS]
| `--destination`, `--dest`, `-d` | TEXT | Destination address (ss58) of the wallet (coldkey). |
| `--amount`, `-a` | FLOAT | Amount (in TAO) to transfer. |
| `--all` | | Transfer all available balance. |
-| `--all`, `-a` | | Whether to display the balances for all the wallets. |
+| `--all` | | Whether to display the balances for all the wallets. |
| `--period`, `-era` | INTEGER | Length (in blocks) for which the transaction should be valid. |
| `--wallet-name`, `--name`, `--wallet_name`, `--wallet.name` | TEXT | Name of the wallet. |
| `-p`, `--wallet-path`, `--wallet_path`, `--wallet.path` | TEXT | Path where the wallets are located. For example: `/Users/btuser/.bittensor/wallets`. |
diff --git a/docs/glossary.md b/docs/glossary.md
index 87b611ebf..1cf626f11 100644
--- a/docs/glossary.md
+++ b/docs/glossary.md
@@ -44,6 +44,12 @@ A unit of data in the Bittensor blockchain, containing a collection of transacti
**See also:** [Subtensor API](./sdk/subtensor-api.md)
+### Burn cost
+
+This refers to the required amount of TAO to be recycled when creating a new subnet, i.e., cost of registering a new subnet.
+
+**See also:** [Burn cost](./subnets/create-a-subnet.md#burn-cost)
+
## C
### Coldkey
@@ -465,6 +471,7 @@ Where:
- [`bittensor/bittensor/core/metagraph.py:325-331`](https://github.com/opentensor/bittensor/blob/main/bittensor/core/metagraph.py#L325-331)
- [`subtensor/pallets/subtensor/src/epoch/run_epoch.rs:605`](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/epoch/run_epoch.rs#L605)
+
### Recycling and burning
Tokens (TAO and subnet-specific alpha) can be 'removed from circulation', meaning these tokens exist in neither wallet nor liquidity pool, and cannot be transacted. This can happen in two ways:
@@ -473,15 +480,18 @@ Tokens (TAO and subnet-specific alpha) can be 'removed from circulation', meanin
- In contrast, when tokens are **burned** they exist in no wallet and no pool and can no longer be transacted; however they are still included in the record of token issuance, so they will not be re-emitted, and in effect will forever remain as a quantity of *missing* tokens, a difference between issuance and the effective quantity in circulation.
+
#### Recycling
Tokens are recycled in several cases in Bittensor operations:
+
- **All transaction fees are recycled**: When transaction fees are collected, they are deducted from `TotalIssuance`, effectively recycling them back into the system for future emission. See [Transaction Fees in Bittensor](./fees)
- **Subnet Creation fees**: When a new subnet is created, the cost is recycled, except for one TAO, which is used to initialize the subnet's TAO liquidity pool.
- **Neuron Registration fees**: When a user registers a hotkey on a subnet to participate as a miner or validator, they are charged a registration fee in TAO. Alpha tokens worth the current swap value of the fee are taken from the subnet's alpha liquidity pool and recycled.
- **Extrinsic transaction**: Users can manually recycle alpha tokens using the `recycle_alpha` extrinsic, which reduces both the user's stake and the subnet's `SubnetAlphaOut` tracker.
+
#### Burning
Subnet-specific alpha tokens are burned in several contexts:
@@ -503,6 +513,7 @@ The process of registering keys with a subnet and purchasing a UID slot.
**See also:** [Subnet Miners](./miners/), [Subnet Validators](./validators/), [Working with Subnets](./subnets/working-with-subnets.md)
+
### Root Subnet/Subnet Zero
Subnet Zero a.k.a. the root subnet is a special subnet. No miners can register on subnet zero, and no validation work is performed. However validators can register, and $\tau$-holders can stake to those validators, as with any other subnet. This offers a mechanism for $\tau$-holders to stake $\tau$ into validators in a subnet-agnostic way. This works because the weight of a validator in a subnet includes both their share of that subnet's $\alpha$ and their share of staked TAO in Subnet Zero.
@@ -744,7 +755,6 @@ The relationship between these metrics creates a feedback loop: consensus determ
A position occupied by a subnet miner or subnet validator within a subnet, identified by a unique UID. The UID is assigned to a hotkey when it is registered in a subnet, allowing the hotkey to participate as a subnet validator or subnet miner.
**See also:** [Subnet Miners](./miners/), [Subnet Validators](./validators/), [Working with Subnets](./subnets/working-with-subnets.md)
-
### Unstaking
The process of detaching TAO from a validator hotkey.
@@ -871,6 +881,7 @@ Where $\alpha$ is the EMA smoothing factor (see [Exponential Moving Average](#ex
- Bonds are stored as sparse matrices in blockchain state
**Bond Decay:**
+
- Bonds decay over time using [EMA](#exponential-moving-average-ema) with the `bonds_moving_avg` parameter
- Higher decay rates (larger α) make bonds more responsive to recent performance
- Lower decay rates (smaller α) allow bonds to persist longer
diff --git a/docs/learn/ema.md b/docs/learn/ema.md
index f9f453561..924d7538d 100644
--- a/docs/learn/ema.md
+++ b/docs/learn/ema.md
@@ -1,19 +1,19 @@
---
title: "Exponential Moving Averages (EMAs)in Bittensor"
---
+
# Exponential Moving Averages (EMAs) in Bittensor
-The exponential moving average (EMA) is a [mathematical technique](https://en.wikipedia.org/wiki/Exponential_smoothing) for tracking a dynamic quantity, such as a token price, over time. Specifically, EMA is a weighted moving average that exponentially decreases the weight of older data point. This extracts a signal reflecting where the value has spent *most* of its time *most recently*, stabilizing or 'smoothing' the constant noise of rapid, largely random fluctuations.
+The exponential moving average (EMA) is a [mathematical technique](https://en.wikipedia.org/wiki/Exponential_smoothing) for tracking a dynamic quantity, such as a token price, over time. Specifically, EMA is a weighted moving average that exponentially decreases the weight of older data point. This extracts a signal reflecting where the value has spent _most_ of its time _most recently_, stabilizing or 'smoothing' the constant noise of rapid, largely random fluctuations.
Bittensor uses EMAs to smooth two critical dynamical values during the emission process:
- Emissions to each subnet are determined by an EMA-smoothed representation of subnet price each tempo. This protects emissions from price volatility or intentional manipulation.
-- Emissions to participants of each subnet are determined by EMAs of instantaneous validator-miner bond-strengths. This plays an important roll in ensuring that validators and miners are fairly rewarded for innovation, as measured by eventual consensus (rather than immediate consensus) about miner weights.
+- Emissions to participants of each subnet are determined by EMAs of instantaneous validator-miner bond-strengths. This plays an important role in ensuring that validators and miners are fairly rewarded for innovation, as measured by eventual consensus (rather than immediate consensus) about miner weights.
## Mathematical definition
-
The EMA of a changing value at a given time is determined by weighted average of the current value and the EMA at the last time step. The parameter factor, or 'smoothing factor' is called $\alpha$.
$$
@@ -30,14 +30,12 @@ The alpha parameter controls how quickly the EMA responds to changes:
Note that this alpha parameter is distinct from and unrelated to the usage of 'alpha' to refer to subnet-specific currencies.
:::
-
-
## Subnet Price Emission Smoothing
This use of EMA smoothing protects the network's economic model from price manipulation by making emissions extremely slow to respond to price changes.
**How It Works**:
-The price EMA uses a sophisticated dynamic alpha calculation to ensures that new subnets have even slower price adaptation than mature ones.
+The price EMA uses a sophisticated dynamic alpha calculation to ensure that new subnets have even slower price adaptation than mature ones.
$$
\alpha = \frac{ \mathrm{base\_alpha} \times \mathrm{blocks\_since\_start}}{\mathrm{blocks\_since\_start} + \mathrm{halving\_blocks}}
@@ -48,6 +46,7 @@ The value for **base_alpha** in the above is currently ~0.0003 for Bittensor mai
:::
See:
+
- [Yuma Consensus/Coinbase emission source code](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/epoch/run_epoch.rs#L223)
- [Default alpha value for subnet price smoothing](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/lib.rs#L828)
@@ -56,20 +55,24 @@ See:
This smoothing function ensures that relationships between validators and miners evolve gradually, preventing sudden manipulation while rewarding validators who discover promising miners early.
### Basic Bond EMA (Liquid Alpha Disabled)
+
**Default Mode**: Single $\alpha$ for all validator-miner pairs
+
- **Default $\alpha$**: ~0.1 (10%)
- **Response Time**: 7-22 blocks for significant changes (~1-4 minutes)
- **Formula**
- The EMA of the bond (BondEMA)of a validator i for a miner j, at time t, is the $\alpha$-weighted average of the instantaneous bond and the previous timestep's BondEMA:
- $$
- BondEMA_{ij}^{(t)} = \alpha \times \, InstantBond_{ij} + (1-\alpha)\,BondEMA_{ij}^{(t-1)}
- $$
+ The EMA of the bond (BondEMA)of a validator i for a miner j, at time t, is the $\alpha$-weighted average of the instantaneous bond and the previous timestep's BondEMA:
+ $$
+ BondEMA_{ij}^{(t)} = \alpha \times \, InstantBond_{ij} + (1-\alpha)\,BondEMA_{ij}^{(t-1)}
+ $$
### Advanced Bond EMA (Liquid Alpha Enabled)
+
**Consensus-Based Mode**: Dynamic $\alpha$ per validator-miner pair based on consensus alignment
-- **$\alpha$ Range**: Dynamic between $\alpha$_low and $\alpha$_high (default: 0.7 to 0.9)
-- **Sigmoid Steepness**: Controls transition rate between $\alpha$_low and $\alpha$_high (default: 1000)
+
+- **$\alpha$ Range**: Dynamic between $\alpha$\_low and $\alpha$\_high (default: 0.7 to 0.9)
+- **Sigmoid Steepness**: Controls transition rate between $\alpha$\_low and $\alpha$\_high (default: 1000)
- **Individual Alpha**: Each validator-miner pair gets its own $\alpha$ value
- **Response Time**: 1-13 blocks depending on consensus alignment (~12 seconds to 2.6 minutes)
-See [Liquid Alpha/Consensus-Based Weights](../subnets/consensus-based-weights)
\ No newline at end of file
+See [Liquid Alpha/Consensus-Based Weights](../subnets/consensus-based-weights)
diff --git a/docs/local-build/create-subnet.md b/docs/local-build/create-subnet.md
index 51b86b73c..5d080293b 100644
--- a/docs/local-build/create-subnet.md
+++ b/docs/local-build/create-subnet.md
@@ -8,12 +8,17 @@ This page covers creating a subnet on a locally deployed Subtensor blockchain, w
For creating a subnet on Bittensor test and main network, see [Create a Subnet](../subnets/create-a-subnet).
-Prerequisites:
+## Prerequisites
+
+Before continuing with the rest of this tutorial, make sure you've completed the following:
- [Deploy a Subtensor chain locally](./deploy)
-- [Provision wallets for the sn-creator, miner, and validator users for this tutorial.](./provision-wallets)
+- [Provision wallets for the subnet creator, miner, and validator users for this tutorial.](./provision-wallets)
+- Sufficient amount of TAO in your subnet creator wallet to cover the [burn cost](../glossary.md#burn-cost).
+
+## Create a subnet
-## Create subnet
+Now, let us create a new subnet on the local chain. To create a new subnet, run the following command in your terminal:
```shell
btcli subnet create \
@@ -22,34 +27,42 @@ btcli subnet create \
--network ws://127.0.0.1:9945
```
-### Trouble shoot
-
-#### Insufficient funds
-
-If you are following this tutorial for the first time, the `subnet create` command will faill with an insufficient balance error.
-
-The coldkey signing the `subnet create` transaction must have a sufficient $\tau$ balance to cover the burn cost of subnet creation, so called because the funds cannot be recovered.
+You will then be prompted to provide the wallet hotkey as well as configure the subnet as shown:
```console
Subnet burn cost: τ 1,000.0000
-Your balance of: τ 0.0000 is not enough to burn τ 1,000.0000 to register a subnet.
+Your balance is: τ 1,001.0000
+Do you want to burn τ 1,000.0000 to register a subnet? [y/n]:y
+Enter your password:
+Decrypting...
+🌏 📡 Registering subnet..
```
-Transfer funds from the Alice account to cover it and try again. Consult `btcli w list` and carefully check the ss58 address of the destination coldkey (in this case, the one with the name `sn-creator`).
+To check on your newly created subnets, run the following command in your terminal:
```shell
-btcli wallet transfer \
---amount 1001 \
---wallet.name alice \
---destination "5C9xw4..." \
---network ws://127.0.0.1:9945
+btcli subnet list --network ws://127.0.0.1:9945
```
-#### Network Rate Limit Error
+A list of all subnets in your local subtensor instance is returned:
-If you see a network rate limit error, you may need to adjust the `SubtensorInitialNetworkRateLimit` chain state parameter.
+```console
+ Subnets
+ Network: custom
+ ┃ ┃ Price ┃ Market Cap ┃ ┃ P (τ_in, ┃ Stake ┃ ┃
+ Netuid ┃ Name ┃ (τ_in/α_in) ┃ (α * Price) ┃ Emission (τ) ┃ α_in) ┃ (α_out) ┃ Supply (α) ┃ Tempo (k/n)
+━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━
+ 0 │ τ root │ 1.0000 τ/Τ │ τ 0.00 │ τ 0.0000 │ -, - │ Τ 0.00 │ 0.00 Τ /21M │ -/-
+ 2 │ β │ 0.0000 τ/β │ τ 1.00k │ τ 0.0000 │ τ 1.00k, │ 0.00 β │ 1.00k β │ 29/360
+ │ awesome-fi… │ │ │ │ 1.00k β │ │ /21M │
+ 1 │ α apex │ 0.0000 τ/α │ τ 11.00 │ τ 0.0000 │ τ 10.00, │ 1.00 α │ 11.00 α │ 29/100
+ │ │ │ │ │ 10.00 α │ │ /21M │
+────────┼─────────────┼─────────────┼─────────────┼──────────────┼─────────────┼──────────────┼─────────────┼─────────────
+ 4 │ │ τ 1.0 │ │ τ 0.0 │ τ │ │ │
+ │ │ │ │ │ 2.01k/29.00 │ │ │
+ │ │ │ │ │ (6931.03%) │ │ │
+```
-See [Clone and tweak the Subtensor source](./deploy#clone-and-tweak-the-subtensor-source)
### Subnet creation cost
@@ -61,108 +74,21 @@ Note that this is labeled "burn cost", even though technically the cost of subne
See: [Glossary: Recycling and Burning](../glossary#recycling-and-burning)
:::
-:::tip try it live
-
-Check the burn cost to create a subnet on Bittensor main network and test network:
-
-
-
-
-
-```shell
-btcli subnet burn-cost --network finney
-```
-
-
-
-
-```shell
-btcli subnet burn-cost --network test
-```
-
-
-
-:::
-
-## Fund your subnet
-
-To remedy your liquidity shortfall, transfer $\tau$ from the Alice account and try again.
-
-1. First, get the ss58 address for the destination wallet for the transfer:
- ```shell
- btcli w list
- ```
- ```shell
- ...
- ── Coldkey sn-creator ss58_address 5C9xw4gDyu11ocdpWrmhT1sbi4xEHCpzEMsyMA4jGfAZQofQ
- └── Hotkey default ss58_address 5GVsCAY6RuSuoAA1E77xsHJ9PjdZJjJrRkNFDxVtRKPnw7TR
- ```
-1. Execute the transfer from `alice` to the sn-creator wallet
+## Start emissions on the subnet
- ```console
- btcli wallet transfer \
- --amount 1001 \
- --wallet.name alice \
- --destination "5GVsCAY6RuSuoAA1E77xsHJ9PjdZJjJrRkNFDxVtRKPnw7TR" \
- --subtensor.chain_endpoint ws://127.0.0.1:9945
- ```
-
- ```shell
- Do you want to transfer:
- amount: τ 1,001.0000
- from: alice : 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
- to: 5GVsCAY6RuSuoAA1E77xsHJ9PjdZJjJrRkNFDxVtRKPnw7TR
- for fee: τ 0.0001 [y/n]: y
- 🌏 📡 Transferring...
- ```
-
-
-## Success
-
-Create some subnets.
-
-For example:
-
-```shell
-btcli subnet create \
---subnet-name awesome-first-subnet \
---wallet.name sn-creator \
---network ws://127.0.0.1:9945
-```
+To activate your subnet, beginning emissions and allowing staking, run:
-```console
-Subnet burn cost: τ 1,000.0000
-Your balance is: τ 1,001.0000
-Do you want to burn τ 1,000.0000 to register a subnet? [y/n]:y
-Enter your password:
-Decrypting...
-🌏 📡 Registering subnet..
```
-
-```shell
- btcli subnet create \
---subnet-name awesome-second-subnet \
+btcli subnet start --netuid NETUID \
--wallet.name sn-creator \
--network ws://127.0.0.1:9945
```
-```console
-Subnet burn cost: τ 1,999.9405
-▰▱▱▱▱▱▱ 📡Retrieving lock cost from custom...
-Your balance is: τ 2,003.0000
-Do you want to burn τ 1,999.9405 to register a subnet? [y/n]: Please enter Y or N
-Do you want to burn τ 1,999.9405 to register a subnet? [y/n]: y
-Enter your password:
-Decrypting...
-✅ Registered subnetwork with netuid: 3
-```
+Replace `NETUID` with the netuid of the subnet you want to enable emissions on.
-1. List your subnets
+After a while, you can confirm that the subnet's emissions have started by inspecting your subnet's token economy. You'll see a non-zero amount in the *Emission* column, indicating the subnet creator key accumulates emissions.
-```shell
-btcli subnet list \
---network ws://127.0.0.1:9945
-```
+You can confirm the emissions by running the `btcli subnets list` command:
```console
Subnets
@@ -171,24 +97,29 @@ btcli subnet list \
Netuid ┃ Name ┃ (τ_in/α_in) ┃ (α * Price) ┃ Emission (τ) ┃ α_in) ┃ (α_out) ┃ Supply (α) ┃ Tempo (k/n)
━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━
0 │ τ root │ 1.0000 τ/Τ │ τ 0.00 │ τ 0.0000 │ -, - │ Τ 0.00 │ 0.00 Τ /21M │ -/-
- 2 │ β │ 1.0000 τ/β │ τ 1.00k │ τ 0.0000 │ τ 1.00k, │ 0.00 β │ 1.00k β │ 29/360
+ 2 │ β │ 1.0000 τ/β │ τ 1.81k │ τ 1.0000 │ τ 1.00k, │ 414.00 β │ 1.81k β │ 29/360
│ awesome-fi… │ │ │ │ 1.00k β │ │ /21M │
- 3 │ γ │ 1.0000 τ/γ │ τ 1.00k │ τ 0.0000 │ τ 1.00k, │ 0.00 γ │ 1.00k γ │ 29/360
- │ awesome-se… │ │ │ │ 1.00k γ │ │ /21M │
- 1 │ α apex │ 1.0000 τ/α │ τ 11.00 │ τ 0.0000 │ τ 10.00, │ 1.00 α │ 11.00 α │ 29/100
+ 1 │ α apex │ 0.0000 τ/α │ τ 11.00 │ τ 0.0000 │ τ 10.00, │ 1.00 α │ 11.00 α │ 29/100
│ │ │ │ │ 10.00 α │ │ /21M │
────────┼─────────────┼─────────────┼─────────────┼──────────────┼─────────────┼──────────────┼─────────────┼─────────────
- 4 │ │ τ 3.0 │ │ τ 0.0 │ τ │ │ │
- │ │ │ │ │ 2.01k/29.00 │ │ │
+ 4 │ │ τ 1.0 │ │ τ 1.0 │ τ │ │ │
+ │ │ │ │ │ 1.41k/562.00│ │ │
│ │ │ │ │ (6931.03%) │ │ │
```
-## Start emissions on your subnet
+## Troubleshooting
-To activate your subnet, beginning emissions and allowing staking, run:
+### Insufficient funds
+
+The coldkey signing the `subnet create` transaction must have a sufficient $\tau$ balance to cover the burn cost of subnet creation, so called because the funds cannot be recovered.
+```console
+Subnet burn cost: τ 1,000.0000
+Your balance of: τ 0.0000 is not enough to burn τ 1,000.0000 to register a subnet.
```
-btcli subnet start --netuid 2 \
---wallet.name sn-creator \
---network ws://127.0.0.1:9945
-```
\ No newline at end of file
+
+To fix this, transfer TAO from the Alice account to cover this transaction and try again. For more information, see [Transfer TAO to wallets](./provision-wallets.md#transfer-tao-to-wallets).
+
+## Next steps
+
+With emissions now active on your subnet, you can begin registering and running miners and validators to participate in the network.
diff --git a/docs/local-build/deploy.md b/docs/local-build/deploy.md
index c4d55ec7c..db43924f4 100644
--- a/docs/local-build/deploy.md
+++ b/docs/local-build/deploy.md
@@ -53,15 +53,21 @@ Below are examples of how to run the container using each mode:
- Fast blocks: Fast block mode reduces block processing time to _250ms per block_, enabling rapid chain progression. It allows faster feedback cycles for operations such as staking, subnet creation, and registration, making them ideal for local testing scenarios. To run the container in fast block mode, run the following command in your terminal:
```bash
- docker run --rm --name test_local_chain_ -p 9944:9944 -p 9945:9945 ghcr.io/opentensor/subtensor-localnet:devnet-ready
+ docker run --rm --name local_chain -p 9944:9944 -p 9945:9945 ghcr.io/opentensor/subtensor-localnet:devnet-ready
```
- Non-fast blocks: Non-fast block mode uses the default _12-second block time_, aligning with subtensor block intervals. While this mode utilizes the default block processing time, it also incorporates some enhancements—for example, subnets become eligible to start one minute after creation. To run the container in non-fast block mode, run the following command in your terminal:
```bash
- docker run --rm --name test_local_chain_ -p 9944:9944 -p 9945:9945 ghcr.io/opentensor/subtensor-localnet:devnet-ready False
+ docker run --rm --name local_chain -p 9944:9944 -p 9945:9945 ghcr.io/opentensor/subtensor-localnet:devnet-ready False
```
+:::info
+By default, exiting the Docker container removes the image container with the local chain instance; thus, deleting the state of the local chain instance running on it. You can modify this behavior by when running the container wihtout the `--rm` flag.
+
+For more information, see official [Docker documentation](https://docs.docker.com/reference/cli/docker/container/run/).
+:::
+
### 3. Verify your setup
You can verify your local blockchain instance by checking the list of subnets available on your local blockchain. To do this, run the following command in the terminal:
diff --git a/docs/local-build/mine-validate.md b/docs/local-build/mine-validate.md
index 888b21663..1390c08bd 100644
--- a/docs/local-build/mine-validate.md
+++ b/docs/local-build/mine-validate.md
@@ -1,125 +1,338 @@
---
-title: "Mine and Validate (Locally)"
+title: "Mining and Validating on Localnet"
---
-# Mine and Validate (Locally)
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
-This page continues the tutorial series on local Bittensor development. In this installment, we will deploy minimal, local servers for a miner and validators, serving requests, setting weights, and earning emissions.
+# Mining and Validating on Localnet
+This page walks through mining and validating on a local Bittensor network. It covers how to register a neuron on a subnet, then run the miner and validator scripts to begin earning emissions.
+
+For mining and validating on the Bittensor mainnet, see [Mining in Bittensor](../miners/index.md) and [Validating in Bittensor](../validators/index.md).
## Prerequisites
+Before continuing with the rest of this tutorial, make sure you've completed the following:
+
- [Deploy a Subtensor chain locally](./deploy)
-- [Provision wallets for the sn-creator, miner, and validator users for this tutorial.](./provision-wallets)
-- [Create a Subnet on your local chain](./create-subnet)
+- [Provision wallets for the subnet creator, miner, and validator users for this tutorial.](./provision-wallets)
+- [Created and started a subnet](./create-subnet) to enable emissions.
+
+This guide uses Opentensor's [_subnet template_](https://github.com/opentensor/subnet-template/tree/main) repo. The repo provides a minimal implementation for building a custom subnet on the Bittensor network and includes the core logic for the miner and validator.
-## Register
+## 1. Register the neuron hotkeys
-Register the subnet miner and validator with the following commands:
+To participate in a subnet, you must first register a hotkey on it. This registration assigns the wallet a unique identifier (UID), which is required to interact with and receive emissions from the subnet.
+
+To register the hotkey, run the following command in your terminal, replacing `NETUID`, `WALLET_NAME`, and `WALLET_HOTKEY` with the target subnet ID, the name of the wallet, and the associated hotkey, respectively, as shown:
```bash
-btcli subnet register \
---wallet.name validator \
---wallet.hotkey default \
+btcli subnets register --netuid NETUID \
+--wallet-name WALLET_NAME \
+--hotkey WALLET_HOTKEY \
--network ws://127.0.0.1:9945
```
+
+You will be prompted to confirm the registration fee and enter your wallet password to authorize the transaction.
+
+
+Show Sample Output
+
+```console
+Warning: Verify your local subtensor is running on port 9944. subtensor_interface.py:88
+Using the specified network local from config
+
+ Register to netuid: 2
+ Network: local
+
+ Netuid ┃ Symbol ┃ Cost (Τ) ┃ Hotkey ┃ Coldkey
+━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+ 2 │ β │ τ 0.0985 │ 5FErfAJc3Wf32TVLQTtM....TRTrgMF4sjYWfq49oMCxXxqS │ 5Gxhv5iZGBvvR6YJeEdLmvZ7hS....dHc43fLqMVkhki7j4
+────────┼────────┼──────────┼──────────────────────────────────────────────────┼──────────────────────────────────────────────────
+ │ │ │ │
+Your balance is: 99,999.9000 τ
+The cost to register by recycle is 0.0985 τ
+Do you want to continue? [y/n] (n): y
+Enter your password:
+Decrypting...
+Balance:
+ 99,999.9000 τ ➡ 99,999.8015 τ
+✅ Registered on netuid 3 with UID 2
+```
+
+
+
+Repeat the registration process for both the miner and validator hotkeys.
+
+To confirm the registration of your hotkeys in the subnet, run the following command in your terminal:
+
+```sh
+btcli subnet show --netuid NETUID --network ws://127.0.0.1:9945
+```
+
+The command returns detailed information about a subnet including its registered neurons and their state.
+
+
+Show Sample Output
+
+```console
+
+Warning: Verify your local subtensor is running on port 9944. subtensor_interface.py:89
+
+
+
+ Subnet 2: New subnet
+ Network: local
+
+ UID ┃ Stake (β) ┃ Alpha (β) ┃ Tao (τ) ┃ Dividends ┃ Incentive ┃ Emissions (β) ┃ Hotkey ┃ Coldkey ┃ Identity
+━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━
+ 0 │ 5.04 β │ 5.04 β │ τ 0.00 │ 0.000000 │ 0.000000 │ 9.017303 β │ 5DFZTw │ 5Dc1Qu │ (*Owner controlled)
+ 1 │ 0.00 β │ 1.00 β │ τ 0.00 │ 0.000000 │ 0.000000 │ 0.000000 β │ 5FErfA │ 5GxHV5 │ ~
+ 2 │ 0.00 β │ 1.00 β │ τ 0.00 │ 0.000000 │ 0.000000 │ 0.000000 β │ 5GRLEv │ 5EnNgi │ ~
+─────┼───────────┼───────────┼─────────┼───────────┼───────────┼───────────────┼────────┼─────────┼─────────────────────
+ │ 5.04 β │ 5.04 β │ 0.00 β │ 0.000 │ │ 9.017303 β │ │ │
+
+
+Subnet 2: New subnet
+ Owner: 5Dc1Qu2pDfWuDzt3c5wJV2LxRXAmVqZYsAib72e59H3vnRVn
+ Rate: 1.0056 τ/β
+ Emission: τ 0.0000
+ TAO Pool: τ 1.10k
+ Alpha Pool: 1.10 β
+ Tempo: 8/360
+ Registration cost (recycled): τ 0.0845
+
+```
+
+
+
+## 2. Acquire validator permit
+
+To qualify as a validator on a subnet, a registered node must have a validator permit. This permit allows nodes to submit miner evaluations and set weights on a subnet. For more information, see [validator permits](../validators/index.md#requirements-for-validation).
+
+To get validator permits on the demo subnet, you need to stake sufficient TAO to the validator hotkey. To do this, run the following command in the terminal:
+
```bash
-btcli subnet register \
---netuid 2 \
---wallet.name miner \
---wallet.hotkey default \
+btcli stake add --netuid NETUID \
+--wallet-name WALLET_NAME \
+--hotkey WALLET_HOTKEY \
+--partial \
--network ws://127.0.0.1:9945
```
+Replace `NETUID`, `WALLET_NAME`, and `WALLET_HOTKEY` with the target subnet ID, the name of the wallet, and the associated hotkey, respectively.
+Once you've staked enough TAO to the validator hotkey, the validator becomes eligible to submit evaluations and set weights on the subnet. You can verify that the validator has been granted a permit using any of the following methods:
-### Troubleshoot
-#### Insufficient funds
-If you have not added TAO to your validator wallet, you'll see an error like the following:
+
+
+Run the following command in the terminal:
+```bash
+btcli wallet overview --wallet.name WALLET_NAME --network ws://127.0.0.1:9945
+```
+Replace the `WALLET_NAME` with the name of the validator wallet.
+
+
+Show Sample Output
```console
-Insufficient balance τ 0.0000 to register neuron. Current recycle is τ 1.0000 TAO
+Warning: Verify your local subtensor is running on port 9944. subtensor_interface.py:88
+Using the specified network local from config
+ Wallet
+
+ test-validator : 5Gxhv5iZGBvvR6YJeEd...bE6FdHc43fLqMVkhki7j4
+ Network: local
+Subnet: 2: New subnet β
+
+ COLDKEY HOTKEY UID ACTIVE STAKE(β) RANK TRUST CONSENSUS INCENTIVE DIVIDENDS EMISSION(… VTRUST VPE… UPDAT… AXON HOTKEY_SS58
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ test-validator test-validator 1 False 287.57 0.00 0.00 0.00 0.00 0.00 38841066.… 0.00 * 5908 none 5FErfAJc3W
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ 1 287.57 β 0.0000 0.0000 0.0000 0.0000 0.0000 ρ38841066 0.0000
+
+ Wallet free balance: 99,994.3638 τ
```
-Transfer funds from the Alice account to cover it and try again. Consult `btcli w list` and carefully check the ss58 address of the destination coldkey (in this case, the one with the name `validator`).
-```shell
-btcli wallet transfer \
---amount 11 \
---wallet.name alice \
---destination "5EEy34..." \
---network ws://127.0.0.1:9945
+
+
+If the validator wallet has a validator permit, an asterisk (`*`) is shown under the `VPERMIT` column for the corresponding subnet in the response table.
+
+
+
+Input the following lines in your Python environment, replacing `NETUID`, `WALLET_NAME`, and `WALLET_HOTKEY` with the target subnet ID, the name of the wallet, and the associated hotkey, respectively.
+
+```python
+import bittensor as bt
+network=bt.subtensor(network="local")
+subnet = network.metagraph(NETUID)
+wallet = bt.wallet( name = 'WALLET_NAME', hotkey = 'HOTKEY' )
+my_uid = subnet.hotkeys.index( wallet.hotkey.ss58_address )
+print(f'Validator permit: {subnet.validator_permit[my_uid]}')
```
+The command outputs `True` or `False` depending on whether the validator hotkey has a permit.
+
+
+
+:::info Validator Permits on Localnet Subnets
+On localnet subnets, competition for permits is typically minimal. After staking TAO to the validator hotkey, the neuron should become eligible for a validator permit. If it does not yet have one, wait until the end of the subnet’s tempo.
+:::
+
+## 3. Pull the `subnet-template` repo
-### Successful registration
+The `subnet-template` repo contains the core logic for the subnet miner and validator. It features a simple `dummy` protocol where miners multiply input values by 2, while validators evaluate responses and update network weights based on performance.
+
+To begin, clone the subnet-template GitHub repository and navigate into its directory:
+
+```sh
+git clone https://github.com/opentensor/subnet-template.git
+cd subnet-template
+```
+
+## 4. Run the miner and validator
+
+After getting the validator permits, you can now run the validator alongside the miner to begin participating in the subnet.
+
+Begin by starting the miner process to produce and submit work to the subnet. Then, run the validator process to evaluate miner outputs and set weights for the network.
+
+### Start the miner process
+
+To start the miner, run the following Python script in the `subnet-template` directory:
+
+```sh
+python miner.py \
+ --wallet.name WALLET_NAME \
+ --wallet.hotkey HOTKEY \
+ --netuid NETUID \
+ --axon.port 8901 \
+ --subtensor.network local
+```
+
+The script launches an Axon server on port `8901`, which the miner uses to receive incoming requests from validators.
+
+### Start the validator process
+
+To start the validator process, run the following Python script in the `subnet-template` directory:
+
+```sh
+python validator.py \
+ --wallet.name WALLET_NAME \
+ --wallet.hotkey HOTKEY \
+ --netuid NETUID \
+ --subtensor.network local
+```
+
+This script begins the process of sending inputs to the miners and setting weights based on miner responses.
+
+:::info miner and validator logs
+Use the `--logging.info` flag to print miner and validator log messages directly to the console. This helps you monitor activity in real time.
+:::
+
+## 5. Check your emissions
+
+After weights have been successfully set on the subnet, you can check the updated emissions distribution at the end of the subnet's [tempo](../glossary.md#tempo).
+
+To check the subnet's emissions, run the following command in the terminal:
+
+```sh
+btcli subnet show --netuid NETUID --network ws://127.0.0.1:9945
+```
+
+The command returns detailed information about a subnet, including its registered neurons, their current state, and updated emission earnings.
+
+
+Show Sample Output
-Repeat the above steps to successfully register your miner and validator once they are funded
```console
-netuid: 2
+Using the specified network local from config
+Warning: Verify your local subtensor is running on port 9944. subtensor_interface.py:89
- Register to netuid: 2
- Network: custom
- Netu… ┃ Sym… ┃ Cost (… ┃ Hotkey ┃ Coldkey
-━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- 2 │ β │ τ 1.00… │ 5CffqSVhydFJHBSbbgfVLAVkoNBTsv3wLj2Tsh1cr2kfa… │ 5EEy34R4gfXe5SG62nz1nDuh3KAovRLpKLm4ccSv7qkNhn…
-───────┼──────┼─────────┼────────────────────────────────────────────────┼─────────────────────────────────────────────────
- │ │ │ │
-Your balance is: τ 11.0000
-The cost to register by recycle is τ 1.0000
-Do you want to continue? [y/n] (n): y
-Enter your password:
-Decrypting...
-Balance:
- τ 11.0000 ➡ τ 10.0000
-✅ Registered on netuid 2 with UID 1
-▰▱▱▱▱▱▱ 📡 Recycling TAO for Registration...
+
+ Subnet 2: New subnet
+ Network: local
+
+ UID ┃ Stake (β) ┃ Alpha (β) ┃ Tao (τ) ┃ Dividends ┃ Incentive ┃ Emissions (β) ┃ Hotkey ┃ Coldkey ┃ Identity
+━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━
+ 0 │ 109.80 β │ 109.80 β │ τ 0.00 │ 0.000000 │ 0.000000 │ 0.000000 β │ 5DFZTw │ 5Dc1Qu │ (*Owner controlled)
+ 1 │ 354.68 β │ 354.68 β │ τ 0.00 │ 1.000000 │ 0.000000 │ 148.010826 β │ 5FErfA │ 5Gxhv5 │ Test validator
+ 2 │ 148.01 β │ 148.01 β │ τ 0.00 │ 0.000000 │ 1.000000 │ 148.010826 β │ 5GRLEv │ 5EnNgi │ Test miner
+─────┼───────────┼───────────┼─────────┼───────────┼───────────┼───────────────┼────────┼─────────┼─────────────────────
+ │ 612.49 β │ 612.49 β │ 0.00 β │ 1.000 │ │ 296.0217 β │ │ │
+
+
+Subnet 2: New subnet
+ Owner: 5Dc1Qu2pDfWuDzt3c5wJV2LxRXAmVqZYsAib72e59H3vnRVn
+ Rate: 1.0054 τ/β
+ Emission: τ 0.0000
+ TAO Pool: τ 1.62k
+ Alpha Pool: 1.61k β
+ Tempo: 23/360
+ Registration cost (recycled): τ 0.1000
+
```
-### Check your registration
+Note the increase in the miner neuron's `Incentive` column and the validator neuron's `Dividend` column as well as the `Emissions` on both neurons.
+
+
+
+For more information on a subnet's emission distribution, see [Emissions](../emissions.md).
+
+## Troubleshooting errors
-Confirm your registration on the subnet with the following command:
+This section discusses errors that could arise while running the validator or miner, and provides steps to diagnose and resolve them.
-```shell
-btcli wallet overview --wallet.name validator --network ws://127.0.0.1:9945
+**Insufficient funds**
-btcli wallet overview --wallet.name miner --network ws://127.0.0.1:9945
+The coldkey signing the `btcli subnet register` transaction must have a sufficient $\tau$ balance to cover the recycling cost of the registration.
+
+Show sample error
+
+```console
+Insufficient balance 0.0000 τ to register neuron. Current recycle is 0.0970 τ TAO.
```
+
+
+**Unregistered miner or validator**
+
+This occurs when you attempt to run a miner or validator on a subnet where it is not registered.
+
+
+Show sample error
+
```console
- Wallet
+Your miner: Wallet (Name: 'test-miner', Hotkey: 'test-miner', Path: '~/.bittensor/wallets/') is not registered to chain connection: Network: local, Chain: ws://127.0.0.1:9944
+Run 'btcli register' and try again.
+```
- validator : 5EEy34R4gfXe5SG62nz1nDuh3KAovRLpKLm4ccSv7qkNhnqw
- Network: custom
-Subnet: 2: awesome-first-subnet β
+
- COLDKEY HOTKEY UID AC… STA… RANK TRU… CON… INC… DIV… EMI… VTR… … U… AXON HOTKE…
- ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
- valida… default 1 Tr… 0.00 0.00 0.00 0.00 0.00 0.00 0.0… 0.00 51 none 5Cffq…
- ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
- 1 0.0… 0.0… 0.0… 0.0… 0.0… 0.0… ρ0 0.0…
+**`NeuronNoValidatorPermit`**
+This means that the neuron is attempting to set weights without a validator permit. Try fix this, you must stake sufficient TAO to the validator hotkey and wait till the end of the subnet's tempo.
- Wallet balance: τ10.0
+
+Show sample error
- Wallet
+```console
+Failed set weights. Error: Subtensor returned `NeuronNoValidatorPermit(Module)` error. This means: `The caller is attempting to set non-self weights without being a permitted validator. | Please consult https://docs.bittensor.com/errors/subtensor#neuronnovalidatorpermit`.
+```
- miner : 5DA7UsaYbk1UnhhtTxqpwdqjuxhQ2rW7D6GTN1S1S5tC2NRV
- Network: custom
-Subnet: 2: awesome-first-subnet β
+
- COLDKEY HOTKEY UID AC… STA… RANK TRU… CON… INC… DIV… EMI… VTR… … U… AXON HOTKE…
- ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
- miner default 2 Tr… 0.00 0.00 0.00 0.00 0.00 0.00 0.0… 0.00 22 none 5Capz…
- ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
- 1 0.0… 0.0… 0.0… 0.0… 0.0… 0.0… ρ0 0.0…
+**`WeightVecLengthIsLow`**
+This error occurs when the validator attempts to set weights for fewer elements than allowed. It often happens when all neurons in the subnet are unresponsive, causing the validator to try setting zero weights for each of them.
- Wallet balance: τ10.0
+
+Show sample error
+
+```console
+Error: Subtensor returned `WeightVecLengthIsLow(Module)` error. This means: `The dispatch is attempting to set weights on chain with fewer elements than are allowed. | Please consult https://docs.bittensor.com/errors/subtensor#weightveclengthislow`.
```
-```shell
-python3 neurons/miner.py netuid=2 -chain_endpoint=ws://127.0.0.1:9945 wallet_name=miner wallet_hotkey=default
-```
\ No newline at end of file
+
diff --git a/docs/local-build/provision-wallets.md b/docs/local-build/provision-wallets.md
index 748103e4c..03a9e62a3 100644
--- a/docs/local-build/provision-wallets.md
+++ b/docs/local-build/provision-wallets.md
@@ -8,68 +8,89 @@ Now that your local Subtensor chain is deployed, you can provision wallets to se
Every local blockchain is pre-provisioned with an "Alice" account, which is loaded with one million $\tau$.
+## Prerequisites
+
+To follow along with the rest of this tutorial, ensure that you have a local chain running. To set up a local chain, see [Create a local blockchain instance](./deploy.md).
+
## Access the Alice account
To access the handy pre-provisioned development "Alice" account on your local chain, use:
+
```shell
btcli wallet create --uri alice
```
-Confirm Alice's massive $\tau$ bag.
+Next, you will be prompted to configure the wallet by setting a name for the wallet's coldkey and hotkey.
-```shell
- btcli w balance --wallet.name alice --network ws://127.0.0.1:9945
+:::tip
+To access the 'Alice' wallet, you must use the assigned coldkey name and include the local subtensor chail URL as shown
+
+```sh
+btcli wallet balance --wallet.name alice --network ws://127.0.0.1:9945
```
+The following should be returned in the console:
+
```console
Wallet Coldkey Balance
Network: custom
- Wallet Name Coldkey Address Free Balance Staked Value Staked (w/slippage) Total Balance Total (w/slippage)
+ Wallet Name Coldkey Address Free Balance Staked Value Total Balance
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- alice 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY τ 999,999.8999 τ 0.0000 τ 0.0000 τ 999,999.8999 τ 999,999.8999
+ alice 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY 1,000,000.0000 τ 0.0000 τ 1,000,000.0000 τ
-
- Total Balance τ 999,999.8999 τ 0.0000 τ 0.0000 τ 999,999.8999 τ 999,999.8999
+ Total Balance 1,000,000.0000 τ 0.0000 τ 1,000,000.0000 τ
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```
+:::
+
## Provision wallets
-You will need wallets for the different personas, i.e., subnet owner, subnet validator and subnet miner, in the subnet.
+To proceed with this tutorial, you’ll need to create separate wallets for each role on the Bittensor blockchain. Specifically, create three wallets: one each for the subnet owner, validator, and miner.
+
+- The subnet owner wallet creates and controls the subnet—`sn-creator`.
+- The validator and miner wallets will be registered on the created subnet—`test-validator` and `test-miner`.
-- The owner wallet creates and controls the subnet.
-- The validator and miner will be registered to the subnet created by the owner. This ensures that the validator and miner can run the respective validator and miner scripts.
+Using separate wallets for each role ensures they can independently run their respective processes and scripts.
-### Set up a wallet for the subnet creator role with a coldkey and hotkey.
+To create a wallet, run the following command in your terminal:
```bash
btcli wallet create \
---wallet.name sn-creator
+--wallet.name WALLET_NAME \
+--hotkey WALLET_HOTKEY \
+--network ws://127.0.0.1:9945
```
-### Set up the miner's wallet with a coldkey and hotkey:
+Replace `WALLET_NAME` and `WALLET_HOTKEY` with the appropriate identifiers for each role—subnet creator, miner, or validator.
-```bash
-btcli wallet new_coldkey \
---wallet.name miner
-```
+### Transfer TAO to wallets
-```bash
-btcli wallet new_hotkey \
---wallet.name miner \
---wallet.hotkey default
+After creating your wallets, transfer some TAO from the `Alice` account to them to cover the transaction fees required for onchain operations. To transfer TAO, run the following command in your terminal:
+
+```sh
+btcli wallet transfer \
+--wallet.name alice \
+--destination DESTINATION_ADDRESS \
+--network ws://127.0.0.1:9945
```
-### Set up the validator's wallet with a coldkey and hotkey:
+Replace `DESTINATION_ADDRESS` with the wallet address you want to send the TAO to.
-```bash
-btcli wallet new_coldkey \
---wallet.name validator
-```
-```bash
-btcli wallet new_hotkey \
---wallet.name validator \
---wallet.hotkey default
+:::info
+Run the `btcli wallets list` command and carefully check the ss58 address of the destination coldkey that you want to fund.
+:::
+
+To confirm your wallet balances, run the following command in your terminal:
+
+```sh
+btcli wallet balance --wallet.name WALLET_NAME --network ws://127.0.0.1:9945
```
+
+## Next steps
+
+Now that you have created the necessary wallets and funded them with TAO, you can proceed to create a subnet on the local chain. This will enable you to register validators and miners, configure subnet parameters, and begin participating in the network’s consensus and emissions processes.
+
+To begin, see [Create a subnet locally](create-subnet.md).
diff --git a/docs/miners/index.md b/docs/miners/index.md
index a303cfe11..02e8ff951 100644
--- a/docs/miners/index.md
+++ b/docs/miners/index.md
@@ -74,7 +74,6 @@ Deregistration only occurs on subnets where all 256 UID slots are occupied. If a
Each tempo, the '[neuron](../learn/neurons)' (miner _or_ validator node) with the lowest 'pruning score' (based solely on emissions), and that is no longer within its [immunity period](../subnets/subnet-hyperparameters.md#immunityperiod), risks being replaced by a newly registered neuron, who takes over that UID.
-
:::info Deregistration is based on emissions
The subnet does not distinguish between miners and validators for the purpose of deregistration. The chain only looks at emissions (represented as 'pruning score'). Whenever a new registration occurs in the subnet, the neuron with the lowest emissions will get deregistered.
:::
@@ -88,12 +87,13 @@ A subnet neuron (miner or validator) at a UID (in that subnet) has `immunity_per
**Implementation Details:**
Immunity status is calculated dynamically using the formula `is_immune = (current_block - registered_at) < immunity_period`, where:
+
- `current_block` is the current blockchain block number
- `registered_at` is the block number when the neuron was registered
- `immunity_period` is the configured protection period for the subnet (default: 4096 blocks ≈ 13.7 hours)
-
**Code References:**
+
- [`subtensor/pallets/subtensor/src/utils/misc.rs:442-448`](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/utils/misc.rs#L442-448) - Immunity status calculation
- [`subtensor/pallets/subtensor/src/subnets/registration.rs:409-485`](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/subnets/registration.rs#L409-485) - Pruning algorithm with immunity priority
@@ -153,24 +153,24 @@ btcli wallet overview --netuid
After providing your wallet name when prompted, you will see output such as:
-| Parameter | Example value | Description |
-| :---------- | :----------------- | :-------------------------------------------------------------------------- |
-| COLDKEY | my_coldkey | The name of the coldkey associated with your slot. |
-| HOTKEY | my_first_hotkey | The name of the hotkey associated with your slot. |
-| UID | 5 | The index of the uid out of available uids. |
-| ACTIVE | True | The validator has set weights within the subnet's activity_cutoff |
-| STAKE(τ) | 71.296 | The amount of stake in this wallet. |
-| RANK | 0.0629 | This miner's absolute ranking according to validators on the network. |
-| TRUST | 0.2629 | This miner's trust as a proportion of validators on the network. |
-| CONSENSUS | 0.89 | This validator's aggregate consensus score. |
-| INCENTIVE | 0.029 | This miner's incentive, TAO emission, is attained via mining. |
-| DIVIDENDS | 0.001 | This validator's dividends, TAO emission, are attained via validating. |
-| EMISSION | 29_340_153 | This miner's total emission in RAO (10^(-9) TAO) per block. |
-| VTRUST | 0.96936 | This validator's trust score as a validator. |
-| VPERMIT | \* | For validators: The uid is considered active for validating on this subnet. |
-| UPDATED | 43 | Blocks since this miner set weights on the chain. |
-| AXON | 131.186.56.85:8091 | The entrypoint advertised by this miner on the bittensor blockchain. |
-| HOTKEY_SS58 | 5F4tQyWr... | The ss58-encoded address of the miner's hotkey. |
+| Parameter | Example value | Description |
+| :---------- | :----------------- | :------------------------------------------------------------------------------------- |
+| COLDKEY | my_coldkey | The name of the coldkey associated with your slot. |
+| HOTKEY | my_first_hotkey | The name of the hotkey associated with your slot. |
+| UID | 5 | Unique identifier of the neuron. |
+| ACTIVE | True | Whether or not the uid is considered active. |
+| STAKE(τ) | 71.296 | The amount of stake in this wallet. |
+| RANK | 0.0629 | This miner's absolute ranking according to validators on the network. |
+| TRUST | 0.2629 | This miner's trust score as a proportion of validators on the network. |
+| CONSENSUS | 0.89 | The consensus score of the neuron. |
+| INCENTIVE | 0.029 | Thencentive score representing the miner's incentive alignment. |
+| DIVIDENDS | 0.001 | The dividends earned by the neuron for validating on the subnet. |
+| EMISSION | 29_340_153 | The emission in RAO (p) received by the neuron. |
+| VTRUST | 0.96936 | The validator trust score indicating the network's trust in the neuron as a validator. |
+| VPERMIT | \* | Whether this neuron is considered eligible for validating on this subnetwork. |
+| UPDATED | 43 | Blocks since the neuron set weights on the chain. |
+| AXON | 131.186.56.85:8091 | The entrypoint advertised by this miner on the bittensor blockchain. |
+| HOTKEY_SS58 | 5F4tQyWr... | The ss58-encoded address of the miner's hotkey. |
## Checking miner registration status
diff --git a/docs/subnets/create-a-subnet.md b/docs/subnets/create-a-subnet.md
index b22c97d1a..30a3d8bb2 100644
--- a/docs/subnets/create-a-subnet.md
+++ b/docs/subnets/create-a-subnet.md
@@ -21,7 +21,7 @@ Prospective subnet creators should familiarize themselves with the space of exis
### Burn cost
-The burn cost for subnet creation is dynamic; it lowers gradually and doubles every time a subnet is created.
+This refers to the required amount of TAO to be recycled when creating a new subnet. The burn cost for subnet creation is dynamic and reflects the current cost to register a new subnet. Its value lowers gradually and doubles every time a subnet is created.
:::tip try it live
@@ -68,7 +68,7 @@ Subnet creations are limited to **one subnet creation per 7200 blocks** (approxi
- [Install the most recent version of BTCLI](../getting-started/install-btcli).
-- [Create a wallet](../getting-started/wallets.md#creating-a-local-wallet).
+- [Create a wallet](../getting-started/wallets.md#creating-a-local-wallet).
- To create a subnet on test chain, your wallet must have sufficient test net TAO. Inquire in [Discord](https://discord.com/channels/799672011265015819/1107738550373454028/threads/1331693251589312553) to obtain TAO on Bittensor test network.
- To create a subnet on main network (finney) requires a substantial investment of TAO, depending on current registration cost for new subnets.
diff --git a/docs/validators/index.md b/docs/validators/index.md
index 5ad175762..1e7a4e27e 100644
--- a/docs/validators/index.md
+++ b/docs/validators/index.md
@@ -98,11 +98,13 @@ A subnet neuron (miner or validator) at a UID (in that subnet) has `immunity_per
**Implementation Details:**
Immunity status is calculated dynamically using the formula `is_immune = (current_block - registered_at) < immunity_period`, where:
+
- `current_block` is the current blockchain block number
- `registered_at` is the block number when the neuron was registered
- `immunity_period` is the configured protection period for the subnet (default: 4096 blocks ≈ 13.7 hours)
**Code References:**
+
- [`subtensor/pallets/subtensor/src/utils/misc.rs:442-448`](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/utils/misc.rs#L442-448) - Immunity status calculation
- [`subtensor/pallets/subtensor/src/subnets/registration.rs:409-485`](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/subnets/registration.rs#L409-485) - Pruning algorithm with immunity priority
@@ -151,11 +153,10 @@ import bittensor as bt
subnet = bt.metagraph(1)
wallet = bt.wallet( name = 'my_coldkey', hotkey = 'my_validator_hotkey' )
my_uid = subnet.hotkeys.index( wallet.hotkey.ss58_address )
-print(f'Validator permit: {subnet.validator_permit(my_uid)}')
+print(f'Validator permit: {subnet.validator_permit[my_uid]}')
```
-## Validator Permits
-
+## Validator Permits
Validator permits control which neurons can participate in validation activities within a subnet. The system operates on a stake-weighted basis, ensuring that only high-stake, trusted neurons can influence consensus.
@@ -184,14 +185,12 @@ To obtain a validator permit, a neuron must meet these criteria:
- **Top K Ranking**: Be among the top K neurons by stake weight
- **Active Status**: Maintain active participation in the subnet
-
### Code References
- Validator permit calculation: [`subtensor/pallets/subtensor/src/epoch/run_epoch.rs:520-523`](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/epoch/run_epoch.rs#L520-523)
- Top-K selection algorithm: [`subtensor/pallets/subtensor/src/epoch/math.rs:250-260`](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/epoch/math.rs#L250-260)
- Access control: [`subtensor/pallets/subtensor/src/subnets/weights.rs:745-748`](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/subnets/weights.rs#L745-748)
-
## Inspecting UIDs
After you obtain a UID slot, you can view the status of your registered wallet by running:
@@ -202,24 +201,24 @@ btcli wallet overview --netuid
After providing your wallet name at the prompt, you will see output like:
-| Parameter | Example value | Description |
-| :---------- | :----------------- | :------------------------------------------------------------------------- |
-| COLDKEY | my_coldkey | The name of the coldkey associated with your slot. |
-| HOTKEY | my_first_hotkey | The name of the hotkey associated with your slot. |
-| UID | 5 | The index of the uid out of available uids. |
-| ACTIVE | True | Whether or not the uid is considered active. |
-| STAKE(τ) | 71.296 | The amount of stake in this wallet. |
-| RANK | 0.0629 | This miner's absolute ranking according to validators on the network. |
-| TRUST | 0.2629 | This miner's trust as a proportion of validators on the network. |
-| CONSENSUS | 0.89 | This validator's aggregate consensus score. |
-| INCENTIVE | 0.029 | This miner's incentive, TAO emission, is attained via mining. |
-| DIVIDENDS | 0.001 | This validator's dividends, TAO emission, are attained via validating. |
-| EMISSION | 29_340_153 | This miner's total emission in RAO (10^(-9) TAO) per block. |
-| VTRUST | 0.96936 | This validator's trust score as a validator. |
-| VPERMIT | \* | Whether this miner is considered active for validating on this subnetwork. |
-| UPDATED | 43 | Blocks since this miner set weights on the chain. |
-| AXON | 131.186.56.85:8091 | The entrypoint advertised by this miner on the bittensor blockchain. |
-| HOTKEY_SS58 | 5F4tQyWr... | The ss58-encoded address of the miner's hotkey. |
+| Parameter | Example value | Description |
+| :---------- | :----------------- | :------------------------------------------------------------------------------------- |
+| COLDKEY | my_coldkey | The name of the coldkey associated with your slot. |
+| HOTKEY | my_first_hotkey | The name of the hotkey associated with your slot. |
+| UID | 5 | Unique identifier of the neuron. |
+| ACTIVE | True | Whether or not the uid is considered active. |
+| STAKE(τ) | 71.296 | The amount of stake in this wallet. |
+| RANK | 0.0629 | This miner's absolute ranking according to validators on the network. |
+| TRUST | 0.2629 | This miner's trust score as a proportion of validators on the network. |
+| CONSENSUS | 0.89 | The consensus score of the neuron. |
+| INCENTIVE | 0.029 | Thencentive score representing the miner's incentive alignment. |
+| DIVIDENDS | 0.001 | The dividends earned by the neuron for validating on the subnet. |
+| EMISSION | 29_340_153 | The emission in RAO (p) received by the neuron. |
+| VTRUST | 0.96936 | The validator trust score indicating the network's trust in the neuron as a validator. |
+| VPERMIT | \* | Whether this neuron is considered eligible for validating on this subnetwork. |
+| UPDATED | 43 | Blocks since the neuron set weights on the chain. |
+| AXON | 131.186.56.85:8091 | The entrypoint advertised by this miner on the bittensor blockchain. |
+| HOTKEY_SS58 | 5F4tQyWr... | The ss58-encoded address of the miner's hotkey. |
### Meaning of ACTIVE
diff --git a/docs/working-with-keys.md b/docs/working-with-keys.md
index 9a18e1048..92a628419 100644
--- a/docs/working-with-keys.md
+++ b/docs/working-with-keys.md
@@ -4,6 +4,8 @@ title: "Creating/Importing a Bittensor Wallet"
import ThemedImage from '@theme/ThemedImage';
import useBaseUrl from '@docusaurus/useBaseUrl';
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
# Creating/Importing a Bittensor Wallet
@@ -23,11 +25,49 @@ The most critical operational goal when handling Bittensor wallets is to avoid l
## Creating a wallet with `btcli`
-### Creating a coldkey-only wallet
+
+
+If you intend to mine or validate within a subnet, or create and manage a subnet, you’ll need both a coldkey and a hotkey. If you already have a coldkey, you can [create a new hotkey](?create-wallet=hotkey) for it.
-Users that will not mine, validate, manage subnets or participate in governance do not need a hotkey, and for simplicity's sake should use coldkey-only wallets.
+To create a new coldkey and hotkey, run the following command in the terminal:
-Run the following command to create a coldkey-only wallet.
+```bash
+btcli wallet create --wallet.name --wallet.hotkey
+```
+
+:::info
+Use the below command to generate the hotkey. Replace `` with the name of the coldkey generated above, and `` with a name for your hotkey.
+
+For example,
+
+```bash
+btcli wallet create --wallet.name test-coldkey --wallet.hotkey test-hotkey
+```
+
+:::
+
+Next, you will be prompted to configure the wallet by setting a password for the coldkey, and choosing the desired mnemonic length. Completing the prompts creates a complete Bittensor wallet by setting up both coldkey and hotkeys. A unique mnemonic is generated for each key and output to the terminal upon creation.
+
+:::tip Regenerating the wallet keys
+Take note of the mnemonics in the response as they are required to regenerate your coldkey and hotkey. To regenerate your coldkey, run the following command in the terminal:
+
+```sh
+btcli wallet regen_coldkey --mnemonic "word1 word2 ... word12"
+```
+
+Similarly, run the following command in the terminal to regenerate your hotkey:
+
+```sh
+btcli wallet regen_hotkey --mnemonic "word1 word2 ... word12"
+```
+
+:::
+
+
+
+If a user does not intend to mine, validate, manage subnets, or participate in governance, a hotkey is not required. In such cases, a coldkey-only wallet is recommended for simplicity.
+
+Run the following command to create a coldkey-only wallet:
```bash
btcli wallet new_coldkey --wallet.name
@@ -44,53 +84,78 @@ You will see the terminal output like the following, which includes your all-imp
```text
IMPORTANT: Store this mnemonic in a secure (preferable offline place), as anyone who has possession of this mnemonic can use it to regenerate the key and access your tokens.
-The mnemonic to the new coldkey is: paddle disagree swamp hill innocent enemy name shrug produce steak pupil joke
-You can use the mnemonic to recreate the key with `btcli` in case it gets lost.
+The mnemonic to the new hotkey is: **** *** **** **** ***** **** *** **** **** **** ***** *****
+You can use the mnemonic to recreate the key in case it gets lost.
```
-### Creating a hotkey
+:::tip Regenerating the coldkey
+Take note of the mnemonic in the response as it is required to regenerate your coldkey. To regenerate your coldkey, run the following command in the terminal:
-If you plan to validate or mine in a subnet, you must create both a coldkey and a hotkey.
+```sh
+btcli wallet regen_coldkey --mnemonic "word1 word2 ... word12"
+```
-First, create a coldkey as described above in the [Creating a coldkey using `btcli`](#creating-a-coldkey-using-btcli). Then, provide this coldkey as a parameter to generate a hotkey. This will pair the hotkey with the coldkey. See below.
+:::
-Use the below command to generate the hotkey. Replace `` with the name of the coldkey generated above, and `` with a name for your hotkey.
+
+
+If you plan to validate or mine in a subnet, you must create both a coldkey and a hotkey. A hotkey is also required when creating and managing subnets.
+
+Before creating a hotkey, you must have created a coldkey as described in the [creating a coldkey tab](?create-wallet=coldkey). Next, provide this coldkey as a parameter to generate a hotkey. This will pair the hotkey with the coldkey as shown:
```bash
btcli wallet new_hotkey --wallet.name --wallet.hotkey
```
+:::info
+Use the below command to generate the hotkey. Replace `` with the name of the coldkey generated above, and `` with a name for your hotkey.
+
For example,
```bash
btcli wallet new_hotkey --wallet.name test-coldkey --wallet.hotkey test-hotkey
```
+:::
+
You will see the terminal log like below. The mnemonic is hidden for security reasons.
```text
IMPORTANT: Store this mnemonic in a secure (preferably offline place), as anyone who has possession of this mnemonic can use it to regenerate the key and access your tokens.
The mnemonic to the new hotkey is:
**** *** **** **** ***** **** *** **** **** **** ***** *****
-You can use the mnemonic to recreate the key in case it gets lost. The command to use to regenerate the key using this mnemonic is:
-btcli w regen_hotkey --mnemonic **** *** **** **** ***** **** *** **** **** **** ***** *****
+You can use the mnemonic to recreate the key in case it gets lost.
```
:::tip Regenerating the hotkey
-Make a note of the above command option `regen_hotkey` showing how to regenerate your hotkey in case you lose it.
+Take note of the mnemonic in the response as it is required to regenerate your hotkey. To regenerate your hotkey, run the following command in the terminal:
+
+```sh
+btcli wallet regen_hotkey --mnemonic "word1 word2 ... word12"
+```
+
:::
+
+
+
+---
+
### Encrypting the hotkey
-By default, the hotkey is not encrypted on the device, whereas the coldkey is encrypted. To encrypt your hotkey, run this command:
+By default, a hotkey is not encrypted on the device, whereas the coldkey is encrypted. To encrypt your hotkey, include the `--use-password` in the hotkey creation command as shown:
```bash
-btcli wallet new_hotkey --use-password
+btcli wallet new_hotkey --use-password --wallet.name test-coldkey --wallet.hotkey test-hotkey
```
## Creating a wallet using Python
-Copy and paste the following three lines into your Python interpreter. Replace the string values for `name` (`my_coldkey`) and `hotkey` (`my_hotkey`) with your own.
+
+
+If you intend to mine or validate within a subnet, or create and manage a subnet, you’ll need both a coldkey and a hotkey. If you already have a coldkey, you can [create a new hotkey](?create-wallet=hotkey) for it.
+
+To create a wallet with Python, copy and paste the following three lines into your Python interpreter. Replace the string values for `name` (`my_coldkey`) and `hotkey` (`my_hotkey`) with your own.
```python showLineNumbers
import bittensor as bt
@@ -111,24 +176,75 @@ The mnemonic to the new coldkey is:
**** **** **** **** **** **** **** **** **** **** **** ****
-You can use the mnemonic to recreate the key in case it gets lost. The command to use to regenerate the key using this mnemonic is:
-btcli w regen_coldkey --mnemonic **** **** **** **** **** **** **** **** **** **** **** ****
-
-Specify password for key encryption:
+You can use the mnemonic to recreate the key with `btcli` in case it gets lost.
+Enter your password:
Retype your password:
+Encrypting...
+wallet(test-coldkey, test-hotkey, ~/.bittensor/wallets/)
+```
+
+:::info Encrypting the hotkey
+Since the coldkey is encrypted by default, the command above only encrypts the newly created coldkey. To encrypt your hotkey when creating a wallet, include the `hotkey_use_password=True` parameter in the `wallet.create_if_non_existent()` method as shown:
+
+```python showLineNumbers
+import bittensor as bt
+wallet = bt.wallet(name = 'my_coldkey', hotkey = 'my_hotkey')
+wallet.create_if_non_existent(hotkey_use_password=True)
+```
+
+Then, you will be prompted to configure the wallet by setting a password for both the coldkey and the hotkey.
+:::
+
+
+
+If a user does not intend to mine, validate, manage subnets, or participate in governance, a hotkey is not required. In such cases, a coldkey-only wallet is recommended for simplicity.
+
+Copy and paste the following lines into your Python interpreter. Replace the string values for `name` (`my_coldkey`) with your own.
+
+```python showLineNumbers
+import bittensor as bt
+wallet = bt.wallet(name = 'my_coldkey')
+wallet.create_new_coldkey()
+```
+You will be prompted to input a password for the coldkey and then see the terminal output, which includes your all-important seed phrase, a.k.a. the _mnemonic_ to the coldkey.
+
+```text
IMPORTANT: Store this mnemonic in a secure (preferable offline place), as anyone who has possession of this mnemonic can use it to regenerate the key and access your tokens.
-The mnemonic to the new hotkey is:
+The mnemonic to the new hotkey is: **** *** **** **** ***** **** *** **** **** **** ***** *****
+You can use the mnemonic to recreate the key in case it gets lost.
+```
-**** **** **** **** **** **** **** **** **** **** **** ****
+
+
+If you plan to validate or mine in a subnet, you must have both a coldkey and a hotkey. A hotkey is also required when creating and managing subnets.
-You can use the mnemonic to recreate the key in case it gets lost. The command to use to regenerate the key using this mnemonic is:
-btcli w regen_hotkey --mnemonic **** **** **** **** **** **** **** **** **** **** **** ****
+Before creating a hotkey, you must have created a coldkey as described in the [creating a coldkey tab](?create-wallet=coldkey). Next, provide this coldkey as a parameter to generate a hotkey. This will pair the hotkey with the coldkey as shown:
-wallet(test-coldkey, test-hotkey, ~/.bittensor/wallets/)
+```python showLineNumbers
+import bittensor as bt
+wallet = bt.wallet(name = 'my_coldkey')
+wallet.create_new_hotkey()
+```
+
+:::info Encrypting the hotkey
+To encrypt your hotkey when creating a wallet, include the `use_password=True` parameter in the `wallet.create_new_hotkey()` method as shown:
+
+```python showLineNumbers
+import bittensor as bt
+wallet = bt.wallet(name = 'my_coldkey')
+wallet.create_new_hotkey(use_password=True)
```
+Then, you will be prompted to configure the wallet by setting a password for both the hotkey.
+:::
+
+
+
+
+---
+
## Location and addresses of the local wallets
Both `btcli` and the Bittensor Python SDK use a local wallet/key store. By default, this is located on your machine at `~/.bittensor/wallets`. Use the below command to list them:
diff --git a/docusaurus.config.js b/docusaurus.config.js
index c08b6e4c0..dfc319b76 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -190,7 +190,7 @@ const config = {
alt: "Bittensor",
src: "img/logo.svg",
srcDark: "img/logo-dark-mode.svg",
- href: "https://learnbittensor.org",
+ href: "https://docs.learnbittensor.org",
style: {
objectFit: "contain",
width: 21,
diff --git a/sidebars.js b/sidebars.js
index f2119fcca..7497fb2b3 100644
--- a/sidebars.js
+++ b/sidebars.js
@@ -89,9 +89,9 @@ const sidebars = {
label: "Liquidity Positions (Uniswap)",
collapsible: true,
collapsed: true,
- items: [
- 'liquidity-positions/liquidity-positions',
- 'liquidity-positions/managing-liquidity-positions'
+ items: [
+ "liquidity-positions/liquidity-positions",
+ "liquidity-positions/managing-liquidity-positions",
],
},
{
@@ -101,14 +101,14 @@ const sidebars = {
collapsed: true,
items: [
"subnets/metagraph",
- "subnets/create-a-subnet",
+ "subnets/create-a-subnet",
"subnets/subnet-creators-btcli-guide",
"subnets/subnet-hyperparameters",
"subnets/working-with-subnets",
"subnets/walkthrough-prompting",
"tutorials/basic-subnet-tutorials",
"tutorials/ocr-subnet-tutorial",
- "subnets/yuma3-migration-guide"
+ "subnets/yuma3-migration-guide",
],
},
{
@@ -181,7 +181,7 @@ const sidebars = {
"local-build/deploy",
"local-build/provision-wallets",
"local-build/create-subnet",
- // "local-build/mine-validate"
+ "local-build/mine-validate",
],
},