FIXME: allow multiple files in content
currently, content can hold only one file, usually utf8-encoded text.
it would be nice to send multiple files per event, for example:
- text with images
- text with video
- video with subtitles
- arbitrary folders of files
benefits:
- avoid sending images as base64
- reuse one image in multiple places
- avoid muxing streams into one video file
- avoid workarounds like zip-archives
this would make nostr more similar to bittorrent/zeronet/twister
I think multiple files can be packed as a tar package
at least we should add a content type, so users can describe the payload type. how about:
- enum values from 1 to 255 = some commonly used mimetypes:
- text/markdown; charset=utf8
- text/html; charset=utf8
- application/zip; charset=binary
- application/tar; charset=binary
- application/tar; charset=binary+application/gzip; charset=binary
- application/x-7z-compressed; charset=binary
- value 0 + length-prefixed utf8-string (max 255 bytes length) = custom mimetype
I am not a big fan of something non-standard; the selection of 255 "common" types looks too opinionated for me...
We can allow MIME / MediaType in string representation - that is better (in binary serialization the string prefixed with one byte length).