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

Bech32 encoded relay entities (NIP-19) #196

Merged
merged 3 commits into from
Jan 27, 2023
Merged

Conversation

Semisol
Copy link
Collaborator

@Semisol Semisol commented Jan 27, 2023

the main purpose for this to be included as a nostr: URI.

some design choices:

  • type 0 is reserved for relay since a relay type already exists (1)
  • only one relay can be included in the encoded entity so that if metadata is added in the future there is no confusion on which relay it applies to.

@Semisol Semisol changed the title Bech32 encoded relay IDs Bech32 encoded relay entities Jan 27, 2023
@fiatjaf
Copy link
Member

fiatjaf commented Jan 27, 2023

I don't know, it feels to me that using type 0 for the relay URL is better in this case.

Do you have a use case for this? Why not pass just relay URLs directly?

@Semisol
Copy link
Collaborator Author

Semisol commented Jan 27, 2023

Do you have a use case for this? Why not pass just relay URLs directly?

"the main purpose for this to be included as a nostr: URI."

Cameri proposed using a bech32 encoded entity. I don't know how we would do this without encoding. nostr+relay://nostr-pub.semisol.dev? nostr:relay:wss://nostr-pub.semisol.dev? just passing around raw URIs?

Also, with a bech32-encoded entity you could pass around things like if you recommend the relay to be just used for reading, if the relay should be kept secret (stored in an encrypted event), if there's a relay password and so on.

unrelated: we may want a spec for encrypted relay lists.

I don't know, it feels to me that using type 0 for the relay URL is better in this case.

I eventually intend on making each type have meanings based off of the prefix: type 1 could be something else for an entity that doesn't need relays.

@fiatjaf
Copy link
Member

fiatjaf commented Jan 27, 2023

"the main purpose for this to be included as a nostr: URI."

I see, I haven't really read that part, sorry. I agree then.

I eventually intend on making each type have meanings based off of the prefix: type 1 could be something else for an entity that doesn't need relays.

Another reason to use 0 for the relay URL in this case.

@Semisol
Copy link
Collaborator Author

Semisol commented Jan 27, 2023

please squash merge, thanks

@fiatjaf fiatjaf merged commit 524ff9b into master Jan 27, 2023
@fiatjaf fiatjaf deleted the bech32-encoded-relays branch January 27, 2023 17:49
@fiatjaf fiatjaf changed the title Bech32 encoded relay entities Bech32 encoded relay entities (NIP-19) Jan 27, 2023
@barkyq
Copy link
Contributor

barkyq commented Feb 12, 2023

ndelegationtoken? might be nice to have, presumably ppl will want to copy paste these between apps.

@staab staab mentioned this pull request Jul 21, 2024
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