NetText

A text-based data format for cryptographic network protocols.

Principles

Fundamental types

A term can be of any of the following kinds:

Dicts are represented as follows:

{ key1 = value1, key2 = value2 }

Dicts are represented as follows:

[ term1, term2 ]

Sequences are represented as follows:

term1 term2 term3

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

SEND MESSAGE { topic = blah, to = [ TOPIC hello, USER john ], body = blah blah }

The raw representation of a parsed dict or sequence 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 sequence in that string.

In the complex stance example above, here are the sequence 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: