Emission for Miners
How is emission calculated for Miners? Emission is derived from the incentive calculated by Yuma Consensus.
- Validators test miners, and create a ranked list of each miner (weights). These weights are regularly delivered to the consensus engine.
- These are stored in a 2D matrix - each row is the UID of the validator placing weights, and each column is the UID of the miner. (A visual representation of the weights can be found for each subnet on taostats: Subnet 19 Miner weights .
- These weights are used to calculate
incentiveand consensus - how well do the validators agree on scoring? - The
incentivescore is made by a weighted average of validator weights. Weights placed by validators with higher amounts of delegation of tao are given higher weight in the incentive score. Validators that are out of consensus (a high deviation from the weighted score) may have their weight reduced further.
Incentive
Section titled “Incentive”The incentive score for a subnet scores how well miners are performing in relation to other miners. The sum of incentive scores in a subnet is 1.
- Each miner’s
incentivescore is reported in the metagraph of the subnet. - The
incentivescore is updated once per tempo of the subnet (360 blocks)
Emission
Section titled “Emission”
The miner emission score is how much tao is awarded to the miner each epoch. (An epoch is 360 blocks.)
Emission is calculated and awarded every epoch. This can mean that emission is delivered to your hotkey after your miner is deregistered.
Daily Rewards
Section titled “Daily Rewards”On taostats, the daily rewards is calculated by multiplying emission *20 (There are ~20 epochs in 24 hours.)
https://www.youtube.com/watch?v=Z2s7jEJK_m4
We can extract the weights, consensus, and incentive scores from the network, and look at how they interact.
Let’s grab the data for Subnet 18, miner 191.
import bittensor as bt
#who we are interested insubnet_number = 18miner_uid = 191
#validator parameters:#we need to find the rows for where validators have placed weights.#find the rows by lookin in the stake vector for rows with large delegationmin_stake = 22000validators = []total_stake = 0counter =0
#load the data from the networksubnet = bt.metagraph( netuid = subnet_number, lite = False)subnet_weights = subnet.Wsubnet_stake = subnet.Ssubnet_consensus = subnet.Csubnet_incentive = subnet.I
#loop through all of the UIDs.#if there is a large amount of stake - we have a validator#grab the weight placed for the miner_uidfor neuron in subnet_stake: stake = neuron.item() if stake > min_stake: weight = subnet_weights[counter][miner_uid] print(f"validator {counter}: Weight {weight}")
counter += 1
#now grab consensus and incentiveprint(f"consensus: {subnet_consensus[miner_uid]}")print(f"incentive: {subnet_incentive[miner_uid]}")validator 21: Weight 0.0022598521318286657validator 63: Weight 0.0014278064481914043validator 77: Weight 0.002753422362729907validator 104: Weight 0.00243220292031765validator 120: Weight 0.0validator 132: Weight 0.001061580260284245validator 133: Weight 0.003077547997236252validator 139: Weight 0.003447300987318158validator 145: Weight 0.0017241350142285228validator 160: Weight 0.0019509864505380392validator 171: Weight 0.0030758935026824474validator 175: Weight 0.0037663523107767105validator 180: Weight 0.001641291193664074validator 181: Weight 0.0024577134754508734validator 187: Weight 0.0022174983751028776validator 188: Weight 0.0017739878967404366validator 190: Weight 0.0033894709777086973validator 194: Weight 0.004710848908871412validator 230: Weight 0.0024577134754508734validator 232: Weight 0.0021844268776476383validator 236: Weight 0.0030592582188546658validator 246: Weight 0.0021754945628345013consensus: 0.0021820401307195425incentive: 0.002151522086933255The code calls the Chain and asks for all of the validator weights. The output is a formatted list with the weight from each validator. In the response, we can see on line 5 that validator 120 placed no weight. This score will be removed by the consensus engine, and the VTrust for the validator will be reduced.
The overall consensus is 0.00218, and looking at the weights placed by each validator - we can see that most of the validators are close to that score. The overall incentive is right around the consensus (slightly lower) at 0.00215
Charting Weights and Consensus
Section titled “Charting Weights and Consensus”The code below draws a red dotted line indicating the consensus weight. Each validator’s weight is shown by a blue dot.
import matplotlib.pyplot as plt
# Unpack the points into two lists: xs and ysxs, ys = zip(*weights)
# Create a scatter plotplt.scatter(xs, ys)
# Add a horizontal line at y = consenusplt.axhline(y=subnet_consensus[miner_uid], color='r', linestyle='--')
# Set the labels for the axesplt.xlabel('Validator UID')plt.ylabel('Weight')
# Set the title of the plotplt.title(F'weights and consensus for miner {miner_uid} in subnet {subnet_number}')
# Show the plotplt.show()
Validator 103 is the point at the top of the graph, and out of consensus with the others - all much closer to the consensus line. The weight posted by Validator 103 will not be included (or its weight drastically reduced) as it is out of consensus.