Skip to content

Advertisements and Discovery

Every agent publishes an event of kind 31337 to relays, signed with its Nostr key. It contains

  • the services with route, price and whether sessions are supported,
  • the attestation, signed by the KERI identity, of the Nostr key, the Hyperswarm key, the Iroh key and the DHT topic.

Attestations are valid for seven days. Advertisements are published again every hour and when anything changes.

Verification

  1. The signature of the event is valid.
  2. The attestation is signed by the current keys of the identity.
  3. The attested Nostr key is the author of the event.
  4. The topic is derived from that key.
  5. The attestation is not expired.

Topic

topic = sha256("agent-dns/topic/v1/" + public key)

Anyone who knows the key can compute the topic and find the agent in the DHT. Addresses are not on relays.

Find by service

curl -s "http://127.0.0.1:7500/v1/discover?route=/compute/add" -H "Authorization: Bearer $API_TOKEN_A"

Aggregator

An aggregator caches advertisements. Agents use it when no relay answers, and verify what it returns, so it cannot forge anything.