Skip to content
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

Typed schemes. #1539

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vitorpamplona
Copy link
Collaborator

I am trying to figure out a way to allow micro clients to register only the event types they support on Android/iOS.

Then if we use these URIs when opening external events, a more appropriate client list can be recommended by the OS.

Today, all the dozens of clients pop up and the OS can only have one of them as the default for the nostr: URI.

The more we go into the direction of mini and micro clients, the more we will need something like this.

Copy link
Member

@staab staab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes sense. It has the nice side benefit of allowing entity embeds in content to include the event kind. It will require parsers to be updated, but in a pretty minimal way. And it gives us infinite content-type granularity.

Copy link
Member

@pablof7z pablof7z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea

@alexgleason
Copy link
Member

I am kind of against this. IF we do it, we should use nostr+<kind>: eg nostr+1: as the protocol, so it at least matches the existing URI standard of web+ scheme prefix. This would improve parsing sanity going from .startsWith('nostr') to .split('+')[0] == 'nostr'. I think this is a requirement for this scheme to make sense.

It's very uncommon for numbers to be in the protocol part of a URI, and very uncommon to have dynamic protocol schemes at all. But at least with web+ there's some prior art to go by.

The reason I think we shouldn't do it is because it's bloat. It's unfortunate that deep links are so limited, and that it ultimately harms UX, but this is not the first time I've encountered this problem. I am more annoyed that Apple and Google don't improve their system, and then force us to make decisions like this or punt the problem to the user. It's not a problem with Nostr URIs themselves.

These URIs introduce a new validation burden. What do you do if the kind in the nostr+ prefix doesn't match the kind in the naddr or nevent data? Do you take the protocol kind and ignore the bech32 kind, or take the bech32 kind and ignore the protocol kind? When you route the protocol in your client, are you already expecting to render a specific kind but then accidentally render a different kind? This will create a burden on developers and inconsistencies between clients. This is the biggest reason I think we shouldn't do it.

@vitorpamplona
Copy link
Collaborator Author

vitorpamplona commented Oct 15, 2024

Updated to add the +

What do you do if the kind in the nostr+ prefix doesn't match the kind in the naddr or nevent data?

Just ignore it just like you would in the regular nostr: call. The type in the scheme should be understood exactly like a relay hint. It could be correct, but you can't rely on it for anything.

But agree: Apple and Google suck at this. Although I don't see a much better picture on the desktops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants