1.9 KiB
1.9 KiB
Transmat protocol description
ver. 0.1
Dramatis Personae:
Relay - Transphase relay Relay Sender - sending party Receiver - receiving party
- Sender creates a low-entropy password, derives a key and a
peer_group_idvaule and sends the message containing thepeer_group_idto the Relay - Relay maintains a list of all its peers grouped by their
peer_group_idvalue.- If the current message has a new unique
peer_group_id, then a new peer group is created. - If the current message has a known
peer_group_id, then a new peer group is created from it and the party that sent the message (normally the Sender) is added to that group.
- If the current message has a new unique
- Sender passes the low-entropy password to the Receiver over a different channel (e.g. phone or SSH).
- Receiver derives a key and a
peer_group_idvalue and sends the message containing thepeer_group_idto the Relay.- This message contains 0 as
chunk_numberso that the Sender knows that the transfer should start from the very beginning.
- This message contains 0 as
- Relay forwards this message to all other peers in the corresponding peer group (that is to the Sender).
- Sender receives this message; sends the encrypted chunk and metadata; and then waits for the Receiver to send a confirmation that it has successfully received the message.
- Relay forwards this message to all other peers in the corresponding peer group (that is to the Receiver).
- Receiver decrypts the payload and writes it to the target file. (TODO: Check chunk hash) Then it sends a confirmation to the Relay. The confirmation contains the incremented number as the
chunk_id- If this was the last chunk in the transmission, Receiver closes the Websocket connection to the Relay
- Sender receives the confirmation and sends the next encrypted chunk and metadata.
- If Sender has no more chunks to send, Sender closes the Websocket connection to the Relay