Skip to Content
DevelopersProfile and relays

Profile and relays

Set up a user’s profile in this order:

  1. Publish the user’s relay list (kind 10002).
  2. Ready the image assets.
  3. Publish the user’s profile metadata (kind 0).

Step 1: Publish relay preferences (kind 10002)

Declare which relays the user reads from and writes to:

nak event -k 10002 \ -t r=wss://relay.damus.io \ -t r='wss://relay.primal.net;write' \ -t r='wss://nostr.wine;read' \ --sec <nsec1...> \ wss://relay.damus.io wss://relay.primal.net wss://purplepag.es

Tag format: ['r', '<relay_url>'] for both read/write, ['r', '<relay_url>', 'read'] for read-only, ['r', '<relay_url>', 'write'] for write-only.

Step 2: Ready image assets

If the user provides image files for picture and banner, upload them via Media uploads and use the resulting URLs in step 3.

Step 3: Publish profile metadata (kind 0)

Publish to the same relays declared in the relay list:

nak event -k 0 \ --content '{"name":"alice","picture":"https://example.com/avatar.jpg","about":"Streaming on Shosho"}' \ --sec <nsec1...> \ wss://relay.damus.io wss://relay.primal.net wss://purplepag.es

Content JSON fields:

FieldDescription
nameDisplay username
pictureAvatar URL (upload via nostr.build)
aboutBio text
bannerBanner image URL (upload via nostr.build)
Last updated on