NetText

A text-based data format for cryptographic network protocols.

Principles

Fundamental types

A term can be of any of the following kinds:

Nested lists can be represented using a special dictionnary with a single key, ., for instance TEST a { . = 0 4 2 1 9 7 0 } c.

Dicts are represented as follows:

{ key1 = value1, key2 = value2 }

Lists are represented as follows:

term1 term2 term3

As a consequence, complex data structures can be defined as follows:

SENDTO alex { topic = blah, body = blah blah }

The raw representation of a parsed dict or list is retained for hashing purposes. It in the sequence of bytes, in the encoded string, trimmed from whitespace at extremities, that represents the encoded dict or list in that string.

In the complex stance example above, here are the lists and dicts and their raw representation:

Since strings cannot contain whitespace, they are always equivalent to their raw representation.

Structural mappings

Terms can be interpreted in a number of different ways, depending on the context:

Data mappings

Terms further have mappings as different data types: