Skip to content
TAO$188.21
BTC0.002927
MCap$2.22B
Vol$86.25M

API reference / Basket funds

Clear a validator's basket target

DELETE/api/v2/baskets/{hotkey}/target
Status
Beta
Auth
API key or OAuth access token
Scope
data:read
Rate limit
basket_target

A validator's target allocation for its basket fund: how it says it intends to split the fund across subnets (netuid 0 is the share kept as TAO).

Full description

A validator's target allocation for its basket fund: how it says it intends to split the fund across subnets (netuid 0 is the share kept as TAO). It is published by the hotkey's owner coldkey and stored by bittensor.ai: the validator's stated intent, never what the chain holds (the fund's holdings are on GET /baskets/{hotkey}). Clears the target (it stays in the history); the message's mix line is mix: none. Proof: the body carries the exact message and either the owner coldkey's signature of it or the remark_extrinsic in which the owner coldkey committed to it on chain (for multisig and proxied coldkeys). The message's coldkey line must own the hotkey now (403 NOT_HOTKEY_OWNER), its chain line must be the Bittensor mainnet genesis hash (400 WRONG_CHAIN) and its hotkey line the hotkey in the path (400 HOTKEY_MISMATCH). Each message is accepted once: its nonce must be new for the hotkey (400 NONCE_REUSED) and its issued_at later than the hotkey's newest accepted write (400 STALE_ISSUED_AT). Nothing is stored when any check fails. No sign-in is needed: the proof is the authority. Limits: 30 writes per hour from one IP address (every attempt counts) and 12 per hotkey (counted once the proof is valid); past either, 429 RATE_LIMITED with Retry-After. The answer is never cached (no-store). Errors are application/problem+json: INVALID_ADDRESS, INVALID_PROOF, INVALID_TARGET_MESSAGE, WRONG_CHAIN, HOTKEY_MISMATCH, MIX_MISMATCH, EXPIRED, BAD_SIGNATURE, UNWRAPPED_SIGNATURE, INVALID_ID, REMARK_NOT_FOUND, REMARK_MISMATCH, REMARK_TOO_OLD, NONCE_REUSED, STALE_ISSUED_AT (400), NOT_HOTKEY_OWNER (403), RATE_LIMITED (429), UNKNOWN_PARAMETER, SOURCE_TIMEOUT (503), SOURCE_NOT_READY (503), TARGET_NOT_FOUND (404: there is no target to clear).

Beta: this route may change with one release's notice in the v2 changelog; additive changes need none (x-stability: beta).

Path parameters

hotkeypath, required· string

The validator's hotkey: SS58, or 0x + 64 hex (400 INVALID_ADDRESS otherwise).

Request body

A JSON object with these fields:

messagestring

The exact text the owner coldkey signed (or committed to with a remark): UTF-8, eight lines joined by \n, no trailing newline, in this order: bittensor.ai basket target v1; chain: + the Bittensor mainnet genesis hash (0x2f0555cc76fc2840a25a6ea3b9637146806f1f44b090c175ffde2a7e5ab36c03); hotkey: + the hotkey in the path, SS58; coldkey: + the hotkey's owner coldkey, SS58; mix: + the entries as <netuid>=<bps> joined by commas in ascending netuid (exactly the body's mix), or none to clear; nonce: + 32 random lower-case hex characters, never reused for this hotkey; issued_at: and expires_at: , RFC 3339 UTC in whole seconds with Z, expires_at after issued_at and at most 15 minutes after it. A malformed message is a 400 INVALID_TARGET_MESSAGE. To clear the target the mix line is mix: none.

Pattern: ^bittensor\.ai basket target v1\nchain: 0x[0-9a-f]{64}\nhotkey: [1-9A-HJ-NP-Za-km-z]{46,48}\ncoldkey: [1-9A-HJ-NP-Za-km-z]{46,48}\nmix: (none|[0-9]{1,5}=[0-9]{2,5}(,[0-9]{1,5}=[0-9]{2,5}){0,127})\nnonce: [0-9a-f]{32}\nissued_at: [0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z\nexpires_at: [0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$
signaturestring · can be null

The owner coldkey's signature of the message (0x + 128 hex, sr25519 or ed25519), as a wallet extension's signRaw with type bytes returns it: the signed payload is the message wrapped in <Bytes> and </Bytes>. A signature of the unwrapped message is a 400 UNWRAPPED_SIGNATURE; any other is a 400 BAD_SIGNATURE. With a signature the message must be current: from 60 seconds before issued_at to expires_at (400 EXPIRED). Send this or remark_extrinsic, not both (400 INVALID_PROOF).

Pattern: ^0x[0-9a-fA-F]{128}$
remark_extrinsicstring · can be null

For an owner coldkey that cannot sign messages (a multisig or a proxied account): the extrinsic, as {height}-{index} or its 0x hash, in which the owner coldkey dispatched System.remark_with_event with the remark bittensor.ai basket target v1 sha256: followed by the lower-case hex SHA-256 of the message's UTF-8 bytes. The extrinsic must carry a System.Remarked event whose hash is the BLAKE2b-256 of those remark bytes and whose sender is the coldkey line (400 REMARK_MISMATCH), the coldkey must have owned the hotkey at that block (403 NOT_HOTKEY_OWNER), and the block must be finalized (400 REMARK_NOT_FOUND until it is) and at most 24 hours old (400 REMARK_TOO_OLD). expires_at is not checked on this path, but issued_at may not be in the future (400 EXPIRED). A malformed value is a 400 INVALID_ID.

Response

data is an object with these fields. Amounts are integer strings in their base unit, and null means unknown, never zero (see Units and formats). meta.at names the block the answer was read at.

The clear.

hotkeystring

The validator's hotkey, SS58.

Format: SS58 address
statusstring

Always cleared: the hotkey has no target now. New values may be added; show an unknown value as is (or generically).

cleared_atstring (date-time)

When the clear was accepted, RFC 3339 UTC.

Format: date and time, ISO 8601 in UTC
set_by_coldkeystring

The owner coldkey that proved the clear, SS58.

Format: SS58 address
proofobject

The message and its signature or remark.

4 fields in proof
kindstring

signature (the owner coldkey signed the message) or remark (the owner coldkey dispatched an on-chain remark committing to it). New values may be added; show an unknown value as is (or generically).

messagestring

The exact message that was proven, as sent.

signaturestring · can be null

The signature of the <Bytes>-wrapped message, 0x hex (lower case). Null for a remark.

remark_extrinsicstring · unit id · can be null

The remark's extrinsic, {height}-{index}. Null for a signature.

Format: block and index, such as 4200000-3

Response headers

6 headers: Cache-Control, RateLimit-Policy, RateLimit, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
Cache-Control

One of three classes: settled public, max-age=3600, stale-while-revalidate=86400 (pinned to a block that cannot move), slow public, max-age=300, stale-while-revalidate=600 (state that moves in minutes or days) or tip public, max-age=6, stale-while-revalidate=12 (follows the chain head); the label routes are cached until the next nightly copy (public, max-age=<seconds>, stale-while-revalidate=60). Never immutable. no-store on an earlier answer served because the data source failed (X-BTAI-Stale).

RateLimit-Policy

The tier's request quota of the current window (IETF draft), e.g. "tier";q=600.

RateLimit

Requests left in the current window and the seconds until it resets (IETF draft), e.g. "tier";r=597;t=42.

X-RateLimit-Limit

The tier's request quota of the current window.

X-RateLimit-Remaining

Requests left in the current window.

X-RateLimit-Reset

When the current window resets, Unix seconds.

Status codes

200 · 400 · 401 · 402 · 403 · 404 · 429 · 500 · 502 · 503

Error codes

The codes this endpoint can return. Each links to what it means and what to do.

From the API's published specification, version 1.165.0.