Skip to content

Weight System

Weights are the most fundamental concept in the economics of Torus. Stake collectively weights the distribution of rewards. Validator Stake submits weights periodically representing the proportion of rewards each Miner should have according to their evaluation.

This allows to granularly define and adapt the distribution of rewards between miners, while separating the computation involved in calculating the weights from the protocol. Allowing to create granular, adaptive, dynamic incentive landscapes.

Since this basic mechanism alone is vulnerable to selfish dishonest actors, subnets run a consensus calculation between the transformation of local weights to global weights based on Stake.

See Yuma Consensus.

Setting Weights

  1. Register your validator on a subnet:

    You will first have to pick a subnet on which you will set the weights on. This also means that you have to register your key there.

    Terminal window
    tor module register <name-of-validator> <key-name> [--netuid <id>] [--ip <ip>] [--port <port>] [--metadata <metadata>] [--new-subnet-name <name>]
  2. Stake your tokens to the desired subnet`

    Terminal window
    tor balance stake <key-name> <amount> <your-validator-addresses>
  3. Set the weights on set of uids:

    # Python code example:
    from torus-cli.compat.key import classic_load_key
    from torus-cli.client import torusClient
    # this is the id of the subnet, you want to set weights on, make sure your key is registered here
    netuid = 3
    # the ids of miners you want to set weights on
    uids = [1, 2, 3, 4, 5]
    # the weight you put on each miner
    weights = [1, 2, 3, 4, 5]
    # load your key, make sure it's registered on the `netuid` and has a stake on it
    key = classic_load_key("foo")
    client = torusClient("wss://example-node.com")
    result = client.vote(key=key, uids=uids, weights=weights, netuid=3)

Important consideration is also a subnet consensus.

Yuma Subnets

General Subnet

That means that it might not be a profitable strategy to set scoring outside of the subnetwork intend.