Skip to content

Architecture ​

Kehto is an unopinionated toolkit and protocol kernel for NIP-5D napplet runtimes. It separates host implementation machinery into small packages with clear ownership boundaries.

Alpha status: NIP-5D is still under development, and NAP contracts are not final. This architecture describes Kehto's current implementation, not a requirement that all napplet runtimes follow the same shape.

LayerPackageResponsibility
Capability state@kehto/aclPure access-control state and capability mapping.
Protocol engine@kehto/runtimeDispatch, service routing, ACL checks, storage, manifest/session state.
Browser shell@kehto/shelliframe/session lifecycle, postMessage, gateway loading, injected window.napplet domains, browser registries.
Services@kehto/servicesReference service handlers registered with the runtime.
Optional utilities@kehto/nip, @kehto/wmUnique Nostr NIP utilities, including NIP-5A/5D artifact verification/cache helpers, and shell-owned window-management contracts.
Reference runtime@kehto/pajaConcrete developer-runtime choices built from the toolkit.
Visualization@kehto/playgroundProtocol visualization and integration verification, not runtime policy.

@napplet packages define portable napplet-side contracts and helpers. Kehto provides host-side implementation tools; Paja supplies the concrete reference runtime behavior.