New Commitments of Knowledge Feature Released in Bittensor Update 141
- Bittensor update 141 introduces commitments of knowledge for subnet builders on the chain.
- Four new functions have been added to the Python API:
subtensor.commit()
,subtensor.get_commitment()
,bittensor.extrinsics.serving.publish_metadata()
, andbittensor.extrinsics.serving.get_metadata()
.
Good day @everyone,
Yesterday, update 141 for Subtensor was published to mainnet, adding a new capability for subnet builders to the chain: commitments of knowledge.
Alongside the release of Bittensor 6.5.0, four new functions have been added to the Python API.
subtensor.commit(wallet, netuid, data)
subtensor.get_commitment(netuid, uid)
bittensor.extrinsics.serving.publish_metadata(wallet, netuid, type, data)
bittensor.extrinsics.serving.get_metadata(netuid, hotkey)
Public functions commit
and get_commitment
are what most developers should probably be using, while publish_metadata
and get_metadata
are internal functions that allow more control (and return more data.)
This allows subnets to have miners and validators definitively prove knowledge of some data on-chain at a specific time, that is cryptographically provable and is broadcasted across the network.
Here are some examples on how to use the new functions:
# This uses the hotkey and requires no fee, but is rate limited to 100 blocks
# Hotkey must be registered to the subnet in order to commit data
# Max string length is 128 characters
subtensor.commit(wallet, netuid=1, "Hello, world!")
...
data = subtensor.get_commitment(netuid=1, uid=23)
print(data)
-> Hello, world!
Happy developing! rusty
Source: Discord - Bittensor →