- * All the communications between pods are signed, encrypted with a RSA key and a symetric encryption
- * All the requests are retried if they failed 10 times with a factor of 3 (so it will finally fail in ~ 16h)
- * If a request fails the score is decreased by 10 points
- * If a request is a success the score is increased by 10 points
- * The maximum of points would be 1000 (maybe more or less, depending of the server activity)
- * A pod which receives a request checks if the signature corresponds to the pod it has in its database. Then, it decrypts the body (or ignores it if the signature is not valid)
-
-### Actions on a pod
- * A pod is a tracker (websocket) which is responsible for all the video uploaded in it
- * A pod has different user accounts that can upload videos
- * All pods have an index of all videos of the network (name, origin pod url, small description, uploader username, magnet Uri, thumbnail name, created date and the thumbnail file). For example, a test with 1000000 of videos with only alphanum characters and the following lengths: name = 50, author = 50, url = 25, description = 250, magnerUri = 200, thumbnail name = 50 has a mongodb size of ~ 4GB. To this, we add 1 000 000 thumbnails of 5-15 KB so 15GB maximum
- * After having uploaded a video, the server seeds it, adds the meta data in its database and makes a secure request to all of its friends
- * If an user wants to watch a video, he asks its pod the magnetUri and the frontend adds the torrent (with webtorrent), creates the video tag and streams the file into it
- * An user watching a video seeds it too (bittorent) so another user who is watching the same video can get the data from the origin server and the user 1 (etc)
-
-## Ideas
-
- * A video could have more information (detailed description etc) that are not sent on other pods. The user who wants to see these informations has to ask its pod:
- user asks its pod -> user pod asks origin video pod -> origin video pod responds with the informations -> user pod responds to the user (and puts in cache the informations ?). We could extend this scheme with other informations (user profile etc)
- * Redondance: if the origin pod is down, the video is not accessible anymore. We could imagine a redondance between pods that keep seeding the video
- * Server could transcode the video to lower qualities (cost in CPU and disk space)
- * Server could seed at the demand: for now the server seeds all the videos but it has two drawbacks:
- - Seeding has a cost and is a long process
- - After a restart the server has to reseed all the videos (if it has 100 videos it could be very long!)
- If this solution is choosen, the frontend has to notify the origin pod that it has to seed the video it has not been seeded already
- * Avoid friend-making being an irreversible operation and a mandatory action at the first startup
-
-## Wanted but no idea how to implement
-
- * Avoid URL scheme (http or https): if a server wants to implement TLS (and force it), it will break all the communication links
-
-## Debate
-
- * Any user can view a video of a pod or he should have an account?
- * Is an ex-friend should be blacklisted for the future?
- * Handle API breaks in a network. Major update always breaks the API: we need the entire network update to the same major version. Specify a limit date (2, 3 weeks after the release ?) after which all the updated pod switch to the new version of the API? The non updated pod will be ejected of the network because of they would implement the new API
+ * All the communication between the instances are signed with [Linked Data
+ Signatures](https://w3c-dvcg.github.io/ld-signatures/) with the private key
+ of the account that authored the action.
+ * We use the [ActivityPub](https://www.w3.org/TR/activitypub/) protocol (only
+ server-server for now). Object models could be found in
+ [shared/models/activitypub
+ directory](/shared/models/activitypub).
+ * All the requests are retried several times if they fail.
+
+### Instance
+ * An instance has a websocket tracker which is responsible for all videos
+ uploaded by its users.
+ * An instance has an administrator that can follow other instances.
+ * An instance can be configured to follow back automatically.
+ * An instance can blacklist other instances (only used in "follow back"
+ mode).
+ * An instance cannot choose which other instances follow it, but it can
+ decide to **reject all** followers.
+ * After having uploaded a video, the instance seeds it (WebSeed protocol).
+ * If a user wants to watch a video, they ask its instance the magnet URI and
+ the frontend adds the torrent (with WebTorrent), creates the HTML5 video
+ player and streams the file into it.
+ * A user watching a video seeds it too (BitTorrent). Thus another user who is
+ watching the same video can get the data from the origin server and other
+ users watching it.