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

Enable Private Relays [500,000 sats] NIP-42 #940

Closed
alltheseas opened this issue Apr 16, 2023 · 21 comments
Closed

Enable Private Relays [500,000 sats] NIP-42 #940

alltheseas opened this issue Apr 16, 2023 · 21 comments
Labels
bounty Sats feature New feature request NIP

Comments

@alltheseas
Copy link
Collaborator

alltheseas commented Apr 16, 2023

User Story

As a Damus user who wants to connect with a particular group of nostriches privately, I want to be able to connect to a private relay, so that I can read and share notes only with a specific group of nostriches.

Acceptance Criteria

  1. Damus user can connect to a private relay
  2. Damus user has a method to provide authentication details to a private relay
  3. Damus user can check visually if they are successfully connected to the private relay
  4. Damus user can remove a private relay
  5. Damus user can de-authenticate from a private relay

implementation details
NIP-42

relates to
#453

Origin: https://damus.io/note1c6khgk6phxzhq7hh2v32nhzrvlyn4y2ctk6h0kgtgfrgrh7y7e5qma8ykl

@nostr-wine
Copy link

We'll offer a 500k sats bounty per client for this feature.

@alltheseas alltheseas changed the title Enable Private Relays [feature request] Enable Private Relays [feature request][500k sats] Apr 17, 2023
@LouisLibre
Copy link
Contributor

Is there a private relay where we can test out the implementation?

@nostr-wine
Copy link

Yes! You can use wss://filter.nostr.wine or wss://nostr.kollider.xyz

@nostr-wine
Copy link

Any takers?

@jb55
Copy link
Collaborator

jb55 commented Apr 26, 2023

I’ll do this soon

@nostr-wine
Copy link

Thanks Will! Much appreciated.

@alltheseas alltheseas added the bounty Sats label Jun 26, 2023
@alltheseas alltheseas changed the title Enable Private Relays [feature request][500k sats] Enable Private Relays [500k sats] Aug 19, 2023
@alltheseas alltheseas added the feature New feature request label Sep 25, 2023
@alltheseas alltheseas changed the title Enable Private Relays [500k sats] Enable Private Relays [500k sats] NIP-42 Nov 9, 2023
@alltheseas alltheseas changed the title Enable Private Relays [500k sats] NIP-42 Enable Private Relays [500,000 sats] NIP-42 Nov 9, 2023
@alltheseas alltheseas added the NIP label Nov 9, 2023
@fishcharlie
Copy link
Contributor

@jb55 You mentioned that you'll do this soon a while back. Are you working on this?

If not, I'd love to take a shot at contributing and trying to implement this. I'll keep everyone updated on my progress here.

But I don't wanna step on your toes @jb55 if you're already working on it.

@alltheseas
Copy link
Collaborator Author

Go for it @fishcharlie

@fishcharlie
Copy link
Contributor

Awesome. I'll start looking into this this evening and hopefully will have something sometime this week to show.

@fishcharlie
Copy link
Contributor

fishcharlie commented Dec 19, 2023

https://groups.google.com/a/damus.io/g/patches/c/NIDfecrJN_g

@jb55
Copy link
Collaborator

jb55 commented Dec 21, 2023

it looks pretty good! I just need a way to test it.

@nostr-wine
Copy link

If you're looking for relays, here are two different AUTH flows:

wss://filter.nostr.wine - AUTH on connect, only allows paid pubkeys are accepted
wss://nostr.wine - AUTH on kind 4 REQs, allows all pubkeys

@jb55
Copy link
Collaborator

jb55 commented Dec 22, 2023

@fishcharlie maybe we could have some tests for these relays?

@fishcharlie
Copy link
Contributor

@jb55 Open to that idea. My question would be does Damus have any tests currently that depend on 3rd party relays? Not saying that @nostr-wine won't survive for a long time to come. But that is a pretty major dependency that we'd be introducing to the Damus test suite.

It might be better to just mock the requests and replies. But I'm open to creating a connection to those relays if you want.

@fishcharlie
Copy link
Contributor

For the time being I'm currently working on writing a test that verifies that based on the objects that the correct message is generated.

Similar to RequestTests.swift testMakeUnsubscribeRequest (but for the auth).

@jb55
Copy link
Collaborator

jb55 commented Dec 22, 2023 via email

@fishcharlie
Copy link
Contributor

@jb55 Sounds good. I'll work on that and let you know when I have an update.

@fishcharlie
Copy link
Contributor

fishcharlie commented Dec 24, 2023

@jb55 Added some tests: https://groups.google.com/a/damus.io/g/patches/c/Zx3dk01e0yg. Also added NIP-42 to the README since I forgot to do that originally.

Let me know what you think 😃

jb55 pushed a commit that referenced this issue Jan 5, 2024
Lightning Invoice: lnbc1pjcpaakpp5gjs4f626hf8w6slx84xz3wwhlf309z503rjutckdxv6wwg5ldavsdqqcqzpgxqrrs0fppqjaxxw43p7em4g59vedv7pzl76kt0qyjfsp5qcp9de7a7t8h6zs5mcssfaqp4exrnkehqtg2hf0ary3z5cjnasvs9qyyssq55523e4h3cazhkv7f8jqf5qp0n8spykls49crsu5t3m636u3yj4qdqjkdl2nxf6jet5t2r2pfrxmm8rjpqjd3ylrzqq89m4gqt5l6ycqf92c7h

Closes: #940
Signed-off-by: Charlie Fish <contact@charlie.fish>
Signed-off-by: William Casarin <jb55@jb55.com>
jb55 pushed a commit that referenced this issue Jan 5, 2024
Lightning-Invoice: lnbc1pjcpaakpp5gjs4f626hf8w6slx84xz3wwhlf309z503rjutckdxv6wwg5ldavsdqqcqzpgxqrrs0fppqjaxxw43p7em4g59vedv7pzl76kt0qyjfsp5qcp9de7a7t8h6zs5mcssfaqp4exrnkehqtg2hf0ary3z5cjnasvs9qyyssq55523e4h3cazhkv7f8jqf5qp0n8spykls49crsu5t3m636u3yj4qdqjkdl2nxf6jet5t2r2pfrxmm8rjpqjd3ylrzqq89m4gqt5l6ycqf92c7h
Closes: #940
Signed-off-by: Charlie Fish <contact@charlie.fish>
Signed-off-by: William Casarin <jb55@jb55.com>
Changelog-Added: Add NIP-42 relay auth support
@jb55 jb55 closed this as completed in 84cfeb1 Jan 5, 2024
@jb55
Copy link
Collaborator

jb55 commented Jan 5, 2024

bounties can be paid to: fishcharlie@strike.me

@nostr-wine

@nostr-wine
Copy link

Paid! Awesome work @fishcharlie, thanks for merging @jb55.

@fishcharlie
Copy link
Contributor

Thank you @nostr-wine! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty Sats feature New feature request NIP
Projects
Status: No status
Development

No branches or pull requests

5 participants