Research

The napplet ecosystem

A napplet is a single-file web app published as a Nostr event. It runs in a sandboxed iframe and reaches relays, signing and storage only through the app that hosts it. This page covers how napplets work, how safe and stable they are, and who implements them. The plan builds on it.

SpecNIP-5D draft, nips#2303Readnapplet.run, kehto/web, napplet/naps, three host clients30 Nov 2026
NIP-5D
Draft
Open PR since 5 Apr 2026
NAPs merged
5
Relay, outbox and storage are still open PRs
@kehto/shell releases
57
Since 19 Apr 2026, all 0.x
Napplets on relays
96
napplet.run snapshot, 1 Nov 2026

Summary#

  • The protocol core is small and well reviewed. A shell verifies the napplet's bytes against a signed manifest, runs them in an opaque-origin srcdoc iframe, and answers requests over one MessagePort per document.
  • The ecosystem is alpha. NIP-5D is an open PR whose event schema changed in October, only five capability specs are merged, and the host libraries publish about two releases a week.
  • The sandbox keeps a napplet away from keys and from the host's storage. It does not stop a napplet from leaking data the host gives it. In Flotilla, letting a napplet read a closed space is the same as sharing that space with the napplet's author.
  • Three established clients host napplets: Amethyst, noStrudel and Grimoire. Kehto is the main host toolkit, and its consent model still rejects a call before it asks the user.

How napplets work#

TermMeaning
NappletOne self-contained index.html, stored on Blossom and described by a signed manifest event.
ShellThe trusted host app. It verifies napplets, embeds them, and serves their requests. Flotilla would be a shell.
NAPA Nostr Applet Protocol spec for one capability domain, such as relay, storage or theme. A domain owns every domain.action message type. A shell implements any subset of domains.
ManifestKind 35129 names a napplet by d tag, kind 15129 is an author's single root napplet, and kind 5129 pins one immutable snapshot.

A napplet moves from relays to a running frame in five steps.

Manifest
relays
Kind 35129 with one x tag holding the sha256 of index.html
Artifact
Blossom
Fetched by hash from the manifest's server hints
Prepare
shell
Check signature and hash, then add a CSP and the window.napplet bootstrap
Frame
srcdoc
sandbox="allow-scripts", opaque origin, no storage or network
Services
MessagePort
Relays, signing, storage and theme, under shell policy

A manifest declares what the napplet needs and what it can do for others. R tags list required domains and O tags list optional ones. z tags name archetypes such as feed, and i tags name the intents the napplet accepts. None of these grant anything.

Named napplet manifest (from NIP-5D)jsonc
{
"kind": 35129,
"content": "A feed viewer and editor hosted on Nostr",
"tags": [
["d", "my-napplet"],
["x", "186ea5fd14e88fd1ac49351759e7ab906fa94892002b60bf7f5a428f28ca1c99"],
["z", "feed"],
["i", "napplet:feed/open"],
["i", "napplet:feed/edit", "filters", "relays"],
["R", "relay"],
["O", "theme"],
["icon", "ae7a3bd1a3fa9d824d0e64a6f57fe6cb4dd80c423786b6a2ecb94d587c94c75a", "image/png"],
["server", "https://blossom.example.com"],
["title", "My Napplet"],
["source", "https://github.com/example/my-napplet"]
]
}

Transport and identity#

The shell injects a bootstrap that runs before any napplet script. The bootstrap creates a MessageChannel, keeps one port in a closure, and sends the other to the parent window with a single napplet.hello. The shell accepts the hello only from the contentWindow of an iframe it created, and only with exactly one port attached. It binds the napplet's identity, the pair of d tag and artifact hash, to that port. From then on it handles messages from that port and nowhere else.

Wire formatjs
// Napplet to shell, once, on the window
window.parent.postMessage({type: "napplet.hello"}, "*", [port])
// Both directions on the port afterwards; results pair with requests by id
{ "type": "relay.publish", "id": "a1", "event": { … } }
{ "type": "relay.publish.result", "id": "a1", "ok": true }

Identity belongs to the document, not to the frame. A frame can navigate to unverified content and keep its Window object. The shell therefore treats a second hello, any other window message after the handoff, a second load event, or a closed port as a replaced document. In each case it closes the port, revokes every grant, and removes the frame. Closing the port is required, because a port the napplet transferred elsewhere survives the frame's removal.

Capability domains#

Each NAP is a separate spec in the napplet/naps repository. A napplet detects a domain by checking whether window.napplet.<domain> exists, and the shell decides which domains to inject for each napplet.

DomainProvidesSpecMaturity
identityThe user's pubkey and profile, read-onlyMergedSupported
themeShell colors, fonts and changes to themMergedSupported
intentInvoke a handler by napplet:<archetype>/<intent>MergedSupported
incTopic pub/sub between nappletsMergedSupported
shellEnvironment snapshot and readinessMergedSupported
relaySubscribe and publish through the shell, which signs and encryptsPR #2Supported
outboxReads and publishing with NIP-65 routing done by the shellPR #32Supported
storageKey-value storage per napplet and user, 512 KBPR #3Supported
uploadBlossom and NIP-96 uploadsPR #33Supported
resourceBytes from https, Blossom and nostr: URIs, fetched by the shellPR #80Supported
linkExternal links opened under shell policyPR #53Supported
notifyNotifications and badges drawn by the shellPR #11Experimental
dm, lists, common, keys, config, webrtc, …AssortedOpen PRsExperimental or exploratory

The table reflects napplet.run on 30 November. The repository marks even the merged NAPs as draft.

Discovery#

Manifests are ordinary events, so any relay query finds them, and #R and #O filters find napplets by domain. A shell can advertise itself with a NIP-89 handler event (kind 31990) whose k tags name the manifest kinds it opens and whose N tags name the domains it can expose. A napplet with every R domain in a shell's N set runs there with full functionality.

Archetype and intent names have no registry. The napplet archetype registry was deprecated in November, and intent names are conventions that napplet authors agree on informally. Applesauce adds kind 31129 for a user's ordered handler preferences per archetype. That kind is not part of NIP-5D.

The security boundary#

NIP-5D treats every napplet as untrusted and the shell as trusted. The browser enforces the first two layers below, and the shell enforces the rest.

LayerEnforced byWhat it blocks
Opaque-origin sandbox, allow-scripts without allow-same-originBrowserAccess to the shell's DOM, cookies, localStorage, IndexedDB and service workers
Injected CSP with connect-src 'none'Browserfetch, WebSockets, remote images, workers and fetched frames
Content addressingShellBytes other than the ones the author signed. Gateways can serve bytes faster, and the shell still checks them.
Port bindingShell and bootstrapA replaced document keeping the napplet's identity and grants
MediationShellKey access. There is no window.nostr, and the shell signs, encrypts and decrypts on the napplet's behalf.

These layers leave known gaps, and the spec and Kehto document them.

GapDetailStatus
Self-navigationCSP doesn't restrict a document navigating its own frame, so a napplet can put data it holds into a URL. NIP-5D tells shells to treat anything released to a napplet as disclosable.Inherent to iframes
WebRTCconnect-src doesn't cover RTCPeerConnection. Kehto removes the RTC* globals in its bootstrap, but a nested srcdoc frame gets a fresh realm where they exist. Kehto measured this in Chromium 147 and closes it with an opt-in nested-context lock.Mitigated in Kehto, outside the spec
Resource hintsSome browsers act on dns-prefetch, preconnect and prerender links despite the CSP. Shells should refuse bytes that contain them.Shell must scan
CiphertextShells must not sign ciphertext a napplet supplies, but no reliable test for ciphertext exists, and a napplet can disguise it.Heuristic only
Side channelsNIP-5D excludes side channels and a compromised browser from its guarantees. Amethyst runs napplets in a separate Android process with no keys, which a Capacitor app can't do.Out of scope

Implementations and libraries#

Libraries#

Napplet authors use the @napplet packages, and shells use Kehto's. Every package is MIT-licensed and on 0.x. @kehto/shell and @napplet/shim have each published 57 releases since 19 April.

PackageSideVersionRole
@napplet/coreBoth0.45.0Envelope types, dispatch helpers, domain selection by maturity
@napplet/shimHost0.43.0The prelude that installs window.napplet before napplet scripts run
@napplet/sdkNapplet0.39.0Typed wrappers over window.napplet
@napplet/vite-pluginNapplet0.18.0Hashes the built index.html and writes a manifest template
@napplet/conformanceTest0.32.0Reference mock shell and boot fixtures for testing either side
@kehto/nipHost0.8.1Manifest and artifact verification, Cache Storage artifact cache; depends only on @noble/hashes
@kehto/runtimeHost0.31.1Dispatch, ACL gates, service routing, sessions
@kehto/shellHost0.36Iframe lifecycle, port binding, CSP and srcdoc preparation, realm locks
@kehto/servicesHost0.36.0Reference handlers for identity, relay, theme, notify, resource and others
applesauce-extra/kehtoHost7.3.0Binds Kehto to an applesauce store, pool and signer; pins @kehto/shell ^0.32

Kehto describes itself as "far from complete", saying it "still requires the implementer to manage envelope security, process isolation, performance optimization and more". The Applesauce integration is the closest analogue to a welshman one. It exposes createKehtoHost(context, {services}), takes an approve callback for signing, and leaves consent UI, handler selection and theme to the app. Its docs pin @kehto/shell at ^0.32 while Kehto has moved on to 0.36.

Shells#

ShellPlatformStatusHow it presents napplets
AmethystAndroid, desktopActive developmentFull-screen activity, or warm bottom-bar tabs; napplets run in a separate keyless process
noStrudelWebActive developmentApp store with filters, a Napplets tab on profiles, consent and intent-choice modals
GrimoireWebActive developmentTiling windows; an app command and a launcher where grants are reviewed
MycoAndroid, Android TVAvailableWorks offline; passes apps between nearby phones
HypergolicAndroidAvailableWorkspace; pins a napplet to the home screen
napplet.soyWebAvailablePlayground; opens /n/<naddr> links
PajaWebDeveloper previewKehto's reference runtime for napplet authors
nostrappsWebWork in progressOne sandboxed window per app

Three established clients host napplets: Amethyst, noStrudel and Grimoire. Their designs differ. Amethyst renders each napplet in its own process and can keep favorites warm off-screen, so switching tabs is instant. noStrudel treats napplets as content, with an app store, a Napplets tab on profiles, and detail pages. Grimoire opens them as windows in its tiling workspace.

What Grimoire's integration notes say about Kehto

Grimoire's docs/napplets.md lists the Kehto behaviors it had to work around. The first three still hold in Kehto's runtime 0.31.1, checked on 30 November: the default policy is permissive unless the host passes aclDefaultPolicy, and the only consent the runtime raises is firewall-policy. The destructive-signing consent type is declared in its types and never raised.

  • Kehto's runtime creates its ACL state as permissive, and it persists every live grant when it is destroyed. Grimoire keeps its own record of grants and replays only the choices the user asked it to remember.
  • ACL checks are synchronous, so a consent prompt can't hold a call open. Grimoire lets the call fail, asks the user, and reloads the frame with the grant in place.
  • The runtime asks for no consent before relay.publish signs. Grimoire gates signing itself and attributes each signature to the frame that requested it.
  • @kehto/acl maps inc to relay:read and relay:write, so granting inc naively also grants publishing.
  • A browser can't enforce the resource domain's private-IP rule, because a page can't see DNS results. Grimoire grants exact origins instead.

Production readiness#

  1. 5 Apr 2026
    NIP-5D opened as nips#2303
    Napplets reused NIP-5A site manifests and loaded from gateways.
  2. 16 Jun 2026
    Identity moves into the runtime
    The author argued that the shell must compute identity from the bytes it runs. The current text loads verified bytes through srcdoc.
  3. 24 Jul 2026
    CSP injection added
  4. 4 Oct 2026
    Event schema replaced
    Napplets got their own kinds, a single artifact hash, R and O tags, z and i tags, icons and screenshots. Older manifests need an adapter.
  5. 2 Nov 2026
    Spec review
    Kind 5129 falls in NIP-90's DVM range, identity is undefined for manifests without a d tag, and there is no common error envelope. All three are still open.
  6. 21 Nov 2026
    Review against a formal model
    A Lean model of the shell exposed port-binding gaps, which the text now closes.
  7. 30 Nov 2026
    Still open
AreaStateAssessment
Core modelSmall, reviewed by several implementers, checked against a formal model, with the known gaps documentedSound
NIP-5DOpen PR. The schema broke in October, and three review items are open.Moving
NAPsFive merged drafts. relay, outbox and storage are unmerged.Moving
Libraries0.x with about two releases a week. Integrations pin older ranges.No stable API
AdoptionThree major clients host napplets. The 96 published releases are mostly games, demos and Nostr tools.Early
Capacitor WebViewsAndroid shells ship napplets. Nobody reports results from Capacitor or iOS.Untested

Sources#

  • NIP-5D draft and discussion: nostr-protocol/nips#2303, text at dskvr/nips 5D.md
  • NAP specs: napplet/naps, including projections/web.md, NAP-INTENT.md and NAP-SHELL.md
  • napplet.run docs, protocol status and app listing
  • Kehto: kehto/web, mainly docs/tutorials/minimal-host-shell.md, docs/policies/NIP-5D-CONFORMANCE.md and docs/packages/shell.md
  • Applesauce hosting docs: apps/docs/napplets
  • Hosts: Grimoire docs/napplets.md, Amethyst's amethyst/plans/archive/2026-06-24-napplet-embedded-tabs.md, noStrudel's napplet changesets
  • npm registry metadata for release counts, as of 30 Nov 2026