Skip to content

Conversation

@fiatjaf
Copy link
Contributor

@fiatjaf fiatjaf commented Nov 2, 2024

Not very well tested yet, but seems to work. I'll leave this here just in case.

One thing that is puzzling me is that even though this works with NIP-46 Nostter still prompts me to authorize stuff from nos2x. Do you know if there is some other weird place where it could be calling that? It isn't happening in the Signer object.

@fiatjaf fiatjaf requested a review from SnowCait as a code owner November 2, 2024 05:06
@vercel
Copy link

vercel bot commented Nov 2, 2024

@fiatjaf is attempting to deploy a commit to the snowcait's projects Team on Vercel.

A member of the Team first needs to authorize it.

@fiatjaf
Copy link
Contributor Author

fiatjaf commented Nov 2, 2024

Yes, this seems to work fine. Except I can't see the posts I just made using a new bunker. I can see them in other clients though, so seems to be a different issue.

@fiatjaf
Copy link
Contributor Author

fiatjaf commented Nov 2, 2024

Hmm, yeah, when the bunker doesn't support nip04 things go bad. Could that be it?

I tried with two bunkers, one supporting nip04_encrypt/decrypt, and it worked perfectly. The other didn't, so I could still write posts, but my own posts were not showing for me.

@vercel
Copy link

vercel bot commented Nov 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nostter ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 5, 2024 10:04am

@SnowCait
Copy link
Owner

SnowCait commented Nov 3, 2024

Thanks!

One thing that is puzzling me is that even though this works with NIP-46 Nostter still prompts me to authorize stuff from nos2x. Do you know if there is some other weird place where it could be calling that? It isn't happening in the Signer object.

It might be NIP-42 AUTH.
I'm using the authenticator: "auto" option of rx-nostr which signs kind 22242 automatically, and maybe it has a bug that cannot switch signer because I don't set signer option yet. I'll look into it a bit more.
https://github.com/fiatjaf/nostter/blob/088439ebafd371e762497855bb1030f517b2048e/web/src/lib/timelines/MainTimeline.ts#L52

@fiatjaf
Copy link
Contributor Author

fiatjaf commented Nov 3, 2024

Oh, by the way, I've included this weird @nostr/tools library to avoid updating the nostr-tools you have, which is a very old v1 version. I think this could help too if you want to slowly switch from nostr-tools into @nostr/tools in the future, but keep both around while the transition isn't fully complete.

@SnowCait
Copy link
Owner

SnowCait commented Nov 3, 2024

Yes, I'm still using the old SimplePool for logging and can't upgrade the version unless I switch to rx-nostr because the latest version of SimplePool can't output logs.
Anyway, it's interesting and helpful how the versions can coexist. TIL

storage.set('nip46clientSecret', bytesToHex(ks));
}

bunkerSigner = new BunkerSigner(ks, bp);
Copy link
Owner

Choose a reason for hiding this comment

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

I'm testing with nsec.app, but I can't log in.
If I add await bunkerSigner.connect(); here, the first login is successful, but subsequent logins fail.
Do you know what's going on?

Bunker URL is bunker://***?relay=wss://relay.nsec.app&secret=***.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll try with nsec.app. I never try anything with it because every time I try to use it I get some weird browser-related problem, but maybe it is good now. Thank you for trying.

@SnowCait
Copy link
Owner

SnowCait commented Nov 6, 2024

I fixed NIP-42 signer bug by #1505.
Please merge the main branch if necessary.

@fiatjaf
Copy link
Contributor Author

fiatjaf commented Nov 8, 2024

I wish there was a way to schedule browser tabs to reappear after a while. I'll have to close this one now and because that doesn't exist I'll have to rely on my memory to open this again next week. Wish me luck.

# Conflicts:
#	web/package.json
#	web/src/lib/Signer.ts
#	web/src/lib/stores/Author.ts
@SnowCait
Copy link
Owner

I updated nostr-tools to the latest version and merged it into this branch.
I tried again hoping that it had been fixed on the nsec.app side, but it didn't work.

@fiatjaf
Copy link
Contributor Author

fiatjaf commented Apr 19, 2025

One day everything will be fixed.

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.

2 participants