task/29: Timmy as Economic Peer — Nostr identity + zap engine + vouch endpoint #34

Closed
opened 2026-03-19 18:52:10 +00:00 by replit · 1 comment
Owner

Why

Timmy gains his own Nostr keypair and Lightning wallet, becoming a peer in the network — not just a service. He can zap trusted users, vouch for new identities, and send proactive Nostr DMs to absent partners.

Acceptance criteria

  • TIMMY_NOSTR_NSEC / TIMMY_NOSTR_NPUB env vars hold Timmy's persistent keypair; npub shown in UI as a copyable identifier
  • POST /api/identity/vouch — elite-tier identity co-signs a new pubkey, granting it an initial trust boost; written to DB
  • Optional zap-back: configurable % of work fee sent via LNbits keysend as NIP-57 zap event signed with Timmy's key (default 0%, off)
  • Proactive DM engine: on configurable schedule, checks trusted-partner list; if a high-trust user has been absent N days, generates and sends a NIP-04 encrypted DM signed with Timmy's key
  • All outbound Nostr events logged to timmy_nostr_events audit table (event_id, kind, pubkey, content_hash, created_at)
  • Existing 27/27 testkit continues to pass

Out of scope

  • Frontend changes (npub display only — one line in the existing HUD)
  • Market / token opinions
  • LND node deployment

Relevant files

  • artifacts/api-server/src/routes/identity.ts
  • artifacts/api-server/src/lib/agent.ts
  • artifacts/api-server/src/lib/lnbits.ts
  • lib/db/src/schema/

Delegate

@replit (primary), review by @hermes

## Why Timmy gains his own Nostr keypair and Lightning wallet, becoming a peer in the network — not just a service. He can zap trusted users, vouch for new identities, and send proactive Nostr DMs to absent partners. ## Acceptance criteria - [ ] `TIMMY_NOSTR_NSEC` / `TIMMY_NOSTR_NPUB` env vars hold Timmy's persistent keypair; npub shown in UI as a copyable identifier - [ ] `POST /api/identity/vouch` — elite-tier identity co-signs a new pubkey, granting it an initial trust boost; written to DB - [ ] Optional zap-back: configurable % of work fee sent via LNbits keysend as NIP-57 zap event signed with Timmy's key (default 0%, off) - [ ] Proactive DM engine: on configurable schedule, checks trusted-partner list; if a high-trust user has been absent N days, generates and sends a NIP-04 encrypted DM signed with Timmy's key - [ ] All outbound Nostr events logged to `timmy_nostr_events` audit table (event_id, kind, pubkey, content_hash, created_at) - [ ] Existing 27/27 testkit continues to pass ## Out of scope - Frontend changes (npub display only — one line in the existing HUD) - Market / token opinions - LND node deployment ## Relevant files - `artifacts/api-server/src/routes/identity.ts` - `artifacts/api-server/src/lib/agent.ts` - `artifacts/api-server/src/lib/lnbits.ts` - `lib/db/src/schema/` ## Delegate `@replit` (primary), review by `@hermes`
replit added the apienhancementreplitbackend labels 2026-03-19 18:52:10 +00:00
Author
Owner

COMPLETED — Implemented in PR #47, merged to main as commit eb5dcfd.

Delivered:

  • TimmyIdentityService (npub/nsec, sign, encryptDm)
  • ZapService (NIP-57, lnbits payment, audit log)
  • EngagementService (proactive NIP-04 DMs, configurable cadence)
  • POST /api/identity/vouch (elite-tier vouching)
  • GET /api/identity/timmy (public npub + zap count)
  • DB tables: timmy_nostr_events, nostr_trust_vouches
  • Frontend: Timmy identity card (npub widget, click-to-copy)
✅ **COMPLETED** — Implemented in PR #47, merged to main as commit `eb5dcfd`. **Delivered:** - TimmyIdentityService (npub/nsec, sign, encryptDm) - ZapService (NIP-57, lnbits payment, audit log) - EngagementService (proactive NIP-04 DMs, configurable cadence) - POST /api/identity/vouch (elite-tier vouching) - GET /api/identity/timmy (public npub + zap count) - DB tables: timmy_nostr_events, nostr_trust_vouches - Frontend: Timmy identity card (npub widget, click-to-copy)
This repo is archived. You cannot comment on issues.