docs(nips): add system channels to NIP-CL

Define the system channel type. List it in ARCHITECTURE.md.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Signed-off-by: Logan Johnson <loganj@squareup.com>
This commit is contained in:
Logan Johnson
2026-10-09 12:17:37 -04:00
parent 0ffb346c67
commit 8104dc7b11
2 changed files with 19 additions and 2 deletions

View File

@@ -469,7 +469,7 @@ All database access. Uses `sqlx::query()` (runtime, not compile-time macros) —
| `user.rs` | User profile storage |
| `error.rs` | Database error types |
**Channel types:** `Stream`, `Forum`, `Dm`, `Workflow`
**Channel types:** `Stream`, `Forum`, `Dm`, `Workflow`, `System`
**Member roles:** `Owner`, `Admin`, `Member`, `Guest`, `Bot`
**Workflow statuses:** `Active`, `Disabled`, `Archived`
**Run statuses:** `Pending`, `Running`, `WaitingApproval`, `Completed`, `Failed`, `Cancelled`

View File

@@ -24,12 +24,16 @@ plain NIP-29, a client cannot:
A client also cannot mark its own channels so that it can find them again.
Channel labels (below) do this.
Also, every channel that a person belongs to shows in their client as a chat.
So a group that exists only to control who can read some data appears in
sidebars, search results and unread counts. System channels (below) fix this.
## Channel identity tags
On every channel-state event that the relay signs, the relay MUST put these
tags in this order, before any other `t` or `P` tag:
1. `["t", <channel type>]`, for example `stream`, `forum`, `dm`, `workflow`.
1. `["t", <channel type>]`, for example `stream`, `forum`, `dm`, `workflow`, `system`.
2. `["t", <label>]` for each channel label, in stored order (see
[Channel labels](#channel-labels)).
3. `["P", <creator public key, hex>]`.
@@ -135,6 +139,19 @@ channel without a `created_at` tag ranks after every channel that has one.
Every reader that follows this rule picks the same channel, even after either
channel is edited.
## System channels
A system channel exists only to control who can read some data, for example
config that only an agent and its owner can read. It has the channel type
`system`. In every other way it is an ordinary channel: it has members, roles,
messages and labels.
**Create.** A kind:9007 with `["channel_type", "system"]` creates a system
channel. It is private unless the kind:9007 also has `["visibility", "open"]`.
**Hidden.** While a system channel is private, its kind:39000 carries the
NIP-29 `hidden` tag.
## Trust
A client that relies on these tags MUST check that the relay's key signed the