# NAP domain reference

A **NAP** (*Nostr Applet Protocol*) is one capability contract between a napplet and its runtime — what the runtime provides (relay access, storage, intents, …) and exactly how a napplet asks for it. On the web, [NIP-5D](https://napplet.run/docs/guide/nip-5d.md) binds each NAP to a **message domain**: a NAP named `foo` owns all `foo.*` JSON envelope messages, their payload shapes, and the expected shell behavior. NAP contracts are proposed and maintained in the [NAPs track](https://github.com/napplet/naps).

This reference is non-normative. Every domain page defers to its living proposal in the NAPs track, which governs protocol behavior.

The protocol is modular by design. A NAP must be **independently implementable**, and shells may support **any subset** of NAPs. That's why napplets feature-gate with injected domain property presence before using a domain and degrade gracefully when it's absent — see [Core concepts](https://napplet.run/docs/guide/concepts.md#domain-presence).

## Domains by purpose

Each domain has its own page with its purpose, a minimal example, and its implementation maturity. Examples assume the runtime injected `window.napplet` before napplet code ran; the same calls are also importable as named helpers from [`@napplet/sdk`](https://napplet.run/docs/packages/sdk.md), and each domain ships as a subpath of [`@napplet/nap`](https://napplet.run/docs/packages/nap.md) (barrel / `types` / `shim` / `sdk`).

### Runtime and environment

| Domain | Purpose | Maturity |
| --- | --- | --- |
| [`shell`](https://napplet.run/docs/naps/shell.md) | Optional environment snapshot, readiness, and domain presence checks. | supported |
| [`theme`](https://napplet.run/docs/naps/theme.md) | Read-only shell theme — colors, fonts, background, and live updates. | supported |
| [`config`](https://napplet.run/docs/naps/config.md) | Schema-driven per-napplet settings rendered and persisted by the shell. | exploratory |
| [`keys`](https://napplet.run/docs/naps/keys.md) | Named actions and keyboard bindings owned by the shell. | experimental |
| [`notify`](https://napplet.run/docs/naps/notify.md) | Shell-rendered notifications, badges, and action callbacks. | experimental |
| [`media`](https://napplet.run/docs/naps/media.md) | Media sessions with shell-side playback controls. | supported |
| [`link`](https://napplet.run/docs/naps/link.md) | User-visible external link opening under shell policy. | supported |

### Identity and social

| Domain | Purpose | Maturity |
| --- | --- | --- |
| [`identity`](https://napplet.run/docs/naps/identity.md) | Read-only user queries — pubkey, profile, follows. Never signs. | supported |
| [`common`](https://napplet.run/docs/naps/common.md) | Common social actions — follows, reactions, reports, NIP-19 helpers. | experimental |
| [`lists`](https://napplet.run/docs/naps/lists.md) | NIP-51 list add/remove with runtime-owned signing and encryption. | experimental |
| [`dm`](https://napplet.run/docs/naps/dm.md) | Direct-message conversations, history, and sending via the runtime. | experimental |

### Nostr events and relays

| Domain | Purpose | Maturity |
| --- | --- | --- |
| [`outbox`](https://napplet.run/docs/naps/outbox.md) | Outbox-aware reads and publishes — the default event boundary. | supported |
| [`relay`](https://napplet.run/docs/naps/relay.md) | Low-level relay proxy for explicit relay-local behavior. | supported |
| [`count`](https://napplet.run/docs/naps/count.md) | Aggregate counts for NIP-01 filters. | experimental |

### Napplet to napplet

| Domain | Purpose | Maturity |
| --- | --- | --- |
| [`inc`](https://napplet.run/docs/naps/inc.md) | Topic-based publish/subscribe between running napplets. | supported |
| [`intent`](https://napplet.run/docs/naps/intent.md) | URI-addressed intents routed to a handler napplet. | supported |

### Data, files, and network

| Domain | Purpose | Maturity |
| --- | --- | --- |
| [`storage`](https://napplet.run/docs/naps/storage.md) | Scoped key-value storage isolated per napplet. | supported |
| [`fs`](https://napplet.run/docs/naps/fs.md) | Virtual filesystem — pickers, reads, writes, and change events. | experimental |
| [`resource`](https://napplet.run/docs/naps/resource.md) | Sandboxed byte fetching over https, blossom, nostr, and data URIs. | supported |
| [`upload`](https://napplet.run/docs/naps/upload.md) | File and blob upload over NIP-96 and Blossom rails. | supported |
| [`cvm`](https://napplet.run/docs/naps/cvm.md) | ContextVM bridge — MCP tools and resources over Nostr. | experimental |

### Devices and realtime

| Domain | Purpose | Maturity |
| --- | --- | --- |
| [`gamepad`](https://napplet.run/docs/naps/gamepad.md) | Focus-scoped controller snapshots. | supported |
| [`ble`](https://napplet.run/docs/naps/ble.md) | Bluetooth LE / GATT sessions with opaque session ids. | experimental |
| [`serial`](https://napplet.run/docs/naps/serial.md) | User-approved serial port sessions. | experimental |
| [`webrtc`](https://napplet.run/docs/naps/webrtc.md) | Runtime-owned WebRTC sessions carrying application payloads. | experimental |

### AI

| Domain | Purpose | Maturity |
| --- | --- | --- |
| [`llm`](https://napplet.run/docs/naps/llm.md) | User-selected language model inference through the runtime. | exploratory |

## Implementation maturity

These release-time labels describe our shipped implementation, separately from upstream proposal status. Supported does not mean frozen; experimental does not waive conformance requirements. All capabilities remain subject to change. See [maturity and opt-in policy](https://napplet.run/docs/naps/maturity.md).

| Domain | Implementation maturity | Proposal status | Assessment |
| --- | --- | --- | --- |
| `shell` | supported | [merged](https://github.com/napplet/naps/pull/101) | Optional readiness and environment binding has focused shim and reference-runtime coverage. |
| `relay` | supported | [in-review](https://github.com/napplet/naps/pull/2) | Relay reads, publishing, and subscription lifecycle have maintained shim and integration tests; upstream naming remains under review. |
| `identity` | supported | [merged](https://github.com/napplet/naps/pull/102) | Read-only identity queries and updates have focused binding and reference-runtime coverage. |
| `storage` | supported | [in-review](https://github.com/napplet/naps/pull/3) | Key-value binding has focused request/result tests and tutorial usage; host storage isolation remains the host responsibility. |
| `inc` | supported | [merged](https://github.com/napplet/naps/pull/104) | Topic and channel bindings have compatibility tests and authenticated-endpoint reference-runtime coverage. |
| `theme` | supported | [merged](https://github.com/napplet/naps/pull/103) | Theme queries and pushed updates have focused binding and opaque-iframe integration coverage. |
| `keys` | experimental | [in-review](https://github.com/napplet/naps/pull/9) | Keyboard binding ships, but dedicated domain regression coverage is limited; retain explicit evaluation opt-in. |
| `media` | supported | [in-review](https://github.com/napplet/naps/pull/10) | Session creation and playback binding have focused regression coverage; proposed torrent playback amendments are not implied. |
| `notify` | experimental | [in-review](https://github.com/napplet/naps/pull/11) | Notification binding ships with limited dedicated domain regression evidence; broader host integration confidence is unverified. |
| `config` | exploratory | [draft](https://github.com/napplet/naps/pull/14) | Configuration binding is tested, but the upstream draft is marked MAY DEFER; use for design exploration. |
| `resource` | supported | [in-review](https://github.com/napplet/naps/pull/80) | Resource fetching has focused shim and type tests; the reverted merge and reopened proposal do not change that implementation assessment. |
| `cvm` | experimental | [in-review](https://github.com/napplet/naps/pull/31) | Session and registry bindings are tested; upstream explicitly marks the contract NEEDS WORK. |
| `outbox` | supported | [in-review](https://github.com/napplet/naps/pull/32) | Routing and subscription bindings have focused tests and an integration regression for structured-clone boundaries. |
| `upload` | supported | [in-review](https://github.com/napplet/naps/pull/33) | Upload binding has focused tests for request/result behavior; host rail support remains runtime-specific. |
| `intent` | supported | [merged](https://github.com/napplet/naps/pull/91) | Convention normalization and dispatch have focused binding and reference-runtime integration tests. |
| `ble` | experimental | [in-review](https://github.com/napplet/naps/pull/62) | GATT binding has unit coverage; real-device behavior across host backends is not established by these tests. |
| `webrtc` | experimental | [in-review](https://github.com/napplet/naps/pull/59) | Signaling and session binding have unit coverage; interoperable live peer sessions remain unverified here. |
| `link` | supported | [in-review](https://github.com/napplet/naps/pull/53) | The small link-opening binding has focused regression coverage; navigation authorization stays with the host. |
| `count` | experimental | [in-review](https://github.com/napplet/naps/pull/69) | Count binding is tested, but accuracy and aggregation across real relay backends remain outside that evidence. |
| `lists` | experimental | [in-review](https://github.com/napplet/naps/pull/68) | List mutation binding is tested; concurrent real-host mutation behavior is not established by binding tests. |
| `serial` | experimental | [in-review](https://github.com/napplet/naps/pull/61) | Serial binding has unit coverage; device and native-host integration evidence is limited. |
| `fs` | experimental | [in-review](https://github.com/napplet/naps/pull/88) | Filesystem binding has MVP coverage; portability and authorization across storage backends remain under evaluation. |
| `common` | experimental | [in-review](https://github.com/napplet/naps/pull/67) | Social action binding is tested; broader host integration and evolving action semantics warrant explicit opt-in. |
| `dm` | experimental | [draft](https://github.com/napplet/naps/pull/74) | Direct-message binding has shim and type coverage; transport interoperability is not established by those tests. |
| `gamepad` | supported | [in-review](https://github.com/napplet/naps/pull/130) | Cross-repository delivery includes binding, security, runtime, and conformance verification; the reopened proposal is still subject to change. |
| `llm` | exploratory | [draft](https://github.com/napplet/naps/pull/134) | Early published draft has binding and mock-runtime tests; provider behavior and API design remain exploratory. |

## Core domain union

[`@napplet/core`](https://napplet.run/docs/packages/core.md) exports a `NapDomain` string union for the foundational domains — `shell`, `relay`, `identity`, `storage`, `inc`, `theme`, `keys`, `media`, `notify`, `config`, `resource`, `cvm`, `outbox`, `upload`, `intent`, `ble`, `webrtc`, `link`, `count`, `lists`, `serial`, `fs`, `common`, `dm`, `gamepad`, `llm` — used as the discriminant for envelope routing and domain presence.

## Where to go next

- [`@napplet/nap`](https://napplet.run/docs/packages/nap.md) — the package and its subpath patterns
- [`@napplet/sdk`](https://napplet.run/docs/packages/sdk.md) — typed helpers and per-domain message unions
- [NIP-5D explained](https://napplet.run/docs/guide/nip-5d.md#nap-extension-framework) — the NAP framework
