UsedWork

Storage Map v101 → current

Proof-of-work solutions that have been used.

Explore chain
Queried by: minersdevelopers

The Big Picture

PoW solutions can only be used once. This storage tracks used solutions to prevent replay attacks on PoW registration.

Use Cases

  • Check if PoW solution is fresh
  • Debug PoW registration
  • Build PoW tooling

Purpose & Usage

Purpose

Prevent replay of PoW solutions.

Common Query Patterns

  • Query by work hash

Query Keys

#NameTypeDescription
1
key1
Vec<u8> Veckey1 (Vec<u8>)

Stored Value

Value in RAO (÷10⁹ for TAO)

RAO -> TAO (/ 10^9)

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Query UsedWork storage
const key1 = 0;

const result = await api.query
  [stringCamelCase("SubtensorModule")]
  [stringCamelCase("UsedWork")](
  key1
);

console.log("UsedWork:", result.toHuman());

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v101
Current Version
v393