-
Notifications
You must be signed in to change notification settings - Fork 204
feat: encrypted image upload in chat #2382
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
base: main
Are you sure you want to change the base?
Conversation
KoalaSat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great so far! I;m not sure if I missed it but are we checking the file is an image? I would try to avoid people somehow sending malicious files
Good catch! added a strict check to block anything that isn't an image (like .exe or .sh etc) to be safe. |
| }); | ||
| }, [federation.roboPool, garage, handleNostrEvent]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need for this subscription, look for these events in https://github.com/RoboSats/robosats/blob/main/frontend/src/contexts/FederationContext.tsx#L53
Probably you can also simplify handleNostrEvent with it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Refactored to use notifs from FederationContext instead of creating a duplicate subscription. Much cleaner now!
|
Good news @keshav0479 , our friend @TempleOfSats already have it up and running, in case you want to test it further with a real coordinator: http://ngdk7ocdzmz5kzsysa3om6du7ycj2evxp2f2olfkyq37htx3gllwp2yd.onion/blossom/ |
This is awesome, thanks @KoalaSat and @TempleOfSats! i'll give it a spin via Tor and report back. |
You can use testnet if you have it, if not, then your only option is to actually create a real trade with yourself. But a node is not necessary, just some funds to move forward. |




What does this PR do?
Fixes #1206
Hi @KoalaSat ,
This PR implements the encrypted image upload feature for the trade chat. As we discussed, I've implemented the full flow using XChaCha20-Poly1305 for encryption and BUD-01/02 for Blossom authentication.
What's Implemented
@noble/ciphers).Testing Status
I've verified the core logic extensively:
Note: I wasn't able to complete a full "click-to-upload" test in the live chat UI locally because setting up a fully funded Lightning node for the trade flow was a bit of a blocker. The logic is good, but I'd love it if we could verify the final UI integration on a testnet coordinator!
Looking forward to your feedback!
Checklist before merging
pip install pre-commit, thenpre-commit install. Pre-commit installs git hooks that automatically check the codebase. If pre-commit fails when you commit your changes, please fix the problems it points out.