Cjdns Core Notes

Introduction

A number of us have begun the task of documenting and reverse engineering the cjdns core. The "core" refers to the core functionality required to implement a cjdns-compatible router.

To speak with those involved, join irc.fc00.io/#documentation

Status

ansuz has re-implemented the xor metric and key generation process, along with the support functions involved, notably the implementation of Base32 used by cjdns.

jph is experimenting with writing a minimal, linux first implementation in golang, along with deconstructing everything involved in making that happen. He is also investigating TUN support in other languages (notably Python and ocaml).

Note to contributors:

TUN device support

Overview

Cjdns uses TUN devices to create a virtual network interface and enable routable peer to peer connections. Therefore, TUN support is a critical requirement for implement a cjdns router.

At this time, the following languages have built-in or third-party TUN support:

Please note that "TUN support" may not have the full functionality required by a cjdns router. As this section is expanded, we will describe what that functionality is.

In addition, be aware that TUN implementation varies across operating system implementations. Multiplatform router implementations need to keep this in mind.

Creating a TUN device

TBC

Configuring a TUN device

TBC

Cryptography

Cryptography provides core functionality within cjdns. Here we will describe some of the cryptographic functions performed within cjdns and implementation details.

Public Keys

Utility Functions

Instead of relying on external libraries, some utility functions have been re-implemented within cjdns. We will describe those functions that differ from standard implementations to ensure compatibility with existing cjdns routers.

JSON

cjdns config files are typically stored as what the community often refers to as cjdson. As finn has pointed out, comments in json are not unheard of.

In any case, we're going to try to add some functionality to that repo that the others lack, such as inserting fields without deleting comments.

Base32

This Javascript library is a direct translation of the cjdns base32 encoder written in C