From d419a60ab5d0e24b7b78311385af3b5aa34eca38 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 22 Mar 2026 18:53:13 -0300 Subject: rename to scrolls. --- A5.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/A5.md b/A5.md index 190412e..7205654 100644 --- a/A5.md +++ b/A5.md @@ -1,10 +1,10 @@ # NIP-A5 -## WASM Programs +## Scrolls `draft` `optional` -This NIP defines a standard for publishing self-contained WebAssembly programs as Nostr events. Programs are base64-encoded, executed client-side, and interact with Nostr exclusively through a host-provided handle-based API for building requests, querying relays, and rendering results. +This NIP defines a standard for publishing self-contained WebAssembly programs as Nostr events ("scrolls"). Scrolls are composed of basic metadata (`name`, `description` and `image`) and initial execution parameters defined as tags and a WASM binary, base64-encoded as the content. The binaries are executed in a sandbox inside a "host" (i.e. a proper Nostr client). Scrolls interact with Nostr only through a set of simple APIs provided by the host. --- @@ -16,8 +16,8 @@ This NIP defines a standard for publishing self-contained WebAssembly programs a "content": "", "tags": [ - ["name", ""], - ["description", ""], + ["name", ""], + ["description", ""], ["icon", ""], ["param", "<... (see below)>"] ] @@ -70,7 +70,7 @@ The WASM module **must** export its linear memory so the host can read guest str ## Parameters -Programs can declare parameters that the host must provide when calling `run()`. Parameters are declared as tags on the program event. +Scrolls can declare parameters that the host must provide when calling `run()`. The tag format is `["param", "", "", "", ""]` where: @@ -85,9 +85,9 @@ A special parameter called `"me"` of type `public_key` can be specified to be au Parameters of type `event` may take an extra tag item `` after `` with a comma-separated list of kinds that are acceptable. -### Example Event +### Example -For example, this program could be displayed as an option to be clicked on any user profile. +For example, this scroll could be displayed as an option to be clicked on any user profile. ```yaml { @@ -122,7 +122,7 @@ When the host calls `run()`, it passes a single pointer to a buffer containing a | `timestamp` | unix timestamp as u32_be | 4 bytes | | `relay` | relay URL, same as string | 4 + len bytes | -For example: in a program with parameters `[me: public_key, target_event: event, target_relay: relay]` the buffer layout would be: +For example: in a scroll with parameters `[me: public_key, target_event: event, target_relay: relay]` the buffer layout would be: ``` [ 32-byte current user pubkey ][ 4-byte i32 handle ][ 4-byte len for relay URL ][ UTF-8 relay URL ] @@ -279,7 +279,7 @@ Releases any handle: unconsumed request, active subscription (cancels it), indiv --- -## Example Programs and Host +## Example programs and host code - JavaScript host runtime example: https://viewsource.win/fiatjaf.com/nprogram/_/2e7d56d1536fcca8c49e7b2e99db8062f8df9ae1/~/src/nprogram-host.ts - Rust example (basic, just reads from a relay): https://viewsource.win/fiatjaf.com/nprogram/_/2e7d56d1536fcca8c49e7b2e99db8062f8df9ae1/~/examples/basic/src/lib.rs -- cgit v1.2.3