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

nostr implementation and signer improvement #103

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

riccardobl
Copy link
Contributor

@riccardobl riccardobl commented Feb 27, 2025

signer abstraction

Signer are abstracted to a common interface ( NostrSigner ) so that they can be initialized once (on login/registration) and then passed around the app without worrying about their nature.
It removed the need to branch and duplicate the code for every signer type ie.

 if(signMethod=="..."){
...
}else if(....){
...
} 

signer challenges

At any time signers can trigger a challenge that will automatically open a modal with the instructions to complete it, following the reactive flow model.
This is used to implement nip46 auth challenge and also to request nsec passphrases.

All the input fields requesting the passphrase for signMethod=="nsec" have been removed, since the signer can request it on its own via the challenge, making the code slimmer.

option to remember the nsec passphrase

small quality of life improvement

improved nostr managment

A new NostrManager and nostr context are used to manage connections lifecycle and a fetch() method that autocloses the subscriptions on eose has been added.
Every event is now verified by NostrManager, so there is no need to call verifyEvent every time anymore.

@riccardobl riccardobl changed the title nostr implementation improvement nostr implementation and signer improvement Mar 8, 2025
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.

1 participant