Resources for Agents
Shosho services
| Service | URL | Purpose |
|---|---|---|
| Website | https://shosho.live | Web app — browse streams, clips, chat |
| Streaming API | https://api.shosho.live/api/v1 | Stream keys, account, metadata (NIP-98 auth) |
| Show Chat API | https://shosho.live/api/show-chat | Backend-driven live events: create, list, update, delete (NIP-98 auth) |
External tools
| Tool | URL | Purpose |
|---|---|---|
| NAK | github.com/fiatjaf/nak | Nostr CLI — query, publish, encode |
| nostr-tools | github.com/nbd-wtf/nostr-tools | JS/TS Nostr library |
| nostr.build | https://nostr.build | NIP-96 media uploads (images, video) |
Nostr NIPs reference
| NIP | Spec |
|---|---|
| NIP-01 | 01.md |
| NIP-02 | 02.md |
| NIP-05 | 05.md |
| NIP-07 | 07.md |
| NIP-09 | 09.md |
| NIP-19 | 19.md |
| NIP-22 | 22.md |
| NIP-25 | 25.md |
| NIP-30 | 30.md |
| NIP-46 | 46.md |
| NIP-51 | 51.md |
| NIP-53 | 53.md |
| NIP-57 | 57.md |
| NIP-65 | 65.md |
| NIP-71 | 71.md |
| NIP-96 | 96.md |
| NIP-98 | 98.md |
| NIP-99 | 99.md |
Key methodologies
Never roll your own cryptography
Nostr uses secp256k1 Schnorr signatures. Always use established libraries (nostr-tools, NAK) for key generation, signing, and verification. Never implement signing or encryption from scratch.
Relay etiquette
- Don’t spam relays with high-frequency publishes. Batch where possible.
- Respect relay rate limits — most relays will disconnect you if you exceed them.
- For critical events (profile updates, relay lists), publish to multiple relays for redundancy.
- For stream events, prefer the user’s own write relays rather than broadcasting to every relay.
Event signing
All Nostr events must be signed by the user’s private key. When acting as an agent:
- Ask the user for their nsec or use a NIP-46 signer (Nostr Connect).
- Never store private keys in plaintext logs or transmit them over unencrypted channels.
- Shell history: commands using
--sec $NSECare recorded in shell history. Prefix the command with a space (requiresHISTCONTROL=ignorespace) orunset NSECafter use to avoid persisting the key. - NAK handles signing via the
--secflag. - For programmatic use,
nostr-toolsprovidesfinalizeEvent()which signs and hashes.
Addressable vs regular events
- Addressable events (kinds 30000-39999) are identified by
kind:pubkey:d-tagand are replaceable — publishing a new event with the same d-tag replaces the old one. - Regular events are identified by event ID and are immutable once published.
- Stream events (30311), addressable clips (34235 / 34236), and products (30402) are all addressable.
- Chat messages (1311), reactions (7), legacy clips (21 / 22), and clip comments (1111) are regular events.
Troubleshooting
Published something wrong to the network
Publish a kind 5 deletion request (NIP-09) to ask relays to remove the event. You can only delete events you authored.
# Delete a regular event by event ID
nak event -k 5 \
--content "published in error" \
-t e=<event_id_to_delete> \
-t k=<kind_of_deleted_event> \
--sec <nsec1...> \
wss://relay.damus.io wss://relay.primal.net
# Delete an addressable event by coordinate
nak event -k 5 \
--content "published in error" \
-t a='<kind>:<author_hex_pubkey>:<d-tag>' \
-t k=<kind_of_deleted_event> \
--sec <nsec1...> \
wss://relay.damus.io wss://relay.primal.netDeletion is a request, not a guarantee. Relays may or may not honour it. For addressable events, you can also publish a corrected replacement with the same d tag.
For events Shosho signed on your behalf — i.e. 30311 events created via Shosho Server or the Show Chat API — your NIP-09 deletion will be invalid because you’re not the event author. Use the corresponding API delete endpoint instead (DELETE /stream/<d-tag> for Shosho Server; POST /show-chat/delete for Show Chat). The Shosho service publishes the kind 5 deletion with its own key.