Spec and upstream
Flotilla needs nine changes outside its own code. Most of them are small additions to unmerged NAPs, and several cover behavior Flotilla can ship as shell policy before they merge.
| Target | Change | Needed by | If it isn't accepted | |
|---|---|---|---|---|
| P1 | napplet/naps convention | Kind archetypes: napplet:kind-<n>/<surface> for content surfaces, with a label per surface | M3 | Works as a Flotilla convention |
| P2 | New context NAP | context.get() returns the napplet's context as one string | M2 | Flotilla convention |
| P3 | NAP-OUTBOX | Shell policy may restrict publish targets, and the result reports what it refused | M2 | Refuse toOutbox in a space |
| P4 | NAP-RELAY, NAP-OUTBOX | Events may arrive without sig, and reposts go through the shell | M1 | Already allowed by NAP-RELAY's schema |
| P5 | NAP-STORAGE | Key shared storage by napplet address, partitioned by context | M2 | Flotilla keys it that way anyway |
| P6 | NIP-51 or new kind | An app list that pins napplet versions for a relay | M2 | Flotilla convention |
| P7 | napplet CLI, vite-plugin | Publish an author-signed snapshot with every deploy | M4 | Embed the signed manifest in the app list |
| P8 | NIP-5D | Support the open review items, and add a note about host pages | None | None |
| P9 | napplet org | Offer the host page package | None | Keep it in welshman |
P1. Kinds in intents#
The archetype names the kind, as kind-<n>, and the action names the surface. Every convention fits NAP-INTENT's required napplet:<archetype>/<action> form, so the standard SDK accepts it in both directions, and P1 needs no change to NAP-INTENT. P1 is a convention document in napplet/naps, written from its convention template.
| Convention | Surface | Payload |
|---|---|---|
napplet:kind-<n>/create | A form that creates one event | None |
napplet:kind-<n>/edit | A form that edits one event | id or address |
napplet:kind-<n>/view | A detail page | id or address |
napplet:kind-<n>/list | A list page | None |
napplet:kind-<n>/item | An item's content, inside a card the shell draws | id or address |
A manifest advertises the kind with a z tag and each surface with an i tag:
The convention also gives each surface a display label, since a napplet with several list surfaces needs a name for each menu section. The label is a tag that pairs a convention with its name, such as ["label", "napplet:kind-30818/list", "Wiki"].
Shells can register their native pages under the same conventions. A napplet that invokes napplet:kind-1068/view then reaches Flotilla's native poll page, and the same call reaches a polls napplet in a shell without native polls.
A pinned app's menu item comes from any parameterless napplet:<archetype>/open, which needs no convention.
P2. Context#
A context NAP tells a napplet which context it runs in, as one string: a relay URL, a NIP-29 group as <relay url>'<group id>, the naddr of a NIP-72 community, a NIP-17 conversation as its participants' pubkeys sorted and joined by commas, or an empty string for none. In Flotilla, a space gives its relay URL and a room gives url'h, the form makeRoomKey already uses.
A napplet that needs names or pictures asks for them through the domains it already has, such as the space's NIP-11 document or the room's kind 39000 metadata. The NAP defines no routing. How Flotilla serves requests inside a space or room is Flotilla's policy, described in the trust model.
P3. Outbox publish targets#
NAP-OUTBOX's publish sends to the user's NIP-65 write relays unless toOutbox is false, and it must report a failure when it can't reach a required target. P3 lets shell policy restrict the target set, including leaving out the user's write and inbox relays, and has the result report refused targets without failing the publish. Without P3, Flotilla has to fail every default publish from a space.
P4. Unsigned events#
NAP-RELAY's NostrEvent schema is an open map, but NAP-OUTBOX defines it as a signed NIP-01 event. P4 lets shells omit sig from events they deliver, keeps id, and says napplets must not require sig. Reposting embeds the signed event (NIP-18), so P4 also adds a shell-side repost by id, likely in the common NAP.
P5. Stable storage keys#
NAP-STORAGE scopes data by the verified manifest and artifact hash, so every update starts with empty storage. P5 keys shared storage by the napplet's address (kind, author and d tag) and adds the context from P2 to the partition. Integrity stays bound to the hash, which is the split proposed in the November NIP-5D review.
P6. App lists#
A relay's app list names the napplets installed there and the version each one is pinned to. The hosting backend has the relay sign it with its own key, as NIP-29 relays sign group metadata. On other relays, space admins sign it. Each entry pins an author-signed snapshot by e tag and keeps the napplet's address in an a tag, so Flotilla can notice updates. The first version is a Flotilla convention based on NIP-51 sets, and it becomes a NIP once a second shell uses it.
P7. Tooling#
A pin needs an author-signed manifest for exactly the pinned version, and a replaceable 35129 event loses old versions. P7 makes the napplet CLI and vite plugin publish a 5129 snapshot on every deploy, which Applesauce's factories already support. Without P7, the app list embeds the author's signed manifest event.
P8. NIP-5D review items#
Flotilla supports three open review items on nips#2303:
- move kind
5129out of NIP-90's DVM range - define identity for manifests without a
dtag, and include the author's pubkey in it - add a common error envelope
A short informative note would also help: a srcdoc frame inherits the embedding page's CSP, so shells with a strict policy need an intermediate host document. The host page has the test results.
P9. The host page package#
The host page is the part of NIP-5D's web binding that every shell repeats. Once its API settles, it can move to the napplet org with its tests.
Out of scope: items in feeds#
A chat or feed full of custom events needs a frame for every item surface, which is too heavy on mobile. A shell-rendered description of an item would avoid that, but rendering is outside the scope of napplets, so no NAP is proposed. Flotilla fills each item's card from the app's icon and the event's NIP-31 alt text, and opens the napplet only for forms and pages.
Process#
- Talk to dskvr, who wrote NIP-5D, before opening PRs. P1 and P2 change how napplets are addressed, so agreement on direction matters more than wording.
- Open small PRs against napplet/naps for P1 through P5, each with a reference implementation in
@welshman/nappletand a conformance fixture. - Comment on nips#2303 for P8.
- Open PRs against napplet/web for P7.
- Write P6 up as a NIP once a second shell reads app lists.