-
Notifications
You must be signed in to change notification settings - Fork 101
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
Nip44 Encryption & Nip59 Gift Wrapping #233
base: master
Are you sure you want to change the base?
Conversation
also some buigfiixes for encryptionEnabled() UNTESTED : this commit has not been tested yet.
Im having a hard time testing this. Can't run test scripts locally and can't run this fork (via git) as dependency of my existing project. Maybe I'm a dunce, but I have no way of "testing" this code at the moment. Please help? @erskingardner @pablof7z |
I started working on the same Nip44 encryption for Signers yesterday. Before starting I checked there was no PR. Now I just saw your PR. I completed the implementation earlier in the morning but I have been testing this since then. Initially, I had no idea how to test this but I remembered that we can create an installable file by running First run copy the whole file path and go to some other project where you use this ndk and run |
I'm just now adding NIP59 (gift wrap) support to encryption.ts. This will make a "feature complete" implementation of best practices for (private message) event encryption, using NDKEvent. |
During some testing, I observed that this statement always returns false. I provided a hex string and it returned false, which is logical as it's not an instance of the String class. Should I create a separate issue for this, or can it be fixed in this pull request? |
@sabhas issues with instantiation of NDKNip46Signer would not be covered by this PR ... until I start messing around with implementing NIP44 encryption for NDKNip46Signer ... which I have not yet. |
So, we'll have to wait for another PR that will support nip44 encryption for NDKNip46Signer. |
@sabhas probably. Only because I have a release deadline for my own project, that requires "gift wrapped" direct messages, but does not implement Nip46 (remote signing). |
@manimejia I agree that the issue I highlighted is not relevant to nip44 encryption. |
@sabhas yes it would make sense. But TBH, I have not wrapped my head around Nip46, and NDK implementation yet. So I table it. I'm under a deadline (working unpaid hours) to get a release pushed so that I can maybe raise some funding to continue work. So time is critical, and THIS pr will be limited. Thanks. |
I like the approach of trying to keep the Long term I think we probably want to refactor all the encryption code into their own modules/etc. so that we can continue to add different types of encryption but for now this is probably ok. @pablof7z thoughts? |
I am following @sabhas suggestion for testing.
I am testing now for NIP44 and NIP59 functionality. Some bugs to iron out. |
coppied Nip44 test for encrypt and decrypt new Nip59 test for gift wrap and unwrap
I just added some tests, but I'm not (yet) sure how to get
I've tried to get to the bottom of this... but I don't have a clue how encryption can succeed but decryption fails. This is where I'm stuck for now. |
Bump. Still stuck. Eager to get this PR merged. Any feedback? @erskingardner @pablof7z |
Hey @manimejia sorry for the delay. I've been deep down an MLS rabbit hole. I'll have a look through this PR properly tomorrow morning. |
We can drop a $210 bounty on this if you can add NIP46 / nsecbunker signing support.. ? |
@manimejia Overall this looks good to me. From what I could see, this defaults to using NIP-04 encryption so we're not breaking anything for library users. I do think that we need to cover remote signers before we can merge this PR though. |
@erskingardner before I move on to Nip46 support, I need to make sure what I've built already works. See above for my troubles in testing. Do you have suggestions or help for me to get this working "as it is"? |
@sigit-io i will tackle this as soon as I can test my existing contribution. See above comment. Thanks for the generous offer. |
Hi everyone, it seems the work on this PR is paused since the end of June. I'm interested in concluding this or cooperate if you agree. From my understanding after a first look, support for NIP-46 must still be added to conclude the PR. I think finishing this is important to make NIP-17 DMs available for NDK developers. What are your thoughts on this? |
Hi -- I'd love to have GiftWrap support; I haven't had a reason to do it yet, but NIP-44 is supported in NDK. Would love to see GW and NIP-17 DMs added! |
I merged the current master branch from ndk in my feature branch and fixed some small errors. But I'm stuck running the tests. It seems some configuration for jest is missing, I get compile errors when running
How can I run the tests? |
I decided to jump forward to the current state of the master branch instead of trying to use this old branch. But I can't run the jest tests successfully at this clean master state.
Some of the tests failing are:
I'm running under node 20.17.0 and I run |
Hi everyone, for your information, I just activated a new PR (#279) which is a continuation (imo a replacement) of the work done in this one. I'm looking forward to your feedback. |
@manimejia / @rodant - feel free to jump onto https://chat.nostrdev.com to discuss that bounty |
This code is being tested.