NIP-5Dは、iframe内で動作するsandboxed web application(“napplets”)が、hosting application(“shell”)と通信するためのpostMessageプロトコルを定義します。これはNIP-5A(Static Websites)をruntime通信層で拡張し、ユーザーの秘密鍵を露出させずにweb appへNostr機能へのアクセスを与えます。

仕組み

shell applicationは、sandboxed iframe内にnappletを読み込みます。nappletは、ブラウザのpostMessage APIを使い、構造化されたmessage protocolを通じてshellと通信します。shellは、このmessage channelを通してnappletへNostr signing、relay access、user contextを提供します。iframe sandboxはnappletがユーザーの秘密鍵へ直接アクセスするのを防ぐため、shellがすべてのNostr操作のgatekeeperになります。

ユースケース

  • Interactive Nostr apps: ユーザーにnsecの貼り付けを求めず、Nostr eventsの読み書きを行うアプリを作る
  • App marketplace: Nostr eventsを通じて対話的web applicationsを配布する
  • Sandboxed extensions: third-party nappletsを通じてNostr clientへ機能を追加する

Primary sources:

Mentioned in:

See also: