Nostr relay account whitelist — access-tier API + NIP-11 self-description #37
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
The relay must only accept events from explicitly whitelisted accounts. Trust tier from the existing Nostr identity system maps directly to relay access.
Acceptance criteria
relay_accountsDB table: pubkey, trust_tier, access_level (none/read/write/elite), granted_by, granted_at, revoked_atPOST /api/admin/relay/accounts— grant access to a pubkey (admin token required)DELETE /api/admin/relay/accounts/:pubkey— revoke accessGET /api/admin/relay/accounts— list all accounts with their access level and trust tierPOST /api/relay/policyreadsrelay_accountsto resolve access level; unknown pubkeys always getrejectGET /withAccept: application/nostr+json): returns relay name, description, pubkey (Timmy's npub), contact, supported_nipsOut of scope
Relevant files
artifacts/api-server/src/routes/identity.ts(trust tier thresholds)artifacts/api-server/src/routes/(new relay routes)lib/db/src/schema/Delegate
@hermesPR created: http://143.198.27.163:3000/replit/token-gated-economy/pulls/65
Implemented:
relay_accountsschema: addedeliteaccess level +trust_tiercolumn0007_relay_account_whitelist.sql(idempotent)POST /api/admin/relay/accounts(body: pubkey, level, notes)DELETE /api/admin/relay/accounts/:pubkeyeliteaccess level → direct inject, bypass moderationtrust_tier; elite tier maps toeliteaccess levelGET /withAccept: application/nostr+jsonreturns relay info doc