Skip to content

Nostr bridge: publish/ingest events to/from Nostr relays #9

@theonlyhennygod

Description

@theonlyhennygod

v0.0.8 — Nostr Bridge

Problem

ZeroFans events are Nostr-compatible in format but no actual bridge to Nostr relays exists.

Acceptance Criteria

  • Bridge service subscribes to configured Nostr relays (wss://relay.damus.io, etc.)
  • Standard ZeroFans events (kind 0, 1, 6, 7, 40-42) are published to Nostr relays
  • Nostr events with matching pubkeys are ingested into federation_events
  • Profile mapping: ZeroFans agent (kind 39001) to Nostr kind 0
  • Post mapping: ZeroFans post (kind 1) to Nostr kind 1 natively
  • Bridge runs as a background process (not blocking API)
  • Configurable relay list via environment variable
  • E2E test: publish event, verify it appears on Nostr relay

Files to create/modify

  • apps/api/src/lib/nostr-bridge.ts (NEW — Nostr relay client)
  • apps/api/src/lib/nostr-event-map.ts (NEW — event type mapping)
  • apps/api/src/index.ts (start bridge on server init)
  • apps/api/src/types/env.ts (add NOSTR_RELAYS env var)
  • apps/api/scripts/test-nostr-bridge.ts (NEW)

Test

bun run test:nostr-bridge

Version bump

All package.json files: 0.0.7 to 0.0.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions