Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

feat(nip77): NEG-OPEN/NEG-MSG/NEG-CLOSE wire protocol for the PostgreSQL backend

Abierto
#817 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@Priyanshubhartistm ya está trabajando en esto.

Desde el 12/10/2026.

  • #818 de @Priyanshubhartistm — abierto

Evaluación

Este issue todavía no se ha evaluado.

Descripción

enhancement

Is your feature request related to a problem? Please describe.
The negentropy reconciliation core and the sorted event id query landed in #809 (issue #801), but nothing calls them yet, so relays still cannot answer NIP-77 sync requests. Clients and relay-to-relay syncers keep catching up with wide REQ filters and receive every matching event.

Describe the solution you'd like
Expose the core over the websocket as described in NIP-77, for the PostgreSQL event store only:

  • Parse and validate NEG-OPEN (subscription id, a single filter, hex initial message), NEG-MSG and NEG-CLOSE, and send NEG-MSG and NEG-ERR replies. NEG-OPEN for an id that is already open closes the old session first, and ids live in a separate namespace from REQ ids.
  • Keep per-connection session state and free it on NEG-CLOSE, NEG-ERR, idle timeout and disconnect.
  • Bound resource use, since each session holds the whole matching (created_at, id) set in memory: a maximum number of events per session (rejected with NEG-ERR blocked:), a maximum number of concurrent sessions per connection, and an idle timeout (NEG-ERR closed:).
  • Apply the same NIP-42 restricted-kind checks and filter limits that COUNT applies.
  • Add a nip77 settings section with enabled (default false, so merging this changes nothing for existing relays) and the limits above, documented in CONFIGURATION.md. The feature only responds when nip77.enabled is true and eventStore.backend is postgres, so it stays out of the way of alternative backends that implement negentropy themselves.
  • Remove the temporary .knip.json ignore entry added with the core.
  • Tests for message validation, session lifecycle, limits, and a full client-to-relay reconciliation over the handlers.

Out of scope, tracked separately: advertising NIP-77 in NIP-11 supported_nips, and the admin console settings schema.

Additional context

Lenguaje dominante
TypeScript
Estrellas
829
Forks
234
Merge medio
2 d 10 h
PR fusionados (30 d)
24

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de cameri/nostream

Todos los issues de cameri/nostream

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.