Media uploads
Images and videos used in profiles (avatar, banner), live stream covers, clips, and product photos need to be available on Nostr as URLs. To get a URL from a file, upload it to a media hosting service.
If users don’t have their own media hosting, they can use nostr.build — a NIP-96 file storage service. All uploads to nostr.build require NIP-98 authentication.
Upload flow
- Discover the upload endpoint:
curl https://nostr.build/.well-known/nostr-basics/nip96.json- Upload with NIP-98 auth:
AUTH=$(nak event -k 27235 \
-t u=https://nostr.build/api/v2/nip96/upload \
-t method=POST \
--sec <nsec1...> < /dev/null 2>/dev/null | base64)
curl -X POST \
-H "Authorization: Nostr $AUTH" \
-F "file=@image.jpg" \
https://nostr.build/api/v2/nip96/uploadThe response contains a nip94_event with tags including the hosted URL. Use that URL in:
- Profile
picture/bannerfields (Profile and relays) - Stream
imagetags (Live event structure) - Clip
imetatags (Clips) - Product
imagetags (Products)
Related
Last updated on