Commit Reveal
This page describes the commit reveal feature: a configurable waiting period that elapses between a) when consensus weights set by subnet validators are first committed, and b) when they are revealed publicly and included in Yuma Consensus.
This feature was designed to address the issue of weight copying by validators.
Weight copying
In each Bittensor subnet, each validator scores—or 'weights'—each miner, producing what is referred to as a weight vector. The weight vectors for each validator in a subnet are combined into a weight matrix. This matrix determines the distribution of rewards to miners in the subnet based on the consensus evaluation of their performance, according to Yuma Consensus.
The weight matrix is public information, and must be, so that the distribution of rewards in the Bittensor platform can be transparently fair. However, this transparency makes it possible for subnet validators to free-ride on the work of other validators by copying the latest consensus rather than independently evaluating subnet miners. This is unfair and potentially degrades the quality of validation work, undermining Bittensor's ability to reward the best miners and produce the best digital commodities overall.
The commit reveal feature is designed to solve the weight copying problem by giving would-be weight copiers access only to stale weights. Copying stale weights should result in validators departing from consensus. However, it is critical to note that this only works if the consensus weight matrix changes sufficiently on the time scale of the commit reveal interval. If the demands on miners are too static, and miner performance is very stable, weight copying will still be successful. The only solution for this is to demand continuous improvement from miners, requiring them to continuously evolve to maintain their scoring. Combined with a properly tuned Commit Reveal interval, this will keep validators honest, as well as producing the best models.
Commit Reveal and Immunity Period
The Immunity Period is the interval (measured in blocks) during which a miner or validator newly registered on a subnet is 'immune' from deregistration due to performance. The duration of this period value should always be larger than the Commit Reveal interval, otherwise the immunity period will expire before a given miner's scores are available, and they may be deregistered without having their work counted.
When creating a new subnet, ensure that the miner immunity period is larger than the commit reveal interval. When updating the immunity period or commit reveal interval hyperparameters for a subnet, use the following formula:
new_immunity_period = (new_commit_reveal_interval - old_commit_reveal_interval) + old_immunity_period
Commit reveal in detail
When commit reveal is enabled, it works as follows:
-
A subnet validator sets the weights normally by using
set_weights
. -
Instead of publishing weights openly, an encrypted copy of these weights is committed to the blockchain, using an internal method called
commit_weights
. -
A waiting interval, specified as a number of blocks, elapses. Subnet owners configure this interval with the subnet hyperparameter
commit_reveal_weights_interval
. -
After this interval has elapsed, the unencrypted weights are automatically revealed by the chain, using Drand time-lock encryption.
-
The weights are now input to Yuma Consensus.
After the subnet owner turns ON the commit reveal feature, everything happens behind the scenes. A subnet validator will continue to set weights normally by using set_weights
.
How to use the commit reveal feature
As a subnet owner, set the below hyperparameters to use the commit reveal feature:
commit_reveal_weights_enabled
(boolean): Set this toTrue
to activate the commit reveal feature for the subnet. Default value isFalse
.commit_reveal_weights_interval
(int): Set this to an integer number. This is the number of subnet tempos to elapse before revealing the weights by submitting them again to the blockchain, but now openly for everyone to see. Default value is1
.
See Setting subnet hyperparameters.
Weights will be revealed immediately at the beginning of the tempo after the commit_reveal_weights_interval
. For example, if commit_reveal_weights_interval
value is set to 3
, then the reveal will occur at the beginning of the fourth tempo from the current tempo. The current tempo is counted as the first tempo. See the below diagram for this example:
Technical papers and blog
- ACM CCS2024 Poster PDF Solving the Free-rider Problem In Bittensor.
- See Weight Copying in Bittensor, a technical paper (PDF).
- Blog post, Weight Copying in Bittensor.