Skip to content

NAP-4: Note viewer open protocol - #28

Closed
dskvr wants to merge 4 commits into
masterfrom
note-viewer-open-nub
Closed

NAP-4: Note viewer open protocol#28
dskvr wants to merge 4 commits into
masterfrom
note-viewer-open-nub

Conversation

@dskvr

@dskvr dskvr commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds NAP-4, a small NAP-INC message protocol for opening a specific Nostr event or addressable event in a note viewer.

Why

Feed, profile, search, notification, and thread napplets all need to hand off "inspect this note/event" intent. Without a shared wire shape, each client invents a topic and payload, which makes note viewers hard to reuse across shells and napplets.

Spec / API Surface

  • Topic: note:open.
  • Required transport: NAP-INC.
  • Retrieval dependency: relay for consumers that fetch the referenced note.
  • Discovery: shell.supports("inc", "NAP-4").
  • Target shapes: event id targets and address targets, both with optional NIP-19 compatibility metadata.
  • Optional relay hints, source metadata, and behavior metadata.

Compatibility

Consumers that do not support NAP-4 ignore the message. Producers should check shell.supports("inc", "NAP-4") before relying on it. Structured target fields are canonical; NIP-19 strings are compatibility metadata.

Validation

Hyprgate v2.8 has draft helper types and parsing around the note-viewer protocol. Runtime support should only be advertised after the shell route is verified.

Non-goals

  • Reply, reaction, repost, or quote rendering semantics.
  • Window manager APIs.
  • Relay selection policy.
  • A mandatory viewer UI.

Follow-ups

  • Wire shell-level note:open routing and advertise inc:NAP-4 only after runtime verification.
  • Add conformance examples once another producer napplet emits the topic.

Changelog

  • bb06a8e - Introduced NAP-4 as the note-viewer open protocol.

@dskvr dskvr changed the title NUB-04: Note viewer open protocol NAP-04: Note viewer open protocol Jun 3, 2026
@dskvr dskvr changed the title NAP-04: Note viewer open protocol NAP-4: Note viewer open protocol Jun 12, 2026
@dskvr
dskvr marked this pull request as draft June 16, 2026 01:45
@dskvr

dskvr commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

needs support for NIP-19 encoded entities in addition to (or instead of) objects.

@dskvr dskvr added the DRAFT label Jun 17, 2026
Rebased onto current master; spec only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dskvr
dskvr force-pushed the note-viewer-open-nub branch from a571966 to bb06a8e Compare June 17, 2026 19:14
dskvr added 3 commits June 21, 2026 18:33
The note open payload and target union now use CDDL-style schema notation, and the INC transport example no longer carries TypeScript highlighting.

Constraint: Keep this branch scoped to NAP-4.
Confidence: high
Scope-risk: narrow
Tested: git diff --check
Tested: rg found no TypeScript code fences or declarations in naps/NAP-4.md
The note-open payload, source, behavior, and target shapes now use Markdown field tables instead of a CDDL-style block. The structured target requirements remain unchanged.

Constraint: PR #28 owns NAP-4; keep this change scoped to that spec file.

Confidence: high

Scope-risk: narrow

Tested: rg for cddl/typescript schema fences and type assignment patterns in NAP-4

Tested: git diff --check -- naps/NAP-4.md
Open NAP proposal branches need reader-visible changelogs that track semantic spec changes without recording formatting-only migrations.

Constraint: Changelog entries are one bullet per semantic commit-change.
Rejected: Include schema-table or formatting-only commits | they do not change the spec contract or boundary.
Confidence: high
Scope-risk: narrow
Directive: Keep future changelog entries semantic; omit changelog-only and formatting-only commits.
Tested: git diff --check
Not-tested: Rendered Markdown
@dskvr

dskvr commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Closing this because numbered NAPs are being removed from the registry. Cross-napplet payload shapes should converge as unnumbered conventions, without sequence assignment or shell.supports("<domain>", "NAP-N") negotiation.

Suggested alternative:

Use an unnumbered note-open convention advertised by note handlers instead of a numbered NAP.
Convention: note:open
Discovery: manifest `['archetype', '<slug>', 'note:open']` and `intent.available()` candidate `conventions`.

@dskvr dskvr closed this Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant