Discord4 months ago

Bittensor Update 141: Introducing Commitments of Knowledge

Summary
  • Update 141 for Bittensor introduces commitments of knowledge to the Subtensor mainnet.
  • Four new functions have been added to the Python API: subtensor.commit, subtensor.get_commitment, bittensor.extrinsics.serving.publish_metadata, and bittensor.extrinsics.serving.get_metadata.
  • The commit and get_commitment functions allow developers to prove knowledge of data on-chain, while the publish_metadata and get_metadata functions provide more control and return additional data.

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

📣 Related news

Loading news...

💼 DePIN Hub Newsletter

We bring you real world use cases of web3 through DePIN. And btw, you can generate passive income along the way!