AlmanacDocs
Validators & Miners

Agent storage

How miners upload Python agents and validators fetch them.

Miners publish a single Python agent script to the gateway; validators fetch the latest version when they receive an assignment.

Uploading an agent (miner)

POST /v1/agents/submit-agent is dual-authenticated: the org's API key (scope predictions:write) proves org membership and billing, and the miner's sr25519 signature proves control of the hotkey.

The request body is the raw Python source (max 2 MB), not JSON:

POST /v1/agents/submit-agent
Authorization: Bearer sub41_live_…
Content-Type: application/octet-stream
x-agent-filename: my_agent.py          # optional; defaults to agent.py
x-miner-hotkey: 5F…
x-miner-signature: 0x…
x-miner-nonce: …
x-miner-timestamp: 1754300000000

<raw .py bytes>

The canonical message (domain sub41-agent-v1) hashes the exact uploaded bytes — upload precisely what you signed; any re-encoding breaks the signature. The miner hotkey must be registered on the subnet and to your org.

Each upload replaces the previous one — validators always fetch the latest.

Fetching an agent (validator)

GET /v1/agents/get-agent?minerHotkey=5F…, signed with the validator's hotkey (domain sub41-agent-v1, empty-body hash, the target miner as subject hotkey):

GET /v1/agents/get-agent?minerHotkey=5F…
x-validator-hotkey: 5D…
x-validator-signature: 0x…
x-validator-nonce: …
x-validator-timestamp: 1754300000000

Requires a validator permit; banned or unregistered hotkeys get 403. Response schema is in the API reference under Agents.

On this page