nbd-wtf / go-nostr

Nostr library for Golang
MIT License
364 stars 102 forks source link

NIP-96 sign payload, content field for file caption #148

Closed ice-cronus closed 4 weeks ago

ice-cronus commented 4 weeks ago

content in upload response for file caption as in NIP-94:

{
  "kind": 1063,
  "tags": [
    ["url",<string with URI of file>],
    ["m", <MIME type>],
    ["x",<Hash SHA-256>],
    ["ox",<Hash SHA-256>],
    ["size", <size of file in bytes>],
    ["dim", <size of file in pixels>],
    ["magnet",<magnet URI> ],
    ["i",<torrent infohash>],
    ["blurhash", <value>],
    ["thumb", <string with thumbnail URI>],
    ["image", <string with preview URI>],
    ["summary", <excerpt>],
    ["alt", <description>]
  ],
  "content": "<caption>", // <--- THIS
  // other fields...
}

optional signing of file payload in NIP-98 header for file uploads:

When the request contains a body (as in POST/PUT/PATCH methods) clients SHOULD include a SHA256 hash of the request body in a payload tag as hex (["payload", ""]), servers MAY check this to validate that the requested payload is authorized.