sync/sync_protocol.md
author Thomas
Thu, 27 Jun 2019 09:29:20 +0200
branchsequoia_windows
changeset 3878 37426cf0d1fe
parent 3606 341d6694d968
permissions -rw-r--r--
Merge with ENGINE-581
     1 # p≡p Sync protocol
     2 
     3 ## Protocol Stack
     4 
     5 Key Sync | Trust Sync | Contact Sync | Task Sync
     6 - | - | - | -
     7 Sync
     8 Baseprotocol
     9 Transport
    10 
    11 ## Forming a Device Group with Key Sync
    12 
    13 ### Sender
    14 
    15 A Sender is the Person sending a message. In case of M2M it is the Operating
    16 Entity of the Device sending.
    17 
    18 ### Device
    19 
    20 A Device is an entitiy, which is sending representative of a Sender.
    21 
    22 ### State Sole
    23 
    24 A Device is in state Sole when it is not member of a Device group and when it
    25 is not part of a Negotiation.
    26 
    27 ### State Grouped
    28 
    29 A Device is in state Grouped when it is member of a Device group and when it is
    30 not part of a Negotiation.
    31 
    32 ## Negotiation as a Transaction
    33 
    34 ### TID
    35 
    36 A TID (transaction ID) is a UUID version 4 variant 1.
    37 
    38 ### Challenge
    39 
    40 The Challenge is identified by a TID. The Challenge is being set by each Beacon
    41 and must be repeated in a corresponding Negotiation Request. The Challenge has
    42 two functions:
    43 
    44 1. The Challenge makes it possible to filter out own Beacons
    45 1. The Challenge makes it necessary to be able to read the communication
    46    channel (usually an Inbox), otherwise Beacons cannot be answered
    47 
    48 ### Negotiation
    49 
    50 A Negotiation is a Transaction identified by a TID. The Negotiation's TID is
    51 the XOR of the two Challenge TIDs of the two devices, respectively.
    52 
    53 ## Roles and Keys
    54 
    55 ### Sender signing
    56 
    57 The key with which the Sender of the message is signing. In case of trusted
    58 messages this is signalled within the encrypted message. This is signalled by
    59 by opt_field pEp-sender-sign, which is not reflected to the outer message.
    60 
    61 Transports can opt to use HMAC or OMAC instead of digital signatures.
    62 
    63 ### Transport signing
    64 
    65 Keys with which others and not the Sender are signing a message.
    66 
    67 ### Sender Group key
    68 
    69 A Sender Group Key is a Sender's signing key, which is used to update the
    70 Device Group information. If it is reset the Device Groups breaks.
    71