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

NIP 17 - Private Direct Messages / NIP 42 - Relay Auth #38

Merged
merged 10 commits into from
Oct 22, 2024
Merged

NIP 17 - Private Direct Messages / NIP 42 - Relay Auth #38

merged 10 commits into from
Oct 22, 2024

Conversation

prolic
Copy link
Collaborator

@prolic prolic commented Oct 18, 2024

Implement NIP-17 and NIP-42

This PR introduces support for NIP-17 (Private Direct Messages), NIP-42 (Authentication of clients to relays) and significantly refactors our Nostr-related effects for improved modularity and maintainability.

Key changes:

  • Added GiftWrap and Seal event kinds for encrypted messaging
  • Introduced a new Nostr effect to centralize Nostr operations
  • Created a Subscription effect to manage Nostr subscriptions
  • Refactored the GiftWrap handling to support group chats
  • Reorganized modules and simplified effect structure
  • Improved chat UI and integrated it with FollowList

- Implement Chat.ui.qml with dummy data for testing
- Update FollowList to load Chat UI on item click
- Adjust layout and styling for better user experience
- Update chat UI colors to ensure visibility in both light and dark modes.
- Add equality test to the follow list model for better item comparison.
- Improve profile button styling for consistency with Material Design.
- Add GiftWrap and Seal event kinds
- Implement encryption/decryption for direct messages
- Update event handling to process encrypted messages
- Add chat UI elements and message display
- Refactor filters for more flexibility
@prolic prolic added the enhancement New feature or request label Oct 18, 2024
- Move effects into their respective modules
- Rename Nostr.Effects.* to Nostr.*
- Combine IDGen and CurrentTime into Util effect
- Add Nostr.GiftWrap module
- Update chat handling to support group chats
- Refactor event processing in Futr.hs
- Remove unused Nostr.Subscription module
- Update AppState to use [PubKeyXO] for chat keys
- Add Nostr.Subscription module with new Subscription effect
- Move subscription-related functions from Futr to Subscription
- Add Nostr module with effect definitions and handlers
- Update cabal file to include new Nostr module
- Refactor KeyMgmt and GiftWrap to use Nostr effect
@prolic prolic changed the title NIP 17 - Private Direct Messages NIP 17 - Private Direct Messages / Nostr Effects Monad Oct 19, 2024
src/Futr.hs Outdated
now <- getCurrentTime
let pubKeyXO = keyPairToPubKeyXO kp
rumor = createRumor pubKeyXO now ShortTextNote (map (\xo -> PTag xo Nothing Nothing) xos) input
giftWraps <- catMaybes <$> forM xos (\xo -> do
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this creates wrong giftwraps, they need to be specific for each receiver

- Add support for canonical authentication (Kind 22242)
- Handle AUTH challenges from relays
- Update createGiftWrap to return KeyPair
- Refactor message handling and error reporting
- Update default relay list
@prolic prolic changed the title NIP 17 - Private Direct Messages / Nostr Effects Monad NIP 17 - Private Direct Messages / NIP 42 - Relay Auth Oct 22, 2024
@prolic prolic merged commit 3a4122c into master Oct 22, 2024
1 of 2 checks passed
@prolic prolic deleted the chat branch October 22, 2024 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant