Crust: Connections in Rust

Crust is a low level networking library that is optimised for peer-to-peer connections and data transportation. It encorporates the following highlighted features:

 ●   Multi-protocol : UDP & TCP increases connection success rate.

 ●   Secure serialisation : all communications are securely encrypted.

 ●   Bootstrap cache : up-to-date list of start-up nodes.

An overview of Crust

Crust implements primitives to connect two peers together and start exchanging messages in a secure, reliable way. It supports multiple protocols (UDP and TCP) and it is crypto secure - all communications, starting with handshake messages, are encrypted. It also provides other security features like randomised ports that are used to prevent targeting a particular known port to conduct DoS attacks. Crust implements several NAT traversal techniques such as hole punching and use of IGD.

Upcoming Features / Benefits

 ● Multi-protocolAdding to the existing TCP & UDP hole-punching protocols Crust will soon include TCP-direct and introduce µTP, which wraps UDP and adds reliability, congestion control and ordered delivery to make a more robust and a better paradigm. Supporting multiple protocols means that if a firewall/router does not support one particular protocol then the network switches to another to get connected. If the firewall/router supports all protocols then Crust chooses the 1st protocol that successfully establishes the connection.

 ● Secure serialisationThe network encrypts everything handed to it for transportation automatically. With Secure serialisation we have negated MITM attack as everything on the network is encrypted at each network hop. Also, the node signing each packet provides non-repudiation as the sender cannot deny that they signed the packet.

 ● Bootstrap cacheBootstrap caching enhances the concept of using genesis nodes (hard-coded addresses) for initial node detection by dynamically creating a list of nodes which are directly reachable without the need to hole-punch. This list is appended and pruned as nodes connect/disconnect to the network so is always kept up-to-date.


This Crust library is dual-licensed under the Modified BSD ( LICENSE-BSD) or the MIT license ( LICENSE-MIT) at your option.


Copyrights in the Safe Network are retained by their contributors. No copyright assignment is required to contribute to this project.