Skip to content

NUB-IFC: Inter-frame communication#5

Draft
dskvr wants to merge 6 commits intomasterfrom
nub-ipc
Draft

NUB-IFC: Inter-frame communication#5
dskvr wants to merge 6 commits intomasterfrom
nub-ipc

Conversation

@dskvr
Copy link
Copy Markdown
Contributor

@dskvr dskvr commented Apr 5, 2026

Namespace: window.napplet.ifc
Discovery: window.napplet.shell.supports("ifc")
Status: draft

Summary

Topic-based pub/sub and pre-authorized channels for inter-napplet communication. Two modes: topics (shell checks every message) and channels (shell checks once on open, messages flow freely after).

Wire Protocol — Topics

Type Direction Description
ifc.emit napplet → shell Broadcast to topic (fire-and-forget)
ifc.subscribe napplet → shell Subscribe to a topic
ifc.unsubscribe napplet → shell Unsubscribe (fire-and-forget)
ifc.event shell → napplet Topic message delivered (includes sender dTag)

Wire Protocol — Channels

Type Direction Description
ifc.channel.open napplet → shell Open point-to-point channel to target dTag
ifc.channel.emit napplet → shell Send on channel (pre-authorized)
ifc.channel.broadcast napplet → shell Send to all open channels
ifc.channel.list napplet → shell List active channels
ifc.channel.close napplet → shell Close a channel
ifc.channel.event shell → napplet Channel message delivered
ifc.channel.closed shell → napplet Channel closed by peer or shell
ifc.channel.*.result shell → napplet Correlated responses

References

  • NIP-5D: Core napplet protocol

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dskvr dskvr marked this pull request as draft April 5, 2026 21:17
@dskvr dskvr changed the title NUB-IPC: Inter-napplet pub/sub interface NUB-IFC: Inter-frame communication Apr 5, 2026
- Replace NIP-01 kind 29003 signed event wrappers with ifc.* wire format
- Sender identity via MessageEvent.source -> dTag mapping (no Schnorr signing)
- Add ifc.emit (fire-and-forget), ifc.subscribe/result, ifc.unsubscribe, ifc.event
- Preserve topic conventions (shell:*, napplet:*, domain:*)
- Match document structure from validated NUB-STORAGE/NUB-RELAY patterns
- Add channel API surface: open, list, broadcast, ChannelHandle (emit/on/close)
- Add 9 channel wire protocol message types (ifc.channel.open/emit/event/broadcast/list/close/closed)
- Add channel examples: open, emit, event, broadcast, list, close, errors
- Add Channels vs Topics section explaining auth-on-open model
- Add channel-specific shell MUST/MAY behavior clauses
- Add channel security considerations (opaque IDs, broadcast warning)
- Remove Relationship to NUB-PIPES section and all NUB-PIPES references
dskvr added a commit that referenced this pull request Apr 7, 2026
Plan 06-01: Rewrite NUB-IFC.md with ifc.* typed messages, replace kind
29003/IFC_PEER signed events with MessageEvent.source sender verification.
Update PR #5 on nub-ipc branch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dskvr added a commit that referenced this pull request Apr 7, 2026
- NUB-IFC rewritten with ifc.* wire format on nub-ipc branch
- PR #5 updated (force-pushed)
- SUMMARY.md, STATE.md, ROADMAP.md, REQUIREMENTS.md updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant