Our Twincode technology allows us to setup various kinds of relations
without knowing private information about any party.
Twincodes implement a peer-to-peer relationship model administered by the signaling server.
Twincodes are composed of the following 4 “facets”:
The twincode Factory generates the object identifiers, and defines its ownership and access rights properties;
The twincode Outbound is a proxy of the called object, given to a calling object;
The twincode Inbound defines the entry point to the called object;
The twincode Switch connects the twincode Outbound to the twincode Inbound.
Twincode facets are defined by 4 unique identifiers. These identifiers are version 4 UUIDs (128-bit).
Their relationships are represented in the figure below.
“Click-to-Call” relationship model
The twincode relationship model is covered by EU Patent N°3 020 179 granted on 31 May 2017
under the title “Distributed Programmable Connection Method to establish Peer-to-Peer Multimedia
Interactions” (application date: 10 July 2014).
The twincode relationship model is used to represent:
Our applications protect your privacy and freedom by sending messages and
photos directly between devices, without storing any content on a server.
When a device wants to connect to a peer, it generates an SDP (Session Description Protocol)
message to initiate the WebRTC connection. The SDP message is sent to the signaling server
along with the peer’s twincode to identify the target device. The server then attempts
to wake up the peer device using Google or Apple push notification services. Once the peer
device is awake, it connects to the signaling server and retrieves the SDP message.
WebRTC direct communication and encrypted signaling
A signaling server is used for the administration of twincodes and handles the WebRTC signaling
between devices. Our server implements the twincode objects relationships and when a device
wants to establish a WebRTC direct connection, it forwards the WebRTC signaling messages
to the devices. To protect the signaling setup, these signaling messages (known as SDP)
are encrypted on each device with shared secrets which are changed regularly.
This is explained in our article Securing WebRTC Signaling: How Twinme Encrypts SDPs for Safe Device Connections.
Encrypted signaling
We also operate our own TURN servers, deployed in several regions around the world.
TURN servers act as relays: when two devices cannot establish a direct connection
(for example due to restrictive NATs or firewalls), the traffic is relayed through
the nearest TURN server instead. In practice, about 75% of WebRTC traffic between
our users flows directly device-to-device, and only around 25% is relayed through
a TURN server.
Even when relayed, the traffic stays end-to-end encrypted (SRTP/DTLS),
so a TURN server only sees connection metadata (IP addresses, ports, timings),
never the content.