xx network Codebase Overview

This overview breaks down the architecture of the public alpha codebase, with over 76,000 lines of code composed of Core, Services and Client libraries and implementations for users and for nodes to run services.

Posted by: Ben Wenger
Posted on: March 24, 2020

The xx network Public Alpha codebase is currently organized into three sets of
repositories: Core, Services, and Clients. Core libraries handle functionality across
Clients and Services, which contain data structures, interfaces, and cryptography
common to many or all of the xx network components. Services implement different
messenger features, as well as authorizing users and nodes to join the network.
Clients interact with the network using a shared Client API (Arrow SDK).

xx core


Primitives are the basic data structures and utilities that are used by all repositories.
These include the ID structure for nodes/users/clients/etc, the network definition
configuration file, and the message payload format. These may be split into
individual repositories or merged to specific dependencies as appropriate.


Crypto holds all of the base cryptographic functionality. Relying heavily on golang’s
big integer implementation, Crypto features a cryptographically secure random
number generator implementation, libraries for working with large integers in
multiplicative groups for cMix operations, and basic encrypt/decrypt functionality.
A core approach to this library is to wrap operations which may need to be replaced
as the project matures to make migration easier.
The Crypto library, like Primitives, should only hold code that’s generic to the larger
system, with code being merged or separated into repositories as appropriate.


Comms handles all network communication functionality. It holds a grpc protocol
file along with a thin client/server implementation. It also contains all the core
connectivity logic. The library currently uses TLS certs with RSA keys for encryption
and identification, which will migrate to xx consensus based quantum secure
authenticated channels as development progresses.

xx services


Server incorporates the core cMix functionality. It performs precomputation and
realtime computation and processes messages. It receives batches of messages
from the gateways as well as performing network team operations.

Gateway Server

The Gateway Server is the API for Clients to interact with the network. Every Server
runs a Gateway and the Gateways collect and store messages for Clients. Gateway is
designed to be a scalable front end to the xx network.


Permissioning, or registration, manages the network definition file for Clients and
Servers. Eventually this functionality will be managed by the distibuted xx
consensus. For now, this code handles admission and manages which nodes are
part of the network.

xx clients

Client API (Arrow SDK)

The Client API is used by all Clients to interact and send messages with the cMix
network. It uses go-mobile to produce a library compatible with iOS and Android.

Mobile Clients

We have implementations for iOS and Android. These both use the go-mobile
libraries produced in the Client API.

Other Clients

We have a desktop client, a user discovery bot, and several other example bots that
can connect to and interact with the network.



Devops is a deployment platform for Azure, Google cloud platform, and Amazon web
services written in Terraform. With Devops, we can automatically deploy test
networks, manage deployments of individual nodes, and deploy multi-cloud
implementations of xx network.


The integration repository is a series of end-to-end tests designed to test different
functionality of the network. Several tests focus on different batch sizes with servers
only. Another test covers all the client-level interaction with the network.
Local Environment
Local environment is a set of scripts designed to allow the testing of the entire
platform on a single machine


The dashboard is a network monitoring tool. It can be found here.