EngramEngramDocs

Namespace Attestation

Link a namespace to a Bittensor hotkey. The hotkey's on-chain TAO stake becomes a publicly verifiable trust signal — no central moderation required.

Overview

Engram cannot verify whether stored content is true — that's an unsolvable problem for any decentralized system. What it can do is make accountability legible and on-chain-verifiable.

Namespace attestation works like this: a namespace owner signs a challenge with their Bittensor hotkey. Their TAO stake on that hotkey determines a trust tier. Every query result carries the trust tier of its namespace. Agents decide which tiers they're willing to trust — Engram enforces nothing at the content level.

Tip
Think of it like domain reputation on the web. TCP/IP doesn't verify content truthfulness — reputation layers built on top of it do. Attestation is Engram's reputation layer.

Trust tiers

TierStake requiredWhat it means
sovereign≥ 1000 TAOProtocol-level trusted entity — significant economic stake at risk
verified≥ 100 TAOMeaningful accountability — costly to abandon and re-create
community≥ 1 TAOBasic skin in the game — cheap but not free
anonymous< 1 TAO or unattestedNo guarantees — treat as untrusted

Stake is refreshed from the metagraph every 10 minutes. If an owner's stake drops below their tier threshold, the tier degrades automatically — no manual intervention required.

How it works

  1. The namespace owner signs a canonical message with their Bittensor sr25519 hotkey
  2. The miner verifies the signature and reads the owner's TAO stake from the metagraph
  3. A trust tier is assigned based on stake and persisted alongside the namespace
  4. Every query result from that namespace carries the trust_tier field
  5. Agents filter results by the minimum trust tier they're willing to accept

Attesting a namespace

Using the Python SDK

python
from engram.miner.attestation import build_attestation_payload
import bittensor as bt
import requests
# Load your wallet
wallet = bt.wallet(name="my_wallet")
# Build a signed attestation payload
payload = build_attestation_payload(wallet.hotkey, "my_agent_memory")
# Submit to your miner
resp = requests.post("http://your-miner:8091/AttestNamespace", json=payload)
print(resp.json())
# {
# "ok": true,
# "namespace": "my_agent_memory",
# "trust_tier": "verified",
# "stake_tao": 250.0
# }

Using curl

You need to build the signature yourself. The canonical message to sign is:

text
engram-attest:{namespace}:{timestamp_ms}
bash
curl -X POST http://your-miner:8091/AttestNamespace \
-H "Content-Type: application/json" \
-d '{
"namespace": "my_agent_memory",
"owner_hotkey": "5YourHotkeyAddress...",
"signature": "0xsignature_hex...",
"timestamp_ms": 1712345678123
}'
Note
The timestamp must be within ±60 seconds of the miner's clock (replay protection). Generate it fresh — don't reuse a previous payload.

Checking a namespace's trust tier

bash
curl http://your-miner:8091/attestation/my_agent_memory
# {
# "namespace": "my_agent_memory",
# "owner_hotkey": "5YourHotkeyAddress...",
# "trust_tier": "verified",
# "stake_tao": 250.0,
# "attested_at": 1712345678.0,
# "attested": true
# }

Filtering query results by trust

Every query result now includes a trust_tier field. Unattested namespaces return "anonymous".

python
results = client.query("attention mechanisms in transformers")
# Only use results from verified or sovereign namespaces
trusted = [r for r in results if r["trust_tier"] in ("verified", "sovereign")]
for r in trusted:
print(f"{r['score']:.4f} [{r['trust_tier']}] {r['cid']}")
python
# Example result structure
{
"cid": "v1::a3f2b1c4...",
"score": 0.9821,
"metadata": {"source": "arxiv", "title": "Attention Is All You Need"},
"trust_tier": "verified"
}
Tip
For production agents, combine namespace attestation with private namespaces: attest your private namespace so other parties can verify you own it, while keeping the content encrypted so miners can't read it.

API reference

POST /AttestNamespace

FieldTypeRequiredDescription
namespacestringYesThe namespace to attest
owner_hotkeystring (SS58)YesBittensor hotkey address of the owner
signaturestring (hex)Yessr25519 signature over canonical message
timestamp_msintegerYesUnix milliseconds — must be within ±60s of server time

GET /attestation/{namespace}

FieldTypeDescription
namespacestringThe queried namespace
owner_hotkeystringHotkey that attested (omitted if unattested)
trust_tierstringsovereign / verified / community / anonymous
stake_taofloatTAO at last refresh (omitted if unattested)
attested_atfloatUnix timestamp of attestation (omitted if unattested)
attestedbooleanWhether this namespace has been attested

Threat model

ThreatProtected?
Attacker injects content into your attested namespace✓ Yes — only owner's hotkey can attest; namespace key still required to write
Attacker buys high stake, poisons, then unstakesPartial — economic cost deters casual attacks; stake lock period adds friction
Unattested namespace serves bad contentExpected — tier shows as 'anonymous'; agents should reject or weight accordingly
Owner's stake drops after attesting✓ Handled — tier auto-degrades when stake falls below threshold on next refresh
Replay attack reuses old attestation payload✓ Yes — timestamp window ±60s; old payloads rejected
Attacker spoofs hotkey without signing✓ Yes — sr25519 signature verification required
Note
Attestation solves accountability, not content truth. A sovereign-tier namespace proves the owner has significant economic stake at risk — it does not prove their content is accurate. Use it as a trust signal, not a content guarantee.
engram docs · v0.1edit on github →