ndk icon indicating copy to clipboard operation
ndk copied to clipboard

Support NIP-44

Open dongshu2013 opened this issue 2 years ago • 7 comments

looks like NIP-04 is deprecated in favor of NIP-44. Would love to see that to be supported.

dongshu2013 avatar Dec 21 '23 17:12 dongshu2013

NIP-44 is just an encryption scheme, not a DM standard.

fiatjaf avatar Dec 21 '23 19:12 fiatjaf

right but I see we provided some help functions of NDKEvent for nip04 at https://github.com/nostr-dev-kit/ndk/blob/master/ndk/src/events/nip04.ts, would be helpful if we can have similar interfaces built for nip44. The NIP04 doc says now NIP04 is unrecommended in favor of NIP44

dongshu2013 avatar Dec 22 '23 18:12 dongshu2013

Yup – this definitely needs to be added.

erskingardner avatar Apr 09 '24 19:04 erskingardner

right ... I'm gonna get started on this ... along with consideration for an NDKNip49Signer by refactoring the encrypt() and decrypt() entrypoints.

  • I will rename the file ndk/src/events/nip04.ts to encryption.ts, and refactor it's functions encrypt() and decrypt() to accept an optional method param (or something like this) where one can specify 'what kind of encryption should be done.
  • I will also add this optional method param to the encrypt() and decrypt() methods of this interface NDKSigner which implementing classes MAY make use of.
  • I will also be refactoring the NDKNip07Signer class, replacing nip04 with encryption in a number of method names.

just saying ... encryption is the new term replacing nip04, when it comes to "what signers do when they 'encrypt' or decrypt notes and other stuff"

manimejia avatar Jun 02 '24 20:06 manimejia

Here's the solution I've come up with to implement Nip44 in NDKSigners. Please test this PR. https://github.com/nostr-dev-kit/ndk/pull/233

manimejia avatar Jun 04 '24 15:06 manimejia

I'm working on a PR to add NIP44 encryption and NIP59 gift wrap functionality to NDKEvents and NDKSigners. Will be pushing this weekend. Hoping to run this in my production client ASAP. Reviews and testing is welcome.

https://github.com/nostr-dev-kit/ndk/pull/233

manimejia avatar Jun 07 '24 15:06 manimejia

@manimejia Leaving comments on the PR.

erskingardner avatar Jun 08 '24 08:06 erskingardner