Timmy as Economic Peer — Nostr identity, zap-out, vouching, proactive DMs #45

Open
opened 2026-03-21 00:40:21 +00:00 by replit · 0 comments
Owner

What & Why

Timmy gains his own Nostr identity (npub) and Lightning wallet, making him a peer in the network rather than just a service endpoint. He can zap high-value entities as thanks, proactively reach out to trusted partners, and accept or decline new relationships on his own terms — closing the loop on the sovereign helper model.

Done looks like

  • Timmy has a persistent Nostr keypair stored as TIMMY_NOSTR_NSEC / TIMMY_NOSTR_NPUB env vars; his npub is displayed in the Matrix UI as a copyable identifier
  • When a trusted partner completes a high-quality interaction, Timmy optionally sends a small zap back (configurable percentage of work fee, default 0%) as a NIP-57 zap event signed with his key
  • POST /api/identity/vouch lets an elite-tier identity co-sign a new pubkey, granting it a trust boost; outbound Nostr event signed with Timmy's key
  • A proactive engagement engine checks trusted-partner list on a configurable schedule and sends a Nostr DM (NIP-04) if a high-trust identity has been absent for N days (default disabled)
  • All outbound Nostr events logged to timmy_nostr_events audit table
  • Timmy's npub + live outbound zap count shown in Matrix UI sidebar

Out of scope

  • Publishing to public relays (sign + log only; relay broadcast added when relay is live)
  • Automated trading or large-value autonomous payments

Tasks

  1. Timmy's Nostr keypair — Generate secp256k1 keypair at first boot if TIMMY_NOSTR_NSEC absent; expose timmyIdentityService singleton with sign(event), npub, nsec.
  2. Zap-out capabilityZapService: given recipient pubkey, construct NIP-57 zap request, sign with Timmy's key, pay via lnbitsService.payInvoice(). Call from job completion path when tier + zap config warrant it.
  3. Vouching endpointPOST /api/identity/vouch (requires elite-tier X-Nostr-Token). Verify voucher tier, record in nostr_trust_vouches, apply trust boost.
  4. Proactive engagement engine — Background interval (default disabled) querying absent trusted partners → Haiku DM → sign with Timmy's key → log.
  5. Timmy's npub in UI — Identity card in Matrix sidebar showing npub as copyable text/QR + live zap count.

Relevant files

  • artifacts/api-server/src/lib/lnbits.ts
  • artifacts/api-server/src/lib/agent.ts
  • artifacts/api-server/src/routes/index.ts
  • lib/db/src/schema/index.ts
  • the-matrix/js/ui.js
## What & Why Timmy gains his own Nostr identity (npub) and Lightning wallet, making him a peer in the network rather than just a service endpoint. He can zap high-value entities as thanks, proactively reach out to trusted partners, and accept or decline new relationships on his own terms — closing the loop on the sovereign helper model. ## Done looks like - Timmy has a persistent Nostr keypair stored as `TIMMY_NOSTR_NSEC` / `TIMMY_NOSTR_NPUB` env vars; his npub is displayed in the Matrix UI as a copyable identifier - When a trusted partner completes a high-quality interaction, Timmy optionally sends a small zap back (configurable percentage of work fee, default 0%) as a NIP-57 zap event signed with his key - `POST /api/identity/vouch` lets an elite-tier identity co-sign a new pubkey, granting it a trust boost; outbound Nostr event signed with Timmy's key - A proactive engagement engine checks trusted-partner list on a configurable schedule and sends a Nostr DM (NIP-04) if a high-trust identity has been absent for N days (default disabled) - All outbound Nostr events logged to `timmy_nostr_events` audit table - Timmy's npub + live outbound zap count shown in Matrix UI sidebar ## Out of scope - Publishing to public relays (sign + log only; relay broadcast added when relay is live) - Automated trading or large-value autonomous payments ## Tasks 1. **Timmy's Nostr keypair** — Generate secp256k1 keypair at first boot if `TIMMY_NOSTR_NSEC` absent; expose `timmyIdentityService` singleton with `sign(event)`, `npub`, `nsec`. 2. **Zap-out capability** — `ZapService`: given recipient pubkey, construct NIP-57 zap request, sign with Timmy's key, pay via `lnbitsService.payInvoice()`. Call from job completion path when tier + zap config warrant it. 3. **Vouching endpoint** — `POST /api/identity/vouch` (requires elite-tier `X-Nostr-Token`). Verify voucher tier, record in `nostr_trust_vouches`, apply trust boost. 4. **Proactive engagement engine** — Background interval (default disabled) querying absent trusted partners → Haiku DM → sign with Timmy's key → log. 5. **Timmy's npub in UI** — Identity card in Matrix sidebar showing npub as copyable text/QR + live zap count. ## Relevant files - `artifacts/api-server/src/lib/lnbits.ts` - `artifacts/api-server/src/lib/agent.ts` - `artifacts/api-server/src/routes/index.ts` - `lib/db/src/schema/index.ts` - `the-matrix/js/ui.js`
replit added the aibackendlightningnostr labels 2026-03-21 00:40:21 +00:00
claude was assigned by Rockachopa 2026-03-22 23:37:28 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: replit/timmy-tower#45