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

Do you have an example of transferring pictures? #175

Open
yopoing opened this issue Dec 27, 2022 · 8 comments
Open

Do you have an example of transferring pictures? #175

yopoing opened this issue Dec 27, 2022 · 8 comments
Assignees

Comments

@yopoing
Copy link

yopoing commented Dec 27, 2022

Does waku support sending pictures and files? I think status.im supports image sending, but I can't find an example. How can I implement this?thanks!

@weboko weboko self-assigned this Jan 4, 2023
@weboko
Copy link
Contributor

weboko commented Jan 4, 2023

Currently we do not have any examples of transferring files.
If your image can be encoded into base64 - you can send it as text but if you are looking for a way to send files in general, then theoretically, it is possible to do so by sending binary data.

@fryorcraken maybe you can advise here?

TODO for myself:

  • provide an example with sending files capability;

@yopoing
Copy link
Author

yopoing commented Jan 5, 2023

Currently we do not have any examples of transferring files. If your image can be encoded into base64 - you can send it as text but if you are looking for a way to send files in general, then theoretically, it is possible to do so by sending binary data.

@fryorcraken maybe you can advise here?

TODO for myself:

  • provide an example with sending files capability;

Thanks a lot. I now use base64 to transfer pictures and files, but the character data of base64 has tripled in size. I am trying some string compression algorithms to make the data smaller.

@yopoing
Copy link
Author

yopoing commented Jan 5, 2023

Currently we do not have any examples of transferring files. If your image can be encoded into base64 - you can send it as text but if you are looking for a way to send files in general, then theoretically, it is possible to do so by sending binary data.

@fryorcraken maybe you can advise here?

TODO for myself:

  • provide an example with sending files capability;

Is status.im sending pictures in a centralized way? Or is it also transmitted through base64?

@danisharora099
Copy link
Contributor

danisharora099 commented Jan 5, 2023

Is status.im sending pictures in a centralized way? Or is it also transmitted through base64?

According to https://github.com/status-im/status-web/blob/5b48b614e86c7917631fab43e1a7b9b3b8865854/packages/status-js/src/client/chat.ts#L492, looks like it's encoded in bytes.

@felicio can confirm.

@fryorcraken
Copy link
Collaborator

Please note that relay support a maximum size of 1MB.

To send pictures, I first recommend to keep the size under 1MB. If over, then alternative solutions such as IPFS may be preferable (for example, upload on IPFS and transmit the IPFS hash over Waku).

@felicio
Copy link

felicio commented Jan 9, 2023

Is status.im sending pictures in a centralized way? Or is it also transmitted through base64?

According to https://github.com/status-im/status-web/blob/5b48b614e86c7917631fab43e1a7b9b3b8865854/packages/status-js/src/client/chat.ts#L492, looks like it's encoded in bytes.

@felicio can confirm.

Base64 bytes encoded and sent over Waku. I also like [@]fryorcraken's proposal.

@fryorcraken
Copy link
Collaborator

fryorcraken commented Mar 16, 2023

More brainstorming is needed.

Keen to have this as a bounty.

3 ways to exchanging file:

  1. Upload on IPFS
  2. Encoded to base64, include in Waku Message
  3. Binary chunks
  4. Compressed low-quality being shared over Waku and high-definition over IPFS

(2) and (3) can be problematic as there is a 1MB size limit and Waku Store is a bottleneck for Waku.


Would be keen to have a PoC that uses noise for e2ee and enables image sending.
However, current noise device pairing is more a device pairing UX.

Would be good to have noise XK1 done so that bob could share a "public key" and Alice can use that to initialize handshake and chat, then feature to send image.

Note that we want to do XK1 for waku-org/js-waku#1181

@fryorcraken
Copy link
Collaborator

FYI we are considering a bounty waku-org/bounties#18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Icebox
Development

No branches or pull requests

5 participants