画像アップローダーとほぼ同じ。
- 削除可能
- 編集履歴
- NIP-98 認証 → フォローユーザーに限定することで鍵垢の実装が可能
Alice publishes a private note to their permission list (kind 3 or 30000).
sequenceDiagram
participant Client as Client (Alice)
participant Relay
participant Storage as File Storage Server (NIP-96)
Client->>Relay: REQ<br>{ kinds: [ 3 ], authors: [ Alice ] }
Relay-->>Client: EVENT<br>{ kind: 3, tags: [ [ "p", Bob ], ... ] }
Client->>Storage: POST <api_url><br>Authorization: <NIP-98><br>{ file: <content>, permission: { pubkeys: [ Bob, ... ] } }
Storage-->>Client: { nip94_event: { tags: [ "url", <url> ] } }
Client->>Relay: EVENT<br> { kind: x, pubkey: Alice, tags: [ [ "file", <url> ], [ "p", Bob ], ... ] }
Relay-->>Client: OK
Bob subscribes private notes.
sequenceDiagram
participant Client as Client (Bob)
participant Relay
participant Storage as File Storage Server (NIP-96)
Client->>Relay: REQ<br>{ kinds: [ x ], authors: [ Alice, ... ], p: [ Bob ] }
Relay-->>Client: EVENT<br>{ kind: x, pubkey: Alice, tags: [ [ "file", <url> ] ] }
Client->>Storage: GET <url><br>Authorization: <NIP-98>
alt permitted
Storage-->>Client: Content-Type: text/plain<br><content>
else
Storage-->>Client: 404
end
Client->>Client: Show <content>