सवार
A swarm (group chat) is a set of participants capable of resilient, decentralized communication. For example, if two participants lose connectivity with the rest of the group (e.g., during an Internet outage) but can still reach each other over a LAN or subnetwork, they can exchange messages locally and then synchronize with the rest of the group once connectivity is restored.
A swarm is defined by the following properties:
Ability to split and merge based on network connectivity.
History synchronization. Every participant must be able to send a message to the entire group.
कुनै पनि केन्द्रीय प्राधिकरण छैन, कुनै पनि सर्भरमा भरोसा गर्न सकिँदैन ।
Non-repudiation. Devices must be able to verify past messages' validity and to replay the entire history.
Perfect Forward Secrecy (PFS) is provided on the transport channels. Storage is handled by each device.
मुख्य विचार भनेको सहभागीहरूसँग समक्रमण गरिएको मर्केल रूख प्राप्त गर्नु हो।
We identified four modes for swarms that we want to implement:
ONE_TO_ONE: A private conversation between two endpoints—either between two users or with yourself.
ADMIN_INVITES_ONLY: A swarm in which only the administrator can invite members (for example, a teacher-managed classroom).
INVITES_ONLY: A closed swarm that admits members strictly by invitation; no one may join without explicit approval.
PUBLIC: A public swarm that anyone can join without prior invitation (For example a forum).
परिदृश्यहरू
एउटा झुण्ड बनाउनुहोस्
बब नयाँ झुण्ड बनाउन चाहन्छन्
Bob creates a local Git repository.
त्यसपछि, उसले निम्नसँग पहिलो हस्ताक्षरित प्रतिबद्धता सिर्जना गर्दछः
/admins
मा उनको सार्वजनिक कुञ्जीउनको उपकरण प्रमाणपत्र ̀ /डिभाइस `
उसको सीआरएल ̀ /crls` मा
पहिलो प्रतिबद्धताको ह्यास कुराकानीको ** आईडी ** हुन्छ
Bob announces to his other devices that he created a new conversation. This is done via an invite to join the group sent through the DHT to other devices linked to that account.
कसैलाई थप्दै
Bob adds Alice
Bob adds Alice to the repo:
/invited
मा बोलाइएको URI थप्छCRL
/crls
मा थप्छ
Bob sends a request on the DHT.
निमन्त्रणा पाउँदै
Alice gets the invite to join the previously created swarm
Alice accepts the invite (if she declines, nothing happens; she will remain in the "invited" list, and will never receive any messages)
A peer-to-peer connection is established between Alice and Bob.
Alice pulls the Git repository from Bob. WARNING this means that messages require a connection, not from the DHT as it is today.
Alice validates the commits from Bob.
To validate that Alice is a member, she removes the invite from
/invited
directory, then adds her certificate to the/members
directoryOnce all commits are validated and syncronized to her device, Alice discovers other members of the group. with these peers, she will then construct the DRT with Bob as a bootstrap.
सन्देश पठाउँदै
Alice sends a message to Bob
Alice creates a commit message. She constructs a JSON payload containing the MIME type and message body. For example:
{
"type": "text/plain",
"body": "hello"
}
Alice ensure her device credentials are present. If Alice’s device certificate or its associated CRL isn’t already stored in the repository, she adds them so that other participants can verify the commit.
Alice commits to the repository (Because Jami relies primarily on commit-message metadata rather than file contents, merge conflicts are rare; the only potential conflicts would involve CRLs or certificates, which are versioned in a dedicated location).
Alice announces the commit via the DRT with a service message and pings the DHT for mobile devices (they must receive a push notification).
टिप्पणी
To notify other devices, the sender transmits a SIP message with type: application/im-gitmessage-id
.
The JSON payload includes the deviceId (the sender’s), the conversationId and the reference (hash) of the new commit.
सन्देश प्राप्त गर्दै
Bob receives a message from Alice
Bob performs a Git pull on Alice's repository.
All incoming commits MUST be verified by a hook.
If all commits are valid, commits are stored and displayed.Bob then announces the message via the DRT for other devices.
If any commit is invalid, pull is aborted. Alice must restore her repository to a correct state before retrying.
प्रतिबद्धताको प्रमाणीकरण
प्रयोगकर्ताहरूले केही अवांछित प्रतिबद्धताहरू (संघर्ष, गलत सन्देशहरू, आदि) धक्का दिनबाट जोगिनको लागि, प्रत्येक प्रतिबद्धता (पुरानोबाट नयाँसम्म) टाढाको शाखा मर्ज गर्नु अघि कसरी मान्य हुनुपर्दछः
टिप्पणी
If the validation fails, the fetch is ignored and we do not merge the branch (and remove the data), and the user should be notified.
If a fetch is too big, it's not merged.
For each incoming commit, ensure that the sending device is currently authorized and that the issuer’s certificate exists under /members or /admins, and the device’s certificate under /devices.
Then handle one of three cases, based on the commit’s parent count:
Merge Commit (2 parents). No further validation is required, merges are always accepted.
Initial Commit (0 parents). Validate that this is the very first repository snapshot:
Admin certificate is added.
Device certificate is added.
CRLs (Certificate Revocation Lists) are added.
No other files are present.
Ordinary Commit (1 parent). The commit message must be JSON with a top‑level
type
field. Handle eachtype
as follows:If
text
(or any non–file‑modifying MIME type)Signature is valid against the author’s certificate in the repo.
No unexpected files are added or removed.
If
vote
voteType
is one of the supported values (e.g. "ban", "unban").The vote matches the signing user.
The signer is an admin, their device is present, and not themselves banned.
No unexpected files are added or removed.
If
member
If
adds
Properly signed by the inviter.
New member’s URI appears under
/invited
.No unexpected files are added or removed.
If ONE_TO_ONE, ensure exactly one admin and one member.
If ADMIN_INVITES_ONLY, the inviter must be an admin.
If
joins
Properly signed by the joining device.
Device certificate added under
/devices
.Corresponding invite removed from
/invited
and certificate added to/members
.No unexpected files are added or removed.
If
banned
Vote is valid per the
vote
rules above.Ban is issued by an admin.
Target’s certificate moved to /banned.
Only files related to the ban vote are removed.
No unexpected files are added or removed.
Fallback. If the commit’s type or structure is unrecognized, reject it and notify the peer (or user) that they may be running an outdated version or attempting unauthorized changes.
उपकरण प्रतिबन्धित
जरुरी
Jami source code tends to use the terms (un)ban, while the user interface uses the terms (un)block.
Alice, Bob, Carla, Denys are in a swarm. Alice issues a ban against Denys.
In a fully peer‑to‑peer system with no central authority, this simple action exposes three core challenges:
Untrusted Timestamps: Commit timestamps cannot be relied upon for ordering ban events, as any device can forge or replay commits with arbitrary dates.
Conflicting bans: In cases where multiple admin devices exist, network partitions can result in conflicting ban decisions. For instance, if Alice can communicate with Bob but not with Denys and Carla, while Carla can communicate with Denys, conflicting bans may occur. If Denys bans Alice while Alice bans Denys, the group’s state becomes unclear when all members eventually reconnect and merge their conversation histories.
Compromised or expired devices: Devices can be compromised, stolen, or have their certificates expire. The system must allow banning such devices and ensure they cannot manipulate their certificate or commit timestamps to send unauthorized messages or falsify their expiration status.
यस्तै प्रणालीहरू (वितरित समूह प्रणालीहरू) धेरै छैनन्, तर यी केहि उदाहरणहरू हुन्ः
[MPOTR ले कसैलाई कसरी प्रतिबन्ध गर्ने भन्ने परिभाषित गर्दैन]
समूह च्याटको लागि कुनै पनि केन्द्रीय सर्भर बिना सिग्नलले कसैलाई समूहबाट प्रतिबन्ध लगाउने क्षमता प्रदान गर्दैन।
This voting system needs a human action to ban someone or must be based on the CRLs info from the repository (because we can not trust external CRLs).
कुराकानीबाट उपकरण हटाउनुहोस्
यो एक मात्र भाग हो जहाँ वार्तालापको विभाजनबाट बच्न सहमतिको आवश्यकता हुन्छ, जस्तै यदि दुई सदस्यले वार्तालापबाट एक अर्कालाई प्रहार गरे, तेस्रोलाई के देखाउने?
यो रद्द गरिएका उपकरणहरू पत्ता लगाउन आवश्यक छ, वा साधारणतया सार्वजनिक कोठामा अवांछित व्यक्तिहरू उपस्थित हुनबाट जोगिनको लागि आवश्यक छ। प्रक्रिया सदस्य र उपकरण बीच धेरै समान छः
एलिसले बोबलाई हटायो
जरुरी
Alice MUST be an admin to vote.
पहिलो, उनले बोबलाई प्रतिबन्धित गर्न मतदान गरे। त्यो गर्न, उनले फाइल /votes/ban/members/uri_bob/uri_alice मा सिर्जना गर्दछ (सदस्यहरूलाई उपकरणको लागि उपकरणहरू द्वारा प्रतिस्थापित गर्न सकिन्छ, वा आमन्त्रितको लागि आमन्त्रित गर्न सकिन्छ वा प्रशासकहरूको लागि प्रशासकहरू) र प्रतिबद्धताहरू
त्यसपछि उनले मतदान समाधान भएको जाँच गरेकी छन्। यसको मतलब यो हो कि प्रशासकहरूको 50% भन्दा बढी बोबलाई प्रतिबन्धित गर्न सहमत छन् (यदि उनी एक्लै छिन् भने यो निश्चित रूपमा 50% भन्दा बढी हो) ।
यदि मतदान समाधान भयो भने, फाइलहरू /votes/ban मा हटाउन सकिन्छ, सबै फाइलहरू /members, /admins, /invited, /CRLs, /devices मा बोब हटाउन सकिन्छ (वा मात्र /devices मा यदि यो एक उपकरण हो कि प्रतिबन्धित छ) र बोबको प्रमाणपत्र /banned/members/bob_uri.crt मा राख्न सकिन्छ (वा /banned/devices/uri.crt यदि एक उपकरण प्रतिबन्धित छ) र repo मा प्रतिबद्ध गर्न सकिन्छ
त्यसपछि, एलिसले अन्य प्रयोगकर्ताहरूलाई सूचित गर्दछ (बबबाहेक)
Alice (admin) re-adds Bob (banned member)
If she votes for unbanning Bob. To do that, she creates the file in /votes/unban/members/uri_bob/uri_alice (members can be replaced by devices for a device, or invited for invites or admins for admins) and commits
त्यसपछि उनले मतदान समाधान भएको जाँच गरेकी छन्। यसको मतलब यो हो कि प्रशासकहरूको 50% भन्दा बढी बोबलाई प्रतिबन्धित गर्न सहमत छन् (यदि उनी एक्लै छिन् भने यो निश्चित रूपमा 50% भन्दा बढी हो) ।
यदि मतदान समाधान भयो भने, फाइलहरू /votes/unban मा हटाउन सकिन्छ, सबै फाइलहरू /members मा बोब, /admins, /invited, /CRLs मा, पुनः थप्न सकिन्छ (वा मात्र /डिभाइसमा यदि यो एक उपकरण हो कि निषेध छ) र repo मा प्रतिबद्ध
कुराकानी हटाउनुहोस्
convInfos हटाइएको = समय:: अब() मा बचत गर्नुहोस् (जस्तै हटाउनुहोस्कन्ट्याक्ट सम्पर्कमा बचत गर्दछ) कि कुराकानी हटाइएको छ र अन्य प्रयोगकर्ताको उपकरणहरूसँग सिंक गरिएको छ
अब, यदि यो कुराकानीको लागि नयाँ प्रतिबद्धता प्राप्त हुन्छ भने यो बेवास्ता गरिन्छ
अब, यदि Jami सुरु र repo अझै पनि उपस्थित छ, कुराकानी ग्राहकहरु लाई घोषणा छैन
Two cases: a. If no other member in the conversation we can immediately remove the repository b. If still other members, commit that we leave the conversation, and now wait that at least another device sync this message. This avoids the fact that other members will still detect the user as a valid member and still sends new message notifications.
जब हामी निश्चित छौं कि कसैले सिंक गरिएको छ, हटाउनुहोस् erased=time::now() र अन्य प्रयोगकर्ताको उपकरणहरूसँग सिंक गर्नुहोस्
प्रयोगकर्ताको स्वामित्वमा रहेका सबै उपकरणहरूले अब भण्डार र सम्बन्धित फाइलहरू मेटाउन सक्दछन्
मोड कसरी निर्दिष्ट गर्ने
मोडहरू समयको साथ परिवर्तन गर्न सकिदैन। वा यो अर्को कुराकानी हो। त्यसैले, यो डाटा प्रारम्भिक प्रतिबद्ध सन्देशमा भण्डारण गरिन्छ। प्रतिबद्ध सन्देश निम्न हुनेछः
{
"type": "initial",
"mode": 0,
}
हालको लागि, "मोड" मानहरू स्वीकार गर्दछ 0 (ONE_TO_ONE), 1 (ADMIN_INVITES_ONLY), 2 (INVITES_ONLY), 3 (सार्वजनिक)
Processes for 1:1 chats
The goal here is to keep the old API (addContact/removeContact, sendTrustRequest/acceptTrustRequest/discardTrustRequest) to create a chat with a peer and its contact. This still implies some changes that we cannot ignore:
प्रक्रिया अझै पनि उस्तै छ, एक खाता addContact मार्फत सम्पर्क थप्न सक्छ, त्यसपछि DHT मार्फत ट्रस्ट अनुरोध पठाउन सक्छ। तर दुई परिवर्तनहरू आवश्यक छन्ः
TrustRequest ले "conversationId" सम्मिलित गर्दछ जुन पीरलाई सूचित गर्दछ कि कुन कुराकानी क्लोन गर्न अनुरोध स्वीकार गर्दा
TrustRequest पुनः प्रयास गरिन्छ जब सम्पर्क अनलाइन आउँदछ। यो आजको मामला होइन (हामी नयाँ TrustRequest उत्पन्न गर्न चाहँदैनौं यदि सहकर्मीले पहिलोलाई खारेज गर्दछ भने) त्यसैले, यदि खाताले विश्वास अनुरोध प्राप्त गर्दछ भने, यो स्वचालित रूपमा बेवास्ता हुनेछ यदि सम्बन्धित कुराकानीको साथ अनुरोध अस्वीकार गरिएको छ (जसरी convRequests सिंक गरिन्छ)
त्यसपछि, जब सम्पर्कले अनुरोध स्वीकार गर्दछ, तब सिंकको अवधि आवश्यक हुन्छ, किनकि सम्पर्कले अब कुराकानी क्लोन गर्न आवश्यक छ।
हटाउनुहोस्Contact() ले सम्पर्क र सम्बन्धित १ः१ कुराकानीहरू हटाउनेछ (उस्तै प्रक्रियाको साथ "एक कुराकानी हटाउनुहोस्") यहाँको एक मात्र नोट यो हो कि यदि हामी सम्पर्कलाई प्रतिबन्धित गर्छौं भने हामी सिंकको लागि पर्खदैनौं, हामी केवल सम्बन्धित सबै फाइलहरू हटाउँछौं।
कठिन परिदृश्यहरू
त्यहाँ केहि केसहरू छन् जहाँ दुई कुराकानी सिर्जना गर्न सकिन्छ। यो कम्तिमा दुई ती परिदृश्यहरू मध्ये एक होः
Alice adds Bob.
Bob accepts.
Alice removes Bob.
Alice adds Bob.
वा
Alice adds Bob and Bob adds Alice at the same time, but both are not connected together.
In this case, two conversations are generated. We don't want to remove messages from users or choose one conversation here. So, sometimes two conversations between the same members will be shown. It will generate some bugs during the transition time (as we don't want to break API, the inferred conversation will be one of the two shown conversations, but for now it's "ok-ish", will be fixed when clients will fully handle conversationId for all APIs (calls, file transfer, etc)).
जरुरी
After accepting a conversation's request, there is a time the daemon needs to retrieve the distant repository. During this time, clients MUST show a syncing view to give informations to the user. While syncing:
ConfigurationManager::getConversations() will return the conversation's id even while syncing.
ConfigurationManager::conversationInfos() ले {{"सिंक": "सच्चा"}} लाई सिंक गर्दा फिर्ता गर्नेछ।
ConfigurationManager::getConversationMembers() will return a map of two URIs (the current account and the peer who sent the request).
वार्ताले निर्दिष्टीकरण माग्यो
वार्तालाप अनुरोधहरू ** नक्सा<स्ट्रिङ, स्ट्रिंग>** द्वारा निम्न कुञ्जीहरूसँग प्रतिनिधित्व गरिन्छः
id: the conversation ID
from: URI of the sender
प्राप्त: समयशिक्का
शीर्षकः वार्तालापको नाम (वैकल्पिक)
विवरणः (वैकल्पिक)
avatar: (optional) the profile picture
कुराकानीको प्रोफाइल सिंक
पहिचान गर्नका लागि, कुराकानीलाई सामान्यतया केही मेटाडाटा चाहिन्छ, जस्तै शीर्षक (उदाहरणः Jami), वर्णन (उदाहरणः केहि लिंकहरू, परियोजना के हो, आदि), र छवि (प्रोजेक्टको लोगो) । ती मेटाडाटा वैकल्पिक छन् तर सबै सदस्यहरू बीच साझा गरिन्छ, त्यसैले अनुरोधहरूमा सिंक र समावेश गर्न आवश्यक छ।
भण्डारण
कुराकानीको प्रोफाइल मूल (/profile.vcf
) मा क्लासिक vCard फाइलमा भण्डारण गरिएको छ जस्तैः
BEGIN:VCARD
VERSION:2.1
FN:TITLE
DESCRIPTION:DESC
END:VCARD
समक्रमण
To update the vCard, a user with enough permissions (by default: =ADMIN) needs to edit /profile.vcf
and will commit the file with the mimetype application/update-profile
.
The new message is sent via the same mechanism and all peers will receive the MessageReceived signal from the daemon.
The branch is dropped if the commit contains other files or too big or if done by a non-authorized member (by default: <ADMIN).
अन्तिम पटक देखाइयो
प्रत्येक उपकरणले अन्य उपकरणहरूलाई कुराकानीको अवस्था पठाउँदछ। यस अवस्थामा, अन्तिम प्रदर्शन पठाइन्छ। यद्यपि, प्रत्येक उपकरणले प्रत्येक कुराकानीको लागि आफ्नै अवस्था हुन सक्छ, र सायद कुनै समयमा उही अन्तिम प्रतिबद्धता बिना, त्यहाँ धेरै परिदृश्यहरू छन् जुन ध्यानमा राख्नुपर्दछः
पाँचवटा परिदृश्यलाई समर्थन गरिन्छः
यदि अन्य उपकरणहरूद्वारा पठाइएको अन्तिम प्रदर्शन वर्तमानको जस्तै छ भने, त्यहाँ केहि गर्न छैन।
यदि हालको उपकरणको लागि अन्तिम प्रदर्शन छैन भने, रिमोट प्रदर्शन सन्देश प्रयोग गरिन्छ।
यदि रिमोट अन्तिम प्रदर्शन रेपोमा उपस्थित छैन भने, यसको मतलब यो हो कि कमिट पछि प्राप्त हुनेछ, त्यसैले परिणाम क्यास गर्नुहोस्
यदि रिमोट पहिले नै प्राप्त गरिएको छ भने, हामी जाँच गर्छौं कि स्थानीय अन्तिम प्रदर्शन इतिहासमा पहिले छ कि छैन यसलाई बदल्न
अन्तमा, यदि एउटै लेखकबाट सन्देश घोषणा गरिएको छ भने, यसको मतलब हामीले अन्तिम देखाइएको अपडेट गर्नुपर्दछ।
प्राथमिकताहरू
प्रत्येक कुराकानीमा प्रयोगकर्ताद्वारा सेट गरिएका प्राथमिकताहरू संलग्न छन्। ती प्राथमिकताहरू प्रयोगकर्ताका उपकरणहरूमा सिंक हुन्छन्। यो कुराकानीको रंग हुन सक्छ, यदि प्रयोगकर्ताले सूचनाहरू बेवास्ता गर्न चाहन्छ भने, फाइल स्थानान्तरण आकार सीमा, आदि। अहिलेको लागि, मान्यता प्राप्त कुञ्जीहरू हुन्ः
"color" - the color of the conversation (#RRGGBB format)
"नोटिफिकेसनहरू बेवास्ता गर्नुहोस्" - यस कुराकानीमा नयाँ सन्देशहरूको लागि सूचनाहरू बेवास्ता गर्न
"प्रतीक" - पूर्वनिर्धारित इमोजी परिभाषित गर्न।
ती प्राथमिकताहरू MapStringString प्याकेटमा भण्डारण गरिन्छ, accountDir/conversation_data/conversationId/preferences
मा भण्डारण गरिन्छ र केवल SyncMsg मार्फत एउटै प्रयोगकर्ताको उपकरणहरूमा पठाइन्छ।
प्राथमिकताहरूसँग अन्तरक्रिया गर्नका लागि एपीआईहरूः
// Update preferences
void setConversationPreferences(const std::string& accountId,
const std::string& conversationId,
const std::map<std::string, std::string>& prefs);
// Retrieve preferences
std::map<std::string, std::string> getConversationPreferences(const std::string& accountId,
const std::string& conversationId);
// Emitted when preferences are updated (via setConversationPreferences or by syncing with other devices)
struct ConversationPreferencesUpdated
{
constexpr static const char* name = "ConversationPreferencesUpdated";
using cb_type = void(const std::string& /*accountId*/,
const std::string& /*conversationId*/,
std::map<std::string, std::string> /*preferences*/);
};
मर्ज द्वन्द्व व्यवस्थापन
किनभने दुई प्रशासकहरूले एकै समयमा वर्णन परिवर्तन गर्न सक्दछन्, profile.vcf
मा एक मर्ज द्वन्द्व हुन सक्छ। यस अवस्थामा, उच्च ह्यासको साथ प्रतिबद्धता (उदाहरण ffffff > 000000) छनौट गरिनेछ।
एपीआई
प्रयोगकर्ताले कुराकानीको मेटाडाटा प्राप्त गर्न र सेट गर्नका लागि २ तरिकाहरू प्राप्त गरेः
<method name="updateConversationInfos" tp:name-for-bindings="updateConversationInfos">
<tp:added version="10.0.0"/>
<tp:docstring>
Update conversation's infos (supported keys: title, description, avatar)
</tp:docstring>
<arg type="s" name="accountId" direction="in"/>
<arg type="s" name="conversationId" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In2" value="VectorMapStringString"/>
<arg type="a{ss}" name="infos" direction="in"/>
</method>
<method name="conversationInfos" tp:name-for-bindings="conversationInfos">
<tp:added version="10.0.0"/>
<tp:docstring>
Get conversation's infos (mode, title, description, avatar)
</tp:docstring>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="VectorMapStringString"/>
<arg type="a{ss}" name="infos" direction="out"/>
<arg type="s" name="accountId" direction="in"/>
<arg type="s" name="conversationId" direction="in"/>
</method>
जहाँ infos
निम्न कुञ्जीहरू सहितको map<str, str>
होः
मोडः पढ्ने मात्र
शीर्षक
विवरण
avatar: the profile picture
खाता पुनः आयात (लिंक/export)
अभिलेखमा वार्तालापहरू पुनः आयात पछि पुनः प्राप्त गर्न सक्षम हुन वार्तालापहरू समावेश गर्नुपर्दछ (किनकि यस बिन्दुमा कुनै निमन्त्रणा छैन) यदि वार्तालाप अनुपस्थितमा एक प्रतिबद्धता आउँदछ भने त्यहाँ दुई सम्भावनाहरू छन्ः
कुराकानी त्यहाँ छ, यस अवस्थामा, Daemon यो कुराकानी पुनः क्लोन गर्न सक्षम छ
वार्तालापId हराइरहेको छ, त्यसैले डेमोनले (एक सन्देश
{{"अनुप्रयोग/आमन्त्रण", वार्तालापId}}
) नयाँ निमन्त्रणा सोध्छ जुन प्रयोगकर्ताले (पुनः) स्वीकार्नु पर्छ
जरुरी
A conversation can only be retrieved if a contact or another device is there, else it will be lost. There is no magic.
प्रयोग गरिएका प्रोटोकलहरू
गट
किन यो विकल्प
Each conversation will be a Git repository. This choice is motivated by:
हामीले सन्देशहरू सिंक र अर्डर गर्न आवश्यक छ। मर्केल ट्री यो गर्नको लागि उत्तम संरचना हो र शाखाहरू मर्ज गरेर लाइनरिज गर्न सकिन्छ। यसबाहेक, किनकि यो Git द्वारा व्यापक रूपमा प्रयोग गरिन्छ, यो उपकरणहरू बीच सिंक गर्न सजिलो छ।
प्रकृति द्वारा वितरण, व्यापक प्रयोग, धेरै ब्याकएन्ड र प्लग गर्न योग्य।
हुक र व्यापक रूपमा प्रयोग क्रिप्टो मार्फत प्रतिबद्धता प्रमाणित गर्न सक्नुहुन्छ
आवश्यक भएमा डाटाबेसमा भण्डारण गर्न सकिन्छ
फाइलहरू होइन, प्रतिबद्ध सन्देशहरू प्रयोग गरेर द्वन्द्वहरूबाट बच्न सकिन्छ।
हामीले प्रमाणित गर्न आवश्यक छ
प्रदर्शन?
git.lock
कम हुन सक्छलिबगितमा हुकहरू
एकै समयमा धेरै पटक तान्नु?
सीमा
इतिहास मेटाउन सकिदैन। कुराकानी मेटाउनको लागि, यन्त्रले कुराकानी छोड्नु पर्छ र अर्को सिर्जना गर्नु पर्छ।
यद्यपि गैर-स्थायी सन्देशहरू (जस्तै केही मिनेट मात्र पढ्न सकिने सन्देशहरू) DRT मार्फत विशेष सन्देश मार्फत पठाउन सकिन्छ (जस्तै टाइप वा पढ्न सूचनाहरू) ।
संरचना
/
- invited
- admins (public keys)
- members (public keys)
- devices (certificates of authors to verify commits)
- banned
- devices
- invited
- admins
- members
- votes
- ban
- members
- uri
- uriAdmin
- devices
- uri
- uriAdmin
- unban
- members
- uri
- uriAdmin
- CRLs
फाइल स्थानान्तरण
This new system overhauls file sharing: the entire history is now kept in sync, so any device in the conversation can instantly access past files. Rather than forcing the sender to push files directly—an approach that was fragile in the face of connection drops and often required manual retries—devices simply download files when they need them. Moreover, once one device has downloaded a file, it can act as a host for others, ensuring files remain available even if the original sender goes offline.
प्रोटोकल
प्रेषकले वार्तालापमा निम्न ढाँचाको साथ नयाँ प्रतिबद्धता थप्छः
value["tid"] = "RANDOMID";
value["displayName"] = "DISPLAYNAME";
value["totalSize"] = "SIZE OF THE FILE";
value["sha3sum"] = "SHA3SUM OF THE FILE";
value["type"] = "application/data-transfer+json";
र ${data_path}/conversation_data/${conversation_id}/${file_id}
मा लिंक सिर्जना गर्दछ जहाँ file_id=${commitid}_${value["टाइड"]}.${extension}
त्यसपछि, रिसीभरले अब name="data-transfer://" + conversationId + "/" + currentDeviceId() + "/" + fileId
को साथ एक च्यानल खोलेर फाइल होस्टिंग उपकरणहरूसँग सम्पर्क गरेर फाइलहरू डाउनलोड गर्न सक्दछ र ${data_path}/conversation_data/${conversation_id}/waiting
मा फाइलको प्रतीक्षा जानकारी भण्डारण गर्न सक्दछ
जडान प्राप्त गर्ने उपकरणले फाइल पठाउन सकिन्छ कि छैन भनेर प्रमाणित गरेर च्यानल स्वीकार गर्दछ (यदि sha3sum सही छ र यदि फाइल अवस्थित छ भने) । रिसीभरले पहिलो खोलेको च्यानल राख्नेछ, अरूलाई बन्द गर्दछ र फाइलमा लेख्नेछ (उपदेशकर्ताको समान मार्गको साथः ${data_path}/conversation_data/${conversation_id}/${file_id}
) सबै आगमन डाटा।
जब स्थानान्तरण समाप्त हुन्छ वा च्यानल बन्द हुन्छ, sha3sum फाइल सही छ कि छैन भनेर प्रमाणित गर्न प्रमाणित हुन्छ (वा यो मेटाइएको छ) यदि मान्य छ भने, फाइल पर्खाइबाट हटाइनेछ।
असफलताको अवस्थामा, जब कुराकानीको उपकरण फेरि अनलाइन हुनेछ, हामी सबै प्रतीक्षा फाइलहरू उही तरिकामा सोध्छौं।
Call in Swarm
विचार
A swarm conversation can have multiple rendez-vous. A rendez-vous is defined by the following URI:
"accountUri/deviceId/conversationId/confId" जहाँ खाताUri/deviceId होस्ट वर्णन गर्दछ।
होस्ट दुई तरिकाले निर्धारण गर्न सकिन्छः
In the swarm metadatas. Where it's stored like the title/desc/avatar (profile picture) of the room
अथवा प्रारम्भिक कलर।
When starting a call, the host will add a new commit to the repository, with the URI to join (accountUri/deviceId/conversationId/confId). This will be valid till the end of the call (announced by a commit with the duration to show)
त्यसैले प्रत्येक भागले जानकारी प्राप्त गर्नेछ कि कल सुरु भएको छ र यसलाई कल गरेर यसमा सामेल हुन सक्षम हुनेछ।
आक्रमण?
Avoid Git bombs
नोटहरू
एक प्रतिबद्धताको समयछापमा विश्वास गर्न सकिन्छ किनकि यो सम्पादन योग्य छ। केवल प्रयोगकर्ताको समयछापमा विश्वास गर्न सकिन्छ।
TLS
Git अपरेसन, नियन्त्रण सन्देशहरू, फाइलहरू, र अन्य चीजहरूले केवल सिकोर्डहरूको साथ p2p TLS v1.3 लिंक प्रयोग गर्दछ जुन PFS ग्यारेन्टी गर्दछ। त्यसैले प्रत्येक कुञ्जी प्रत्येक नयाँ जडानको लागि पुनः वार्ता गरिन्छ।
DHT (UDP)
मोबाइलमा सन्देश पठाउन (पुश सूचनाहरू ट्रिगर गर्न) र TCP जडानहरू सुरु गर्न प्रयोग गरिन्छ।
नेटवर्क गतिविधि
कसैलाई निम्त्याउने प्रक्रिया
एलिस बोबलाई निम्त्याउन चाहन्छः
एलिसले बोबलाई कुराकानीमा जोडिन
Alice generates an invite: { "application/invite+json" : { "conversationId": "$id", "members": [{...}] }}
सन्देश पठाउन दुई सम्भावना a. यदि जोडिएको छैन, DHT मार्फत b. अन्यथा, एलिस SIP च्यानलमा पठाउँछ
बोब a को लागि दुई सम्भावनाहरू। निमन्त्रणा प्राप्त गर्दछ, ग्राहक b को लागि संकेत बाहिर पठाइन्छ। जडान गरिएको छैन, त्यसैले कहिले पनि अनुरोध प्राप्त गर्दैन किनभने एलिसले थाहा पाउनु हुँदैन कि बोबले एलिसलाई बेवास्ता गरेको छ वा रोकेको छ। नयाँ सन्देश मार्फत नयाँ निमन्त्रणा पुनः उत्पादन गर्ने मात्र तरिका हो (अर्को परिदृश्य हेर्नुहोस्)
कसैलाई सन्देश पठाउने प्रक्रिया
एलिस बोबलाई सन्देश पठाउन चाहन्छः
एलिसले रेपोमा सन्देश थप्छ, परिचयपत्र दिँदै
एलिसले प्राप्त सन्देश (आफ्नै) यदि सफल
दुई सम्भावनाहरू, एलिस र बोब जडान छन्, वा छैनन्। दुबै अवस्थामा सन्देश सिर्जना हुन्छः { "अनुप्रयोग/im-gitmessage-id" : "{"id":"\(convId", "commit":"\)commitId", "deviceId": "$alice_device_hash"}"}. a. यदि जडान छैन भने, DHT b. अन्यथा, एलिसले SIP च्यानलमा पठाउँदछ
बोबका लागि चार सम्भावनाहरूः a. बोब एलिससँग जोडिएको छैन, त्यसैले यदि उसले एलिसलाई विश्वास गर्छ भने, नयाँ जडानको लागि सोध्नुहोस् र b.b मा जानुहोस्। यदि जोडिएको छ भने, एलिसबाट ल्याउनुहोस् र नयाँ सन्देशहरू घोषणा गर्नुहोस्। Bob त्यो कुराकानी थाहा छैन। DHT मार्फत सोध्नुहोस् कि पहिले त्यो कुराकानी स्वीकार गर्न सक्षम हुनको लागि निमन्त्रणा प्राप्त गर्न ({"अनुप्रयोग / निमन्त्रणा", कुराकानीId}) d. बोब डिस्कनेक्ट छ (कुनै नेटवर्क छैन, वा बन्द मात्र) । उसले नयाँ सन्देश प्राप्त गर्दैन तर अर्को जडान हुँदा सिंक गर्न प्रयास गर्नेछ
कार्यान्वयन
[आरेख: समूह च्याट कक्षाहरू](चित्रहरू/ समूह च्याट-वर्ग-आरेख.jpg)
Supported messages
Initial message
{
"type": "initial",
"mode": 0,
"invited": "URI"
}
Represents the first commit of a repository and contains the mode:
enum class ConversationMode : int { ONE_TO_ONE = 0, ADMIN_INVITES_ONLY, INVITES_ONLY, PUBLIC }
and invited
if mode = 0.
Text message
{
"type": "text/plain",
"body": "content",
"react-to": "id (optional)"
}
Or for an edition:
{
"type": "application/edited-message",
"body": "content",
"edit": "id of the edited commit"
}
फोन
Show the end of a call (duration in milliseconds):
{
"type": "application/call-history+json",
"to": "URI",
"duration": "3000"
}
Or for hosting a call in a group (when it starts)
{
"type": "application/call-history+json",
"uri": "host URI",
"device": "device of the host",
"confId": "hosted confId"
}
A second commit with the same JSON + duration
is added at the end of the call when hosted.
Add a file
{
"type": "application/data-transfer+json",
"tid": "unique identifier of the file",
"displayName": "File name",
"totalSize": "3000",
"sha3sum": "a sha3 sum"
}
totalSize
is in bits,
Updating profile
{
"type": "application/update-profile",
}
Member event
{
"type": "member",
"uri": "member URI",
"action": "add/join/remove/ban"
}
When a member is invited, join or leave or is kicked from a conversation
Vote event
Generated by administrators to add a vote for kicking or un-kicking someone.
{
"type": "vote",
"uri": "member URI",
"action": "ban/unban"
}
!! पुरानो ड्राफ्ट!!
टिप्पणी
Following notes are not organized yet. Just some line of thoughts.
क्रिप्टो सुधारहरू।
एक गम्भीर समूह च्याट सुविधाको लागि, हामीलाई गम्भीर क्रिप्टो पनि चाहिन्छ। हालको डिजाइनको साथ, यदि एक प्रमाणपत्र कुराकानीको अघिल्लो DHT मानहरूको रूपमा चोरी भयो भने, कुराकानी डिक्रिप्ट गर्न सकिन्छ। हुनसक्छ हामी ** डबल रचेट ** जस्तै केहि जानु पर्छ।
टिप्पणी
A lib might exist to implement group conversations.
OpenDHT मा ECC समर्थन आवश्यक छ
प्रयोग
भूमिकाहरू थप्न?
समूह च्याटका लागि दुईवटा प्रमुख प्रयोगका केसहरू छन्ः
कुनै कम्पनीमा एउटा Mattermost जस्तै, निजी च्यानलहरू, र केही भूमिकाहरू (प्रशासक / दर्शक / बोट / आदि) वा शिक्षाको लागि (जहाँ केही मात्र सक्रिय छन्) ।
क्षैतिज कुराकानी साथीहरूबीचको कुराकानी जस्तै हो।
Jami will be for which one?
कार्यान्वयनको विचार
एउटा समूहको लागि प्रमाणपत्र जुन प्रयोगकर्तालाई भूमिकाको लागि झण्डाको साथ साइन गर्दछ। थप वा रद्द पनि गर्न सकिन्छ।
वार्तालापमा सहभागी हुनुहोस्
प्रत्यक्ष निमन्त्रणाद्वारा मात्र
लिंक/QR कोड/कुनै पनि
एउटा कोठाको नामबाट?
हामीलाई के चाहिन्छ
गोपनीयताः समूह च्याट बाहिरका सदस्यहरूले समूहमा सन्देशहरू पढ्न सक्नु हुँदैन
गुप्तताः यदि समूहबाट कुनै कुञ्जीलाई जोखिममा पारिएको छ भने, अघिल्लो सन्देशहरू गोपनीय रहनुपर्दछ (सम्भव भन्दा बढी)
सन्देश क्रमबद्ध गर्नुः सन्देशहरू सही क्रममा हुनु आवश्यक छ
समक्रमण: सबै सन्देशहरू सकेसम्म छिटो प्राप्त गर्न पनि सुनिश्चित गर्नु आवश्यक छ।
निरन्तरता: वास्तवमा, DHT मा सन्देश मात्र 10 मिनेट सम्म रहन्छ। किनभने यो यस प्रकारको DHT को लागि गणना गरिएको उत्तम समय हो। डाटा कायम राख्नको लागि, नोडले DHT मा मान प्रत्येक 10 मिनेटमा पुनः सेट गर्नुपर्दछ। अर्को तरीका भनेको नोड अफलाइन हुँदा नोडहरूले डाटा पुनः सेट गर्न दिनुहोस्। तर, यदि 10 मिनेट पछि, 8 नोडहरू अझै पनि यहाँ छन् भने, तिनीहरूले 64 अनुरोधहरू गर्नेछन् (र यो exponential छ) । त्यसका लागि स्प्यामिंगबाट बच्नको लागि हालको तरिका क्वेरी गरिएको छ। यसले अझै पनि 64 अनुरोधहरू गर्नेछ तर अधिकतम redundancy 8 नोडहरूमा सीमित गर्दछ।
अन्य वितरण तरिकाहरू
आईपीएफएस: केही अनुसन्धान आवश्यक छ
BitMessage: केही अनुसन्धान चाहिन्छ
मदनसेफ: केही अनुसन्धान चाहिन्छ
हालको काममा आधारित
समूह च्याट हामीसँग पहिले नै बहु-उपकरणहरूको लागि भएको उही काममा आधारित हुन सक्छ (तर यहाँ, समूह प्रमाणपत्रको साथ) समाधान गर्न समस्याहरूः
यो डाटाबेसलाई क्लाइन्टबाट डेमोनमा सार्नुपर्छ।
यदि कसैले पनि जडान गर्दैन भने, समक्रमण गर्न सकिदैन, र व्यक्तिले कहिल्यै कुराकानी देख्दैन
अर्को समर्पित DHT
सुपरयूजरको साथ डीएचटी जस्तै।
What's next for file transfers
Currently, the file transfer algorithm is based on a TURN connection (See फाइल स्थानान्तरण). In the case of a big group, this will be bad. We first need a P2P connection for the file transfer. Implement the RFC for P2P transfer.
Other problem: currently there is no implementation for TCP support for ICE in PJSIP. This is mandatory for this point (in PJSIP or homemade)