|
1 | | -# Waku's requirements on Codex |
| 1 | +# Waku's Requirements on Codex |
2 | 2 |
|
3 | | -TODO |
| 3 | +## Message Archival |
| 4 | + |
| 5 | +To be used for messages archival in Chat SDK, Qaku, opchan, etc. |
| 6 | +It assumes that a special user (admin, referred to as "original uploader") regularly bundles messages and pushes them to an external system. |
| 7 | +It then pushes the reference to the bundle over Waku. |
| 8 | + |
| 9 | +New users retrieve and listen to new messages using Waku upon start up. |
| 10 | +Then, they may retrieve bundles, likely because the know they are missing message via SDS. |
| 11 | + |
| 12 | +The original uploader is the one to determine how much persistence and guarantee they want for the bundle. |
| 13 | +It is application specific (eg until a Q&A is completed), and not related to users having downloaded the data. |
| 14 | + |
| 15 | +Which means it's a scenario where: |
| 16 | + |
| 17 | +- Time from upload to retrieval is **not** critical (latest messages are available on Waku) |
| 18 | +- Several users can seed and download the bundle. |
| 19 | + |
| 20 | +This is very similar to BitTorrent integration in Status ([specs](https://github.com/vacp2p/rfc-index/blob/main/status/61/community-history-service.md)) |
| 21 | +Some notes on BitTorrent integration in Status: |
| 22 | + |
| 23 | +1. Known issue is that the bundle is very large, and hence consumes a lot of bandwidth. I don't know if the bundle is "updated" or overridden. |
| 24 | + On Waku app side, we need to be open to have one large bundle vs a series of manageable bundle. The latter offers more flexibility such as attaching bloom filters, |
| 25 | + for selective download. |
| 26 | +2. The bundle download is indiscriminate, meaning every user will download it at some point, with SDS, we can do something smarter |
| 27 | + |
| 28 | +**Technical solutions** |
| 29 | + |
| 30 | +A comment on possible solutions: |
| 31 | + |
| 32 | +Also note (more of a personal opinion), usage of BitTorrent/webtorrent could be an acceptable starting point. |
| 33 | + |
| 34 | +Web is being solved by @vpavlin with vpavlin/qaku-cache which acts as a pinning gateway: |
| 35 | + |
| 36 | +> it is basically a pinning gateway, but instead of using HTTP to upload you use the Codex network itself. |
| 37 | +> It would be cool to add some auth - I was thinking about using Semaphore or RLN to limit who and how much can cache - WDYT? |
| 38 | +
|
| 39 | +Or with a Codex web-client that can retrieve and upload from the network: |
| 40 | + |
| 41 | +> I think if we can get a Codex web-client which can upload to the network somehow, we are immediately |
| 42 | +> solving one of the biggest pain points of IPFS and have a great story for anyone "why are you building a new storage |
| 43 | +> and why should I use it?" - I definitely want this to happen:-) |
| 44 | +
|
| 45 | +These are inferred in the FURPS below with requirements on web support and censorship-resistance. |
| 46 | + |
| 47 | +### Functionality |
| 48 | + |
| 49 | +1. Ability to transfer a bundle of 1MB or more between two or more nodes. |
| 50 | +2. Reference to bundle is 50kB or less. |
| 51 | + |
| 52 | +### Usability |
| 53 | + |
| 54 | +1. Developer can implement feature with 10 lines of code or less. |
| 55 | + |
| 56 | +### Reliability |
| 57 | + |
| 58 | +1. Download operation can be resumed. |
| 59 | +2. Upload operation can be resumed. |
| 60 | +3. As long as original uploader is online, bundle should be retrievable. |
| 61 | +4. As long as N out of M users are online, bundle should be retrievable. |
| 62 | + |
| 63 | +### Performance |
| 64 | + |
| 65 | +1. Time between bundle uploaded, and retrieved by users can be in the span of minutes and hours (we assumes messages are available in Waku store for several hours). |
| 66 | +2. The burden of re-upload is shared by users. |
| 67 | + |
| 68 | +### Supportability |
| 69 | + |
| 70 | +1. Library for Browser applications. |
| 71 | +2. Library for Nim desktop applications. |
| 72 | +3. Library for Nim mobile applications. |
| 73 | +4. Most users may be behind NAT routers and other domestic network setup. |
| 74 | + |
| 75 | +### + (Privacy, Anonymity, Censorship-Resistance, Deployments) |
| 76 | + |
| 77 | +1. The unavailability of a static host (IP, DNS) does not prevent a user to upload or download (censorship-resistance). |
| 78 | +2. A participant cannot determine original uploader's PII (anonymity). |
| 79 | + |
| 80 | +## Large File Transfer |
| 81 | + |
| 82 | +To be used when 2 users or more, are transferring a large payload. This may be a large image or video in a private chat. |
| 83 | +Or it could be a llm prompt that returns a large image or video. |
| 84 | + |
| 85 | +Due to the broadcast nature of Waku, it would hog too much bandwidth if every large file sent between users where sent over Waku. |
| 86 | + |
| 87 | +In terms of durability, it can be assumed that once all participants have downloaded the payload, it does not need to be retrievable anymore. |
| 88 | +It should also be assumed that the users may not be online at the same time (mobile). |
| 89 | +There is more expectation on timeliness of retrievability, as one would want to be able to download seconds after the upload happened. |
| 90 | + |
| 91 | +### Functionality |
| 92 | + |
| 93 | +1. Ability to transfer a payload of 1MB or more between two or more peers. |
| 94 | +2. Reference to payload is less than 50kB. |
| 95 | + |
| 96 | +### Usability |
| 97 | + |
| 98 | +1. Developer can implement feature with 10 lines of code or less. |
| 99 | + |
| 100 | +### Reliability |
| 101 | + |
| 102 | +1. Download operation can be resumed. |
| 103 | +2. Upload operation can be resumed. |
| 104 | +3. Payload should be retrievable even if original uploader goes offline. |
| 105 | +4. Once all recipients have downloaded the payload, there is no more expectations on being able to retrieve the payload. |
| 106 | + |
| 107 | +### Performance |
| 108 | + |
| 109 | +1. Payload download should start within seconds of the upload start. |
| 110 | + |
| 111 | +### Supportability |
| 112 | + |
| 113 | +1. Library for Browser applications. |
| 114 | +2. Library for Nim desktop applications. |
| 115 | +3. Library for Nim mobile applications. |
| 116 | +4. Most users may be behind NAT routers and other domestic network setup. |
| 117 | + |
| 118 | +### + (Privacy, Anonymity, Censorship-Resistance, Deployments) |
| 119 | + |
| 120 | +1. The unavailability of a static host (IP, DNS) does not prevent a user to upload or download (censorship-resistance). |
| 121 | +2. An external observer cannot tie the PIIs of the uploader and downloaders of one payload; |
| 122 | + it is assumed that the reference to the payload (eg, CID) is not leaked outside the participants. |
0 commit comments