In order to allow easy integration with arbitrary applications, the Overlay Network has a minimalist design. The main task is to provide transport channels between any nodes in the world. Exposed super peers are used to discover other nodes. If a direct connection between two nodes is not possible, the traffic is forwarded via a super peer. Each node generates an identity at the first start, through which the node can be uniquely addressed.
The network gives no guarantee that messages sent will arrive, arrive in the correct order or arrive exactly once.
At startup the drasyl node connects to an always-present root node (the super peer). The super peer helps to discover other nodes and establish direct connections to other nodes.
drasyl uses different methods to find other peers. Peers running within a JVM are automatically discovered via shared memory. Local peers running in other JVMs on the same computer are found via the file system. Remote nodes are found using the Super Peer, which acts as a rendezvous server.
Each node generates on the first start a unique identity consisting of a public/private key-pair and a proof of work (PoW). The public key is used to address the node. The PoW is required to prevent sybil attacks on the network by generating a large amount of identities. Currently, a cpu-hard PoW is used. For the future a change to a memory-hard PoW is planned.
Any message in drasyl is encrypted by default unless you disable the encryption in the configuration file. We strongly advise against turning off the encryption!
drasyl uses the public part of an ed25519 key pair to address any node in the drasyl network. To provide fast 0-RTT encryption, drasyl operates in two modes of encryption:
In the first mode, drasyl uses the ed25519 keys and converts them into a curve25519, to do an 0-RTT x25519 key agreement – we call this the long-time encryption. Long-time encryption is the default case.
To raise the security and provide perfect forward secrecy, drasyl tries in the background to do key exchange and agreement with a newly generated ephemeral curve25519. If a perfect forward secrecy session was established between the two nodes, drasyl fires a PerfectForwardSecrecyEncryptionEvent. If the connection provides no longer perfect forward secrecy a LongTimeEncryptionEvent is fired.
Both x25519 key agreements generate two shared secrets, to avoid the need for any synchronization.
The shared secrets will be used as a key for the stream cipher XChaCha20, with the additional Poly1305 authenticator, to provide AEAD. Using a stream cipher allows efficient computation on weak devices that do not have an AES hardware module.
We have created several BPMN diagrams for important components/processes within the overlay network
- Node Lifecycle
- Register at Super Peer
- Send, Relay & Receive Message
- Establish Direct Connection (P2P)