-
Notifications
You must be signed in to change notification settings - Fork 634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add audio track NIP #1043
base: master
Are you sure you want to change the base?
Add audio track NIP #1043
Conversation
It would be helpful to state the main goal of this NIP. I am totally with you that it would be valuable to center around a standard way of sharing and describing media but without a clear purpose I'm afraid we'll just end up trading opinions about implementation details that might have vastly different objectives. From my perspective, I would love to be able to publish events so that a user of any client could listen to the song(s) contained in the event and see any relevant metadata. I'm interested to hear if you have other use cases in mind. A few questions and points of clarification:
|
Sure, the goal of this nip is just to have a standard that everyone likes for publishing audio tracks. I think this probably requires that it be 1. replaceable, and 2. support multiple urls with different content types. So no current standard works yet. Of course there are slight differences between what exists so far:
But the three use cases have the same core, and should be interoperable. I would use a separate event kind referring to these base events to implement more targeted use cases if the distinction is really needed (probably only necessary for stemstr).
I of course recognize that existing apps probably won't migrate, and some apps probably won't even want to use this spec. The proprietary kinds can be supported if clients want access to that content, but continued development should go off a spec that will actually support everything. We could maybe work off of zapstr's kind 31337, but Edit: I managed to argue myself into hijacking zapstr.live's kind 31337 instead of creating a new kind. The |
Love to see the discussion on this. Yeah, Wavlake zaps ought to be updated now that the lud16 zap tag is no longer within spec. Wavlake zaps were implemented almost a year ago when the NIP-57 spec had this:
|
Very interesting, I didn't remember that. Maybe we should even bring this back, it seems useful for zapping people that don't have nostr accounts, which is what wavlake uses it for I believe. It probably shouldn't have been removed. But that's all orthogonal to this discussion anyhow. |
xx.md
Outdated
The following tags are optional: | ||
|
||
- `website` is an external url to a website related to the track. | ||
- `creator` is the pubkey (or plain text name) of the track author(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be indexable, probably a p
tag and if it's not a pubkey n
or something else; the use case of "more songs by this artist" is very normal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use "something else" instead of n
cause the tag is being used to add events to unbounded lists - set to the name of the list - like in this example.
In theory, any event kind, specially replaceable ones, would be able to use the n
tag for adding events to these lists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated this to use creator + p tag (creator so a mark can be added, p tag so that we have a standard format). This is slightly incompatible with zapstr's current p tags, but not enough to break anything (zapstr's role will be interpreted as a relay hint).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry about the missing relay hint
is the idea then that each creator will be tagged twice? once as a creator
and once as a p
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, so you can query by p
, but you can still tag people who weren't creators using p
tags. Without the creator
tag the semantics of p
becomes overloaded, so it's necessary to denote the person's role in contributing to the track (and support plaintext creator names, which wouldn't have an accompanying p tag).
Looks simple, I like it. But didn't read yet. |
@pablof7z it seems 31337 is used both in NIP 89 and for zapstr.live. Any preference for how to handle that collision? I think probably creating a new kind for this nip would probably be preferable. |
NIP 89 doesn't use it, it just mentions it as an example 😅 |
Oh hey, I didn't read closely enough, that's perfect. Back to using 31337. The one area of incompatibility is the For everyone else's reference, here's an example 31337 from zapstr.live to compare against the new spec: {
"id": "4688579eb15107da01fb2fcd43b4e72c32fd0d7f75673b543c8c1e7d0a3fcb74",
"pubkey": "38b405e49614835c083ae103398c510315c3a0366cfa27115995e79e92451058",
"created_at": 1693135050,
"kind": 31337,
"tags": [
["d", "wrh81br2ifcfq11un6ah8"],
["p", "38b405e49614835c083ae103398c510315c3a0366cfa27115995e79e92451058", "author"],
["c", "Electronic"],
["media", "https://nostr.build/av/b057855ba5c38a598575e231a82175801d97a0a013d90c6b5761c05a40fecdf4.mp3", "http"],
["cover", "https://i.ytimg.com/vi/MCe2pAIMAzg/maxresdefault.jpg"],
["subject", "PilotRedSun - useful"],
["zap", ""]
],
"content": "PilotRedSun - useful\n\nhttps://zapstr.live/t/naddr1qq2hwung8qckyu3jd9nxxen3xych2m3kv95rsqsqqvzqqqr6dyntly6j\n\nhttps://i.ytimg.com/vi/MCe2pAIMAzg/maxresdefault.jpg",
"sig": "e040023e0435b787a64ef9bddff1dd6d22808279ac1e05a090406484aace2734e81f5832df4051f3e53134248f78781fc3b7b40993935146913fa1a63fd39499"
} |
xx.md
Outdated
|
||
The following tags are optional: | ||
|
||
- `i` is an external GUID. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the distinction between this tag and the d
tag? In other words, what are some examples of needing both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally had it in the d
tag, but thought it might be useful to be able to change the GUID if a different standard is chosen, or include multiple guids (e.g. music vs podcast if a track qualifies as both).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recall there being an actual ["d", <value>]
(in the deprecated NIP-33), but I don't even see a reference to a d
tag in NIP-01.
Are d
tags used at all? Looks like the d
tag value only exists within the a
tag, but not as an actual tag itself.
I missed the d
tag in this PR... 😅
It is only mentioned here in NIP-01:
The a tag, used to refer to a (maybe parameterized) replaceable event
for a parameterized replaceable event:["a", <kind integer>:<32-bytes lowercase hex of a pubkey>:<d tag value>, <recommended relay URL, optional>]
for kind n such that 30000 <= n < 40000, events are parameterized replaceable, which means that, for each combination of pubkey, kind and the d tag's first value, only the latest event MUST be stored by relays, older versions MAY be discarded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so is an i
tag basically the new d
tag? Or does NIP-01 need to be updated to explicitly define the d
tag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i
and d
might be the same in some cases, but emerging best practices are to make d
tags random UUIDs with no semantic meaning. i
is a reference to an external source. In this case, it might even be beneficial to have more than one (multiple d
tags would result in undefined behavior).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if I understand you correctly, it sounds like the d
tag is mainly used as a way to identify the content contained in the event, and the i
tag(s) can be used to reference related content?
The way I see us using this is to put our internal content identifier guids in the d
tag and then use the i
tag(s) for any related content. For example, if a podcast contained some songs, the guid for the podcast would go in the d
tag and the song guids in the i
tags. At this time I don't see any reason to create and use another random identifier for d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if I understand you correctly, it sounds like the d tag is mainly used as a way to identify the content contained in the event, and the i tag(s) can be used to reference related content?
Yep, d
should not be semantic, because anything semantic can change, even if it's not supposed to. The approach you're suggesting makes a similar assumption to NIP 72, that a community's name will never change (the name is contained in the d
tag). A podcast GUID is going to be more stable, but the nature of conventions is that they change.
Also, i
isn't a new tag, it's described in NIP 39 using very similar semantics, so I think it's a good fit for this.
if a podcast contained some songs, the guid for the podcast would go in the d tag and the song guids in the i tags
Interesting idea, it would be hard to sort out if the i
tag is referring to the track itself or some other thing if it can do both. If that's useful, maybe we could use the same pattern I did with creator
and p
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I wonder if i
makes sense here. Based on NIP-39 and the i
tag being used for identities, I don't think it makes sense to use this tag for arbitrary id's. I'm still not totally clear on the use case for i
As for referencing other tracks that this piece of content might contain, that sounds like something we could add later as an extension of this NIP. I can see the eventual benefit but trying to get there now might add unnecessary complexity to this proposal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a different context, so it's ok if the meaning of i
varies a bit. The sematics of tags are defined by the kind the tag is applied to. We only have so many one-letter tags, better to re-use i than introduce a new one.
Not sure what the best practice is for this kind of thing, but since this is intended to be a parameterized replaceable event: would it be helpful to add the From the NIP-01 spec: |
Just so people know what it looks like to |
If you're up for it @staab we could publish some test events using this draft spec and see how it behaves in practice |
Go for it! I'm hoping to hit this in the next week or two. If you want to use Ainsley's music as a pilot I think that would be awesome. |
I've just published a test event of one of Ainsley's tracks according to this draft spec, event id: Let me know how it works @staab , and if you have any questions or feedback. |
Few questions: What's the a tag in this event? |
Mostly repeating what @pablof7z said:
|
Thanks @staab and @pablof7z Just pushed up a revised event. Per your questions/comments:
Additionally, I think it might be useful to add a |
I can't argue with this, but be aware that there probably aren't any clients that support the current format.
This is an interesting idea, but I'm inclined to think it's not a good solution. If we're going to support multiple formats, we should just create a new kind. Shifting specs are bad, and while I haven't paid much attention to it in the past I think we should be more careful about changing stuff in incompatible ways going forward. |
I'm not seeing anything; this link just takes me to NostrAinsley with nothing in the feed?
Also, Wavlake can't publish video so I think I'd need to host it at that paid relay site? I can't remember what you had recommended, pretty sure we let it lapse?
…________________________________
From: hodlbod ***@***.***>
Sent: Thursday, June 20, 2024 1:06 PM
To: nostr-protocol/nips ***@***.***>
Cc: Phantom-Power-Music ***@***.***>; Manual ***@***.***>
Subject: Re: [nostr-protocol/nips] Add audio track NIP (PR #1043)
Awesome, I've created a feed that pulls this event (really, anything by Ainsely published by wavlake). You can view it here:
https://coracle.social/notes/naddr1qvzqqqrujgpzp978pfzrv6n9xhq5tvenl9e74pklmskh4xw6vxxyp3j8qkke3cezqyd8wumn8ghj7urewfsk66ty9enxjct5dfskvtnrdakj7qg4waehxw309aex2mrp0yhxgctdw4eju6t09uq3camnwvaz7tmgdajxccn0vshxxmmjv93kcefww3hk7mrn9uqsuamnwvaz7tmwdaejumr0dshsqyfn8yerwd3jxcenxdej8qmnjvfsxcpmdvgf
—
Reply to this email directly, view it on GitHub<#1043 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BDOV7MT4WUKZMP2Y6YRM3OLZIMKZXAVCNFSM6AAAAABDFQQBW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBRGI2TGMJTG4>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
@staab Thanks for this! We are going to be using it. We'll utilize kind tags: [
["price", "1234", "SATS"]
["encrypted", "ChaCha20"]
// ... and an i tag linking to the podcast:guid:<guid> in addition to the i tag linking to the episode
] |
For anyone wondering, I was curious about kind 1808 and after searching on nostr.band found that it's used by stemstr.app for audio stems. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love the simplicity of this proposal, just a few comments...
I split tracks into music vs podcast, @MerryOscar @arkin0x let me know if that messes anything up for you. |
Might be worth updating NIP-73 with some of the external formats for audio tracks? |
Fewer formats is probably better, especially if they're proprietary ids that are platform-specific (this is partly why the url hint component of nip 73 tags was added). But music brainz seems reasonable to add — would you be willing to open a separate PR for that? Also, @blastshielddown @MerryOscar is this in production and ready for merge? |
["title", "Platinum Robots on the Moon"], | ||
["subject", "Platinum Robots on the Moon"], | ||
["published_at", "<published_at>"], | ||
["imeta", "url https://example.com/my-track.m3u8", "x <hash>", ...] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@staab I'd like to include the podcast artwork as well as the individual episode artwork. What would be an example of how to include track artwork and podcast artwork and distinguish meaningfully between them so the client knows which is which?
For example, when looking up a podcast episode via Podcastindex API, they provide an image for the episode and the podcast image as well. Sometimes they are the same if the podcast does not have unique artwork per episode, but they can be different.
Would we differentiate this using summary or alt from NIP-94? (Seems a little messy)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For that matter, how do we indicate streaming vs download using an imeta tag?
Multiple
imeta
tags MAY be included to provide for different use cases (e.g. streaming vs download).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If necessary, we could add an attribute to imeta, something like content disposition
, e.g. ["imeta", "url https://example.com/cover.png", "x <hash>", "disposition cover"]
. For streaming vs download we could do the same thing, but in the near term I think it'll be clear enough which url to use for what, m3u8 is suitable for streaming, mp4 for download for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good to me
The following tags are optional: | ||
|
||
- `i` is an external GUID in the format defined [here](https://github.com/MerryOscar/nips/commit/280eb498e0ac56b8f9356c1b7a88cc8b31579801). | ||
- `c` is the track's value as defined by a given category. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems too vague. Also, the category should definitely be the mark:
["c", "genre", "Pop"]
not
["c", "Pop", "genre"] <<< this is backwards compared to most other tags :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://soundcharts.com/blog/music-metadata might provide helpful insight on doing this right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
["c", "Pop", "genre"] <<< this is backwards compared to most other tags :(
This looks backward, but like with NIP 32 the intention is to be able to index the value, rather than the key. It's more important to be able to filter by category values (e.g. #c: ["Pop"]
) than to filter by what categories are defined.
Also added a list of categories to the NIP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's more important to be able to filter by category values (e.g. #c: ["Pop"]) than to filter by what categories are defined.
That's a good point. Too bad this makes the event.getMatchingTags function in NDK totally useless for parsing these audio events, but I can implement my own tag parsing.
Thanks for adding those categories.
I'd like to see more clarification around the imeta disposition and other podcasting 2.0 features that are missing from this spec, such as defining timestamps and artwork changing based on those timestamps. I can work on it but I wanted to see what others thought. In it's current form, this NIP doesn't really provide a full equivalent for RSS-based podcasts. |
I think we should merge this, then add additional features in additional NIPs. This is a good core feature set, and is far short of replacing podcasting 2.0, which I'm not sure is quite the same project. |
@blastshielddown @MerryOscar just waiting on a final review from you guys. |
|
||
The following tags are required: | ||
|
||
- `d` is a unique identifier randomly generated by the client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the publishing client will randomly generate the d
tag? Can the GUID in the optional i
tag be used here as the d
tag value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it should be random. Meaningful d-tags are an antipattern, since you can't really anticipate when something might change, even guids.
This NIP defines several new event kinds representing different types of audio track. These events | ||
are _parameterized replaceable_ as defined in [NIP-01](./01.md) and deletable per [NIP-09](09.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being replaceable events, I assume there is no way to change the pubkey (author) of future events, since replaceable events are dependent on the original event's pubkey.
I'm thinking through the problematic scenario of publishing audio tracks under a general Music Feed pubkey, and later supporting an Artist's ability to self-publish their audio tracks using their own pubkey, if/when they are onboarded to nostr and take custody of their own private key.
I suppose the older audio track event can be deleted when this happens, leaving the new Artist's self-published event? In this case, should the d
tag be re-used or randomly re-generated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, in that scenario you'd probably want to just delete the events and publish new ones. D tag persistence shouldn't matter because the pubkey would be changing anyhow.
- `bpm` | ||
- `year` | ||
|
||
Note that artists, producers, SHOULD be referred to using both a plaintext `c` tag AND a conventional `p` tag when pubkey is available. When doing so, the `p` tag's petname MUST be the same as the `c` tag's value. In this way `c` tags can be used to indicate genre, as well as artist, producer, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the consequences of a p
tag's petname not matching a c
tag's value?
If a pubkey updates their petname, must these audio tracks be replaced with an updated version to reflect the new petname to avoid a mismatch of p
and c
tags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Petnames are arbitrary, and aren't assigned by the pubkey owner. If they don't match, then clients would have to treat the c
tag as an arbitrary string and the p
tag as a normal mention.
Prior art:
32123
published by wavlake do zap splits wrong and are not published by the artist. Metadata is also json-encoded in the content.31337
is published by zapstr.live and includesc
tags which could be added here, althought
probably would suffice. Themedia
tag is missing lots of possible metadata.subject
could be a good alternative totitle
.1808
isn't replaceable, but includes different urls for download/stream, hash, and waveform.This NIP relies on conventions established by NIPs 94 and 92 to support multiple urls and complete metadata simultaneously. It's extremely minimal, and can easily be extended to support:
t
, orc
tag)