archon

Archon Herald — Service Specification

Language-agnostic contract for Herald — the Archon name service. Users prove DID ownership via challenge-response, claim a short @name handle, receive a verifiable credential attesting to their membership, and are published to a directory served as JSON, IPNS, LUD-16, WebFinger, and OIDC.

The canonical implementation is services/herald/server/.

Related specs. Herald is a Keymaster client end-to-end. Its challenge-response auth uses Keymaster’s createChallenge/verifyResponse; its credential issuance uses bindCredential/issueCredential/updateCredential/revokeCredential. When fronted by Drawbridge, Herald’s /.well-known/* and /api/* are reached through Drawbridge’s /.well-known/* and /names/* mounts respectively (see Drawbridge spec §2.1).


1. Service responsibilities

Herald is a single-tenant naming authority. One instance owns one namespace and serves:

  1. Login flow — the user scans a QR pointing at a wallet URL with a challenge query param; the wallet returns a response DID; Herald verifies it via Keymaster and stores the resulting authenticated DID in an Express session.
  2. Name claim / release — authenticated users claim a unique @name (3-32 chars; names are lowercased before validation and storage, then matched against [a-z0-9_-]+); the name is recorded on the Herald’s local user database and a verifiable credential is issued and stored as an asset DID owned by the Herald’s service identity.
  3. Public registry — the full name → DID directory is served as JSON at /api/registry, /directory.json, and /.well-known/names. Optionally published to IPNS for decentralized resolution.
  4. Lookup adapters — every name is reachable via:
    • GET /api/name/:name — JSON { name, did }
    • GET /api/member/:name — full resolved DID document
    • GET /api/name/:name/avatar — PNG/JPEG bytes of the user’s avatar (asset DID linked from their profile)
    • GET /.well-known/lnurlp/:name + GET /api/lnurlp/:name/callback — full LUD-16 Lightning address (delegates to the user’s DID’s Lightning service entry)
    • GET /.well-known/webfinger?resource=acct:name@domain — RFC 7033 WebFinger
  5. OAuth 2.0 / OIDC — /oauth/authorize, /oauth/token, /oauth/userinfo, /oauth/.well-known/jwks.json, plus discovery at /.well-known/openid-configuration. ES256-signed JWTs.
  6. Owner admin — a single ARCHON_HERALD_OWNER_DID has admin privilege: list users, delete users, trigger IPNS publication.

The service holds either a full Keymaster wallet (standalone mode) or a Keymaster client connection (shared mode); see §4.


2. HTTP API contract

Single Express app on ${ARCHON_HERALD_PORT} (default 4230). Sessions cookie-based via express-session. Routes are split into several namespaces:

2.1 Health, config, version

Method Path Notes
GET /api/version 1 (the literal integer). Stable schema version of the API.
GET /api/config { serviceName, serviceDID, serviceDomain, publicUrl, walletUrl }, plus relayAgent when ARCHON_HERALD_SENDGRID_API_KEY is set. relayAgent is the Herald service DID clients can address for dmail/email relay.

2.2 Login (challenge-response)

Method Path Notes
GET /api/challenge Creates a Keymaster challenge, stores it on the session, returns { challenge, challengeURL }. challengeURL is <walletUrl>?challenge=<DID>.
GET /api/login?response=<DID> Verifies the response DID via Keymaster verifyResponse({ retries: 10 }). On match, sets session.user = { did } and returns { authenticated: true }.
POST /api/login Same as GET but takes { response } in the JSON body.
POST /api/logout Destroys the session. Returns { ok: true }.
GET /api/check-auth { isAuthenticated, userDID, isOwner, profile }.

2.3 Profile & names (session auth)

Method Path Notes
GET /api/users Authenticated. Returns string[] of all known DIDs.
GET /api/profile/:did Authenticated. Returns the user’s profile.
GET /api/profile/:did/name Authenticated. Returns { name }.
PUT /api/profile/:did/name Owner-of-:did only. Body: { name }. Validates, claims, issues credential. Returns { ok: true, message } (the credential is not included in the response; fetch via GET /api/credential).
DELETE /api/profile/:did/name Owner-of-:did only. Releases name + revokes credential.
GET /api/credential Authenticated. When the caller has a credential, returns { hasCredential: true, credentialDid, credentialIssuedAt, credential }. When the caller has no credential, returns { hasCredential: false, name, message }.

2.4 Stateless name management (Bearer token)

For programmatic clients that already hold a verified Keymaster challenge response.

Method Path Notes
PUT /api/name Body: { name }. Auth: Authorization: Bearer <responseDid> — Herald calls keymaster.verifyResponse(responseDid) itself. Returns { ok, name, did, credentialDid, credentialIssuedAt, credential }.
DELETE /api/name Bearer auth. Releases the caller’s name + revokes credential.

2.5 Public lookups (no auth)

Method Path Notes
GET /api/registry { version: 1, updated, names: { "<name>": "<DID>" } }.
GET /directory.json Same as /api/registry. Convention for IPNS publication.
GET /api/name/:name { name, did } or 404 { error: "Name not found" }.
GET /api/member/:name Full DidCidDocument of the named member, fetched via Keymaster.
GET /api/name/:name/avatar Binary image bytes; sets Content-Type to a safe-listed image MIME (image/avif, image/gif, image/jpeg, image/jpg, image/png, image/webp); other types are served as application/octet-stream.

2.6 LUD-16 Lightning address

Method Path Notes
GET /.well-known/lnurlp/:name Standard LUD-06 metadata: { tag: "payRequest", callback, minSendable, maxSendable, metadata }. minSendable=1000 msats, maxSendable=100000000000 msats (100k sats). Errors as { status: "ERROR", reason }.
GET /api/lnurlp/:name/callback?amount=<msats> Resolves the named member’s DID, follows the Lightning service entry, requests an invoice, normalizes the response to LUD-06 { pr, routes }. Onion endpoints routed via ARCHON_HERALD_TOR_PROXY if set.

2.7 WebFinger and well-known

Method Path Notes
GET /.well-known/names Same as /api/registry.
GET /.well-known/names/:name Same as /api/name/:name.
GET /.well-known/webfinger?resource=acct:name@domain RFC 7033. domain MUST equal ARCHON_HERALD_DOMAIN (when set). Returns a JRD with subject, aliases: [<DID>], and links. The https://w3id.org/did link href is built as https://${SERVICE_DOMAIN}/api/v1/did/${did} — a hardcoded externally-resolvable DID URL that is not served by Herald or Drawbridge directly.
GET /.well-known/openid-configuration OIDC discovery; advertises /oauth/authorize, /oauth/token, /oauth/userinfo and code_challenge_methods_supported: ['S256']. The root discovery payload does NOT include jwks_uri; only the /oauth/.well-known/openid-configuration variant advertises the JWKS endpoint.

2.8 OAuth 2.0 / OIDC (/oauth)

Method Path Notes
GET /oauth/authorize Authorization Code flow, with optional PKCE (see below). Triggers Herald login if the user isn’t authenticated, then redirects with ?code=<authcode> to the registered redirect_uri.
POST /oauth/callback Internal — completes the authorization code exchange started by /oauth/authorize.
GET /oauth/poll Polling endpoint for desktop / native flows.
POST /oauth/token Exchange an authorization code (plus code_verifier when the code was issued with a PKCE challenge) for an access_token + id_token. Only grant_type=authorization_code is supported; there are no refresh tokens. Form-encoded body.
GET /oauth/userinfo Bearer-token-protected. Returns { sub, name, preferred_username, picture, email, email_verified, updated_at }. The /oauth/.well-known/openid-configuration discovery payload advertises scopes_supported: ['openid','profile','email'] and claims_supported: ['sub','name','preferred_username','picture','email','email_verified'].
GET /oauth/.well-known/jwks.json The Herald’s ES256 public signing key.
POST /oauth/clients Internal client registration — present in the reference but locked down by deployment policy.

PKCE (RFC 7636). Both discovery documents advertise code_challenge_methods_supported: ['S256']. A client that sends code_challenge must also send code_challenge_method=S256; plain, a missing method, a method without a challenge, or a challenge that is not a 43-character base64url SHA-256 is rejected with 400 invalid_request before any challenge DID is created. A code issued with a challenge is exchanged only with the matching code_verifier. A code_verifier sent for a code issued without a challenge is refused, since it means the challenge was stripped from the authorization request (RFC 9700 §2.1.1). Either failure returns 400 invalid_grant and invalidates the code. PKCE is optional for registered clients, which authenticate with a client secret; clients that do not send a challenge are unaffected.

ID tokens are signed with ES256. The signing keypair is generated on first startup and persisted at ${ARCHON_HERALD_DATA_DIR}/oauth-signing-key.json (as a JSON-encoded private JWK with kid). kid defaults to archon-social-signing-key-1. Implementations MUST persist the key — replacing it prevents verification of earlier ID tokens against the new JWKS. Reload the private JWK with extractable: true so the public JWKS can be rebuilt; a non-extractable import fails at export and triggers key replacement. Test a fresh OAuth instance against the persisted key and verify an earlier ID token, rather than checking only that a key file exists. Opaque access tokens and authorization codes remain in memory and do not survive restart.

2.8a Personal Agent Protocol Company (/poppy, opt-in)

With ARCHON_HERALD_POPPY_ENABLED=true, Herald acts as a Company under the Personal Agent Protocol (Poppy) at version 0.4, the 1.0 release candidate; poppy.json advertises protocol_version: "0.4". Personal agents discover it, sign Users in with their Archon wallet, and use an OpenAPI interface. The issuer is ${ARCHON_DRAWBRIDGE_PUBLIC_HOST}/names/poppy, separate from the OIDC issuer at /names, so Poppy’s metadata cannot change what OIDC relying parties do. The public host must be HTTPS. Design notes are in docs/plans/poppy-1395.md and docs/plans/poppy-0.4-1609.md.

Sign-in is plain OAuth and knows no Session. Each API request names its Session in a Poppy-Session header, a JWT the agent signs for that one request with a delegated key; a signed-in request also carries an access token.

Method Path Notes
GET /.well-known/poppy.json Discovery document: organization name (ARCHON_HERALD_DOMAIN) and domain (the public host), the scopes with their descriptions and hints, the OpenAPI interface.
GET /.well-known/oauth-protected-resource RFC 9728 metadata for the domain, which is how an agent finds the issuer: resource is https://<domain> and authorization_servers lists the Poppy issuer only.
GET /.well-known/oauth-authorization-server/names/poppy RFC 8414 metadata. protected_resources lists the domain, grant_types_supported says which sign-in types are offered, and dpop_signing_alg_values_supported is ['ES256','RS256'].
POST /poppy/token authorization_code, refresh_token and device_code grants. Every request carries a private_key_jwt client assertion (ES256, PS384 or RS256) and a DPoP proof. A sign-in returns an access token and a refresh token; a refresh returns an access token, for fewer scopes if asked. Access tokens are DPoP-bound.
POST /poppy/revoke RFC 7009 revocation of a refresh token by the client it was issued to. Access tokens issued under it stop working at once.
GET /poppy/authorize Direct Sign-In consent page (PKCE S256 only). The User signs in by answering a wallet challenge, then chooses which scopes to grant. A redirect_uri must be one the agent lists; a loopback one (http://127.0.0.1/... or http://[::1]/...) matches on any port.
POST /poppy/device_authorization, GET/POST /poppy/device Device Sign-In: codes for the agent, and the page where the User enters the user code before the same wallet sign-in and consent.
POST /poppy/signin/response The wallet posts its challenge response here.
GET /poppy/openapi.json OpenAPI 3.1 description of /poppy/api.
GET /poppy/api/names/{name}, /members/{name}, /dids/{did}, /directory Lookups, answered signed out. /dids accepts DIDs only, never wallet aliases.
GET /poppy/api/account, /account/credential The signed-in User’s profile and membership credential (profile:read).
PUT/DELETE /poppy/api/account/name Claim, change or release the User’s name, with the same rules as PUT /api/name (name:write).
GET/DELETE /api/poppy/connections[/:id] Session-authenticated account settings: one entry per agent connected to the signed-in DID; disconnecting one revokes all of that agent’s refresh tokens for the account.

Every /poppy/api request must carry Poppy-Session and Poppy-Version. API errors:

Status Error When
400 version_unsupported Poppy-Version is missing or is not 0.4.
400 invalid_session The Session header is missing or fails verification, or the agent’s metadata cannot be loaded.
400 session_ended The access token is for a different account than the Session used before. The agent starts a new Session.
401 none The request needs the account and carries no access token. WWW-Authenticate names the scope.
401 invalid_token, invalid_dpop_proof The access token is unknown, expired or revoked, or its DPoP proof does not match.
403 insufficient_scope The access token lacks the scope WWW-Authenticate names.
429 none A limit was met. Retry-After says how long to wait.

Agent client metadata and key sets are fetched without redirects through the destination-validating public HTTPS transport, limited to 100 KB and five seconds, cached for one minute to one day, and refetched for an unknown kid at most once per 30 seconds. Verifying a Session header loads the agent it names before anything about the request is authenticated, so an agent not seen before spends the same budget there as at the token endpoint. Client assertions must name the issuer as a single-string aud and carry a unique jti. A Session JWT must be signed by a key that a delegation of at most 24 hours vouches for, name the issuer as its aud, match the request’s method and URL, be no more than a minute old, cover the access token when there is one, and be used once. Session JWTs and DPoP proofs are checked against the public URL built from ARCHON_DRAWBRIDGE_PUBLIC_HOST, not the Host header. Access tokens last one hour, refresh tokens 90 days. One-way transitions (binding a Session to its DID, answering a sign-in, consuming a device approval, touching a grant a revocation may have deleted) are single atomic Redis operations, so concurrent requests cannot both win. Per-address limits are Drawbridge’s, since Herald cannot trust forwarded addresses. Herald’s own limits are keyed on what an attacker cannot rotate for free (the verified client_id, the Session, or the agent domain a sign-in page is for: 60 pages a minute each), and its global caps (new agents, failed user codes, sign-in pages) equal Drawbridge’s global allowance of 1200 a minute, so no single source can exhaust them for others. Only failed user codes are counted. The wallet challenge carries a description naming the agent, its domain, the access requested and, for Device Sign-In, the user code; wallets show it with the destination, so a challenge forwarded from someone else’s sign-in page is recognizable. The consent page renders its QR code as inline SVG and loads no third-party script. A Session uses at most one DID, and each API request checks that the access token’s grant still exists, so revocation and disconnection take effect at once. State lives in Redis (ARCHON_HERALD_REDIS_URL or ARCHON_REDIS_URL) under the <ARCHON_HERALD_NAME>:poppy prefix; secrets are stored only as SHA-256 hashes. Drawbridge redacts Poppy-Session from its request logs along with access tokens and DPoP proofs. Mediated Sign-In, conversations, browser join and an MCP interface (#1404) are not offered.

Herald served draft 0.2 before. A grant issued then still works as a refresh token, and its poppy:read and poppy:write scopes are read as profile:read and name:write. Nothing else of 0.2 is served: an agent on 0.2 gets version_unsupported.

2.9 Admin (owner-only)

Method Path Notes
GET /api/admin Owner. Admin dashboard payload.
POST /api/admin/publish Owner. Publishes the current registry to IPNS. Returns { ok, cid, ipns, registry }.
DELETE /api/admin/user/:did Owner. Removes the user record + revokes their credential.

The owner is the single DID in ARCHON_HERALD_OWNER_DID. There is no finer-grained role system.

2.10 Bypass & CORS

2.11 Error envelope

Error responses are a mix of formats: most route handlers return application/json { "error": "<message>" } (or { ok: false, message } for name-claim validation errors), but the isAuthenticated middleware sends 401 with the plain-text body You need to log in first, the owner middleware sends 403 with plain-text Owner access required, and many 500 handlers fall back to res.status(500).send(String(error)) (plain text). Login endpoints return { authenticated: false } on a non-match (200, not 401) so the wallet can poll cleanly. LUD-16 errors return { status: "ERROR", reason } per the LUD-06 spec rather than HTTP error codes.


3. Authentication model

3.1 Session auth (browser)

  1. Frontend calls GET /api/challenge. Herald creates a Keymaster challenge, stores it on the session, returns { challenge, challengeURL }.
  2. Frontend renders challengeURL as a QR (or deep link). The user scans into their Archon wallet.
  3. Wallet calls keymaster.createResponse(challenge) and POSTs the resulting DID back to /api/login.
  4. Herald calls keymaster.verifyResponse(response, { retries: 10 }). On match, sets session.user = { did: verify.responder }.
  5. Subsequent calls use the session cookie. session.user.did is the authenticated identity. session.user.did === ARCHON_HERALD_OWNER_DID grants admin scope.

3.2 Bearer auth (programmatic)

For tools that don’t want sessions, send the verifiable challenge response as a Bearer token. The token value is the DID of a response asset produced by keymaster.createResponse(challenge) — Herald passes the entire bearer value to keymaster.verifyResponse(<token>) without any did:cid: prefix validation:

Authorization: Bearer <responseDid>

Herald calls keymaster.verifyResponse(<token>) on every request (no caching). Used by /api/name PUT/DELETE. The response DID is single-use server-side caching is not part of the spec — clients that expect to make many calls SHOULD cache the response DID until it expires.

3.3 OAuth bearer

Access tokens issued by /oauth/token are random opaque strings backed by an in-memory map (or persistent store in production). ID tokens are ES256 JWTs. Both expire per the standard expires_in field returned in the token response (default 3600 s).


4. Keymaster binding

Herald operates in one of two mutually-exclusive modes; the boot sequence picks based on env:

4.1 Shared keymaster (HTTP client)

Set ARCHON_HERALD_KEYMASTER_URL to the Keymaster’s URL. Herald constructs a KeymasterClient and calls Keymaster’s HTTP API for every wallet operation (challenge, response verification, asset creation, credential issuance / revocation).

This is the recommended deployment mode in a multi-service stack.

4.2 Standalone wallet (in-process)

Leave ARCHON_HERALD_KEYMASTER_URL empty and set ARCHON_HERALD_WALLET_PASSPHRASE. Herald instantiates a Keymaster object backed by a JSON wallet file at ${ARCHON_HERALD_DATA_DIR}/wallet.json and a Gatekeeper HTTP client at ARCHON_GATEKEEPER_URL. The passphrase decrypts the wallet in-process (see Keymaster spec §3.1).

This mode is suitable for single-purpose Herald deployments that don’t need the full Keymaster service surface.

4.3 Service identity

On startup Herald ensures a Keymaster ID exists with the name ARCHON_HERALD_NAME (default herald). If the wallet doesn’t have it, Herald creates it (keymaster.createId(name)). The resulting DID is the Herald’s “service identity” — it owns every issued credential.

Herald also calls keymaster.setCurrentId(<service name>) at every credential issue / revoke to ensure the operation is signed by the right identity, and restores the previous current ID on completion where possible.


5. Name validation and lifecycle

5.1 Validation rules

5.2 Credential issuance

When PUT /api/name (or /api/profile/:did/name) succeeds:

  1. Herald sets the current ID to the service identity.
  2. If the user already has a credentialDid (renaming):
    • Fetch the existing VC.
    • Update credentialSubject.name to <newName>@<serviceDomain>.
    • Set validFrom = now.
    • keymaster.updateCredential(credentialDid, vc).
  3. Otherwise (first claim):
    • boundCredential = keymaster.bindCredential(<userDid>, { schema: ARCHON_HERALD_MEMBERSHIP_SCHEMA_DID, validFrom: now, claims: { name: "<name>@<serviceDomain>" } }).
    • credentialDid = keymaster.issueCredential(boundCredential).
    • Persist { credentialDid, credentialIssuedAt } on the user record.

5.3 Credential revocation

On DELETE /api/name or rename-displacement:

keymaster.revokeCredential(credentialDid)
delete user.name; delete user.credentialDid; delete user.credentialIssuedAt

Failures during revokeCredential are logged but don’t roll back the local user-record update. Revoking is idempotent on the Keymaster side.

5.4 Default schema

If ARCHON_HERALD_MEMBERSHIP_SCHEMA_DID is unset, Herald falls back to did:cid:bagaaieravnv5onsflewvrz6urhwfjixfnwq7bgc3ejhlrj2nekx75ddhdupq, a published schema for { name: string }. Operators MAY substitute their own schema DID; the credential’s credentialSchema.id is whatever was passed.


6. Storage backends

User database backs User records keyed by DID. Three implementations:

Backend Path Selector
JSON file ${ARCHON_HERALD_DATA_DIR}/db.json ARCHON_HERALD_DB=json (default)
SQLite ${ARCHON_HERALD_DATA_DIR}/db.sqlite ARCHON_HERALD_DB=sqlite
Redis namespace ${ARCHON_HERALD_NAME}: ARCHON_HERALD_DB=redis

User shape:

{
  "firstLogin":  "<RFC 3339>",
  "lastLogin":   "<RFC 3339>",
  "logins":      <int>,
  "name":        "<lowercase ASCII>",
  "credentialDid":      "<DID>",
  "credentialIssuedAt": "<RFC 3339>",
  // arbitrary additional fields are allowed; readers MUST tolerate them
}

Every backend implements:

interface DatabaseInterface {
  init?(): Promise<void>;
  close?(): Promise<void>;
  getUser(did: string): Promise<User | null>;
  setUser(did: string, user: User): Promise<void>;
  deleteUser(did: string): Promise<boolean>;
  listUsers(): Promise<Record<string, User>>;
  findDidByName(name: string): Promise<string | null>;

  // Email bridge
  setReplyToken(token: string, data: ReplyToken): Promise<void>;
  getReplyToken(token: string): Promise<ReplyToken | null>;
  deleteExpiredReplyTokens(maxAgeMs: number): Promise<number>;
  setEmailMapping(dmailDid: string, mapping: EmailMapping): Promise<void>;
  getEmailMapping(dmailDid: string): Promise<EmailMapping | null>;
}

findDidByName is a case-insensitive lookup; implementations MAY normalize to lowercase at index time. Concurrency: writes MUST be atomic from the point of view of findDidByName — uniqueness checks are a load-modify-save pattern that needs serialization (the JSON backend uses an async-promise lock per AbstractBase).


7. IPNS publication

POST /api/admin/publish (owner-only) builds the registry, pins it to IPFS via ${ARCHON_HERALD_IPFS_API_URL} (default http://localhost:5001/api/v0), and updates the IPNS record under the key ARCHON_HERALD_IPNS_KEY_NAME (default ARCHON_HERALD_NAME).

The IPNS key is created on startup if missing. The published JSON is identical to /directory.json — clients can fetch it via any IPFS gateway at ipns://<key-id>/.


8. Lifecycle and configuration

8.1 Startup

  1. Validate ARCHON_HERALD_SESSION_SECRET is set and not a placeholder.
  2. Bind HTTP listener.
  3. Initialize the database backend.
  4. Construct Keymaster (shared HTTP client or in-process, see §4).
  5. initServiceIdentity() — ensure the service ID exists; log the service DID.
  6. ensureIpnsKeyExists() — generate the IPNS key if missing.
  7. Mount OAuth router at /oauth.

8.2 Environment variables

Variable Default Meaning
ARCHON_HERALD_PORT 4230 HTTP listen port.
ARCHON_HERALD_NAME herald Service identity name (Keymaster ID). Owns issued credentials.
ARCHON_HERALD_DOMAIN empty Domain for credential subjects (<name>@<domain>) and WebFinger validation.
ARCHON_HERALD_DB json json / sqlite / redis.
ARCHON_HERALD_DATA_DIR /app/server/data Filesystem root for JSON / SQLite / OAuth signing key.
ARCHON_HERALD_SESSION_SECRET unset (required) Secret for Express sessions. MUST NOT be a placeholder string.
ARCHON_HERALD_OWNER_DID empty Single owner DID with admin scope.
ARCHON_HERALD_KEYMASTER_URL empty When set, runs in shared mode.
ARCHON_HERALD_WALLET_PASSPHRASE empty Required for standalone mode; ignored in shared mode.
ARCHON_HERALD_WALLET_URL https://wallet.archon.technology URL embedded in challengeURL so wallets know where to load.
ARCHON_HERALD_IPFS_API_URL http://localhost:5001/api/v0 Kubo HTTP API for IPNS publication.
ARCHON_HERALD_IPNS_KEY_NAME herald (the value of ARCHON_HERALD_NAME) IPNS key name.
ARCHON_HERALD_MEMBERSHIP_SCHEMA_DID did:cid:bagaaieravnv5o... Schema DID for issued membership credentials.
ARCHON_HERALD_TOR_PROXY empty SOCKS5 proxy host:port for .onion Lightning lookups.
ARCHON_HERALD_JWT_KEY_PATH ${DATA_DIR}/oauth-signing-key.json Persisted ES256 OAuth signing key.
ARCHON_GATEKEEPER_URL http://localhost:4224 Used in standalone mode.
ARCHON_DRAWBRIDGE_PORT 4222 Used to compute PUBLIC_URL.
ARCHON_DRAWBRIDGE_PUBLIC_HOST http://localhost:${DRAWBRIDGE_PORT} External canonical URL of the Drawbridge that fronts this Herald; used to build PUBLIC_URL = <host>/names.
ARCHON_ADMIN_API_KEY (or ARCHON_HERALD_ADMIN_API_KEY) empty Used by the Keymaster client when in shared mode.
ARCHON_HERALD_POPPY_ENABLED false Serves the Personal Agent Protocol Company endpoints (§2.8a).
ARCHON_HERALD_POPPY_STORE redis redis, or memory for single-process development (state is lost on restart).
ARCHON_HERALD_REDIS_URL (or ARCHON_REDIS_URL) redis://localhost:6379 Redis for Poppy state and the redis database backend.

8.3 Public URL convention

PUBLIC_URL = ${ARCHON_DRAWBRIDGE_PUBLIC_HOST}/names — used in:

Drawbridge proxies /names/* → Herald’s /api/*, so external callers hit https://your-domain.example/names/api/login etc.

8.4 Shutdown

No SIGTERM / SIGINT handler — those signals terminate the Express server directly. Herald does install process.on('uncaughtException') and process.on('unhandledRejection') handlers that log the error and let the process continue. The OAuth signing key and IPNS key persist on disk.


9. Logging conventions

morgan('dev') for HTTP requests; otherwise console.log / console.error. No structured logger by default. Notable startup lines:


10. Reference implementation and tests

Validation: end-to-end against a running Herald + Drawbridge stack. There is no dedicated unit test suite; the React frontend at apps/herald-client/ and the scripts/ directory exercise the contract.

A conformant third implementation MUST: