Profile and relays
Set up a user’s profile in this order:
- Publish the user’s relay list (kind 10002).
- Ready the image assets.
- 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.esTag 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.esContent JSON fields:
| Field | Description |
|---|---|
name | Display username |
picture | Avatar URL (upload via nostr.build) |
about | Bio text |
banner | Banner image URL (upload via nostr.build) |
Related
Last updated on