30817:music-playlists-with-pc-20-guids
What Karnage's copy changes
The document signed by ChadF and 33 others, read whole, with what the copy signed by Karnage changes marked in place.
Music Playlists
draft optional
This spec defines an addressable event kind for publishing music playlists on Nostr, with tracks referenced via Podcast Index GUIDs.Nostr.
Event Kind
34139: Playlist(parameterized replaceable perNIP-33)(addressable)
Playlist Event
A playlist is an addressable event containing an ordered list of music tracks.
Format
The .content field SHOULD contain a Markdown track listing as a human-readable fallback:
# Playlist Title
Artist One - Track Title
Artist Two - Track Title
N tracks
The i tags are the canonical track references. The .content listing allows clients to display the playlist even when feed resolution is unavailable.
The .content field MAY contain a description of the playlist in plain text or Markdown.
Tags
Required:
d- Unique identifier for this playlisttitle- Playlist titlealt- Human-readable description (NIP-31)
Optional:
description- Short description (can also use content field)image- URL to playlist artwork- Trackiaand feedreferences(multiple,inorderedformat—36787:<pubkey>:<d-tag>see(multiple,below)ordered)t- Category tags for discoverypublic- Set to"true"for public playlists (default)private- Set to"true"for private playlistscollaborative- Set to"true"to allow others to add tracks
Example
{
"id": "<32-byte hex event id>",
"pubkey": "<32-byte hex public key>",
"created_at": 1700000000,
"kind": 34139,
"content": "# Summer Vibes 2024\n\nSurvival Guide - January Shock\nJune & The Jets - You Sure Did\nBear's Snare - Ocean Breeze\n\n3 tracks",
"tags": [
["d", "summer-vibes-2024"],
["title", "Summer Vibes 2024"],
["alt", "Music playlist: Summer Vibes 2024"],
["t", "playlist"],
["t", "music"],
["public", "true"],
["image", "https://cdn.blossom.example/img/playlist.jpg"],
["i", "podcast:item:guid:a1b2c3d4-e5f6-7890-abcd-ef1234567890"],
["i", "podcast:item:guid:b2c3d4e5-f6a7-8901-bcde-f12345678901"],
["i", "podcast:item:guid:c3d4e5f6-a7b8-9012-cdef-012345678902"],
["i", "podcast:guid:d7b4abee-1234-5678-9abc-def012345678"],
["i", "podcast:guid:e8c5bcff-2345-6789-abcd-ef0123456789"]
],
"sig": "<64-byte hex signature>"
}
{
"kind": 34139,
"content": "My favorite summer vibes from 2024",
"tags": [
["d", "summer-vibes-2024"],
["title", "Summer Vibes 2024"],
["image", "https://cdn.blossom.example/img/playlist.jpg"],
["description", "Chill electronic tracks for summer"],
["a", "36787:abc123...:summer-nights-2024"],
["a", "36787:def456...:sunset-dreams"],
["a", "36787:abc123...:ocean-breeze"],
["t", "playlist"],
["t", "electronic"],
["t", "summer"],
["public", "true"],
["alt", "Playlist: Summer Vibes 2024"]
]
}
Track References
Playlists reference music tracks using tags iawithin prefixes from the Podcasting 2.0 namespace:format:
["i",["a", "podcast:item:guid:"36787:<itemGuid>"]
["i", "podcast:guid:pubkey>:<feedGuid>"]d-tag>"]
Where:
podcast:item:guidreferences a specific track by its RSS<guid>element value. One tag per track, in playlist order.podcast:guidreferences the feed containing one or more tracks, by the feed's<podcast:guid>element value. Deduplicated — one tag per unique feed.
Item GUID tags MUST appear in playlist order. Feed GUID tags MAY appear in any order and MAY be interleaved with item tags or grouped separately.
The mapping between items and feeds is implicit. Clients resolve all feed GUIDs, parse each feed, and search across them to match each item GUID.
Clients resolve tracks by:
- Collecting
podcast:guidvalues fromitags - Looking up feed URLs via the Podcast Index API
podcasts/byguidendpoint (requires API key + secret) - Fetching and parsing each feed's RSS XML
- Matching each
podcast:item:guidacross all parsed feeds - Falling back to the
.contenttrack listing for unresolved items
naddr1qvzqqqy9tvpzpauj9g9dk0aymkj7aj4x9ahhaes4nal4tcyqxe5xc68qswpvx3ugqyt8wumn8ghj7cmgv9jxvtnwdaehgu339e3k7mgpzamhxue69uhkv6tvw3jhytnwdaehgu3wwa5kuegpzpmhxue69uhkummnw3ezuamfdejsq9tnw3skymr9ddexzen594nxzan0wf5hgetnnkkw8h
36787is the Music Track event kind (see NIP-XX: Music Tracks)<pubkey>is the track author's public key (hex)<d-tag>is the track's unique identifier
Implementation Notes
- Playlists are updatable (addressable
eventsevents) - Playlist
— re-publishing with the samedatagtagsreplacesreferencethetrackspreviousinversion)display order Clientsitag order is canonical; clientsSHOULD preserve track order when displaying playlists- Clients SHOULD handle missing/deleted tracks gracefully
— show a placeholder from.contentor skip - When a
feedreferencedcannottrackbeisresolvednot(deadfound,URL,clientsremovedMAYfromshowindex),aclientsplaceholderMAYorshowskiptheit - Playlists
correspondingsupportNIP-25.contentlinereactionsinsteadand NIP-22 comments - Use
naddridentifiers to link to playlists PlaylistsCollaborativesupportplaylistNIP-25mechanicsreactionsareandclient-definedNIP-22(e.g.,commentsNIP-04/17 track suggestions)- Artwork images SHOULD be hosted on Blossom servers for permanence
Resolved feeds may contain<podcast:value>tags — clients MAY parse these to enable Lightning payments and boosts