A DATEX Block consists of 4 main sections:
- A Routing Header, which mainly contains information about the sender and receivers of the block, and important information about the block (e.g. block size)
- A Block Header, which contains metadata about the current block (type, timestamp, id, flags)
- A Encrypted Header that is part of the optionally encrypted section of the block, and contains secret information that is only visible to the receivers of the block
- A Body, which contains executable DATEX instructions
| Field | Size | Type | Condition (for optional fields) |
|---|---|---|---|
| Magic Number | 2 bytes | array | - |
| Version | 1 byte | uint8 | - |
| Block Size | 2 bytes | uint16 | - |
| Flags | 1 byte | bitmask | - |
| Checksum | 4 bytes | uint32 | Has Checksum equals true |
| Distance | 1 byte | uint8 | - |
| TTL | 1 byte | uint8 | - |
| Sender | 21 bytes | endpoint | - |
| Receivers Pointer ID | 26 bytes | pointer | Receiver Type equals "Pointer" |
| Number of Receivers | 1 byte | uint8 | Receiver Type in ("Receivers","ReceiversWithKeys") |
| Receivers | 21 bytes x Number of Receivers |
endpoint | Receiver Type equals "Receivers" |
| Receivers with Keys | 533 bytes x Number of Receivers |
- | Receiver Type equals "ReceiversWithKeys" |
| Signature | 108 bytes | string | Signature Type equals "Unencrypted" |
| Encrypted Signature | 108 bytes | string | Signature Type equals "Encrypted" |
| Field | Size | Type |
|---|---|---|
| Signature Type | 2 bits | enum |
| Encryption Type | 1 bit | enum |
| Receiver Type | 2 bits | enum |
| Is Bounce Back | 1 bit | boolean |
| Has Checksum | 1 bit | boolean |
Enum Mapping:
| Integer Value | Mapped Value |
|---|---|
0b00 |
"None" |
0b10 |
"Unencrypted" |
0b11 |
"Encrypted" |
0b01 |
"Invalid" |
Enum Mapping:
| Integer Value | Mapped Value |
|---|---|
0 |
"None" |
1 |
"Encrypted" |
Enum Mapping:
| Integer Value | Mapped Value |
|---|---|
0b00 |
"None" |
0b01 |
"Pointer" |
0b10 |
"Receivers" |
0b11 |
"ReceiversWithKeys" |
| Field | Size | Type |
|---|---|---|
| Receiver | 21 bytes | endpoint |
| Key | 512 bytes | hex |
| Field | Size | Type | Condition (for optional fields) |
|---|---|---|---|
| Context ID | 4 bytes | uint32 | - |
| Section Index | 2 bytes | uint16 | - |
| Block Number | 2 bytes | uint16 | - |
| Flags and Timestamp | 8 bytes | bitmask | - |
| Lifetime | 4 bytes | uint32 | Has Lifetime equals true |
| Represented By | 21 bytes | endpoint | Has Represented By equals true |
| IV | 16 bytes | - | Has IV equals true |
| Field | Size | Type |
|---|---|---|
| Block Type | 4 bits | enum |
| Has Side Effects | 1 bit | boolean |
| Has Only Data | 1 bit | boolean |
| Is End of Section | 1 bit | boolean |
| Is End of Context | 1 bit | boolean |
| Has Lifetime | 1 bit | boolean |
| Has Represented By | 1 bit | boolean |
| Has IV | 1 bit | boolean |
| Is Compressed | 1 bit | boolean |
| Is Signature in Last Subblock | 1 bit | boolean |
| Reserved | 8 bits | uint |
| Creation Timestamp | 43 bits | uint |
Enum Mapping:
| Integer Value | Mapped Value |
|---|---|
0 |
"Request" |
1 |
"Response" |
2 |
"Hello" |
3 |
"Trace" |
4 |
"TraceBack" |
| Field | Size | Type | Condition (for optional fields) |
|---|---|---|---|
| Flags | 1 byte | bitmask | - |
| On Behalf Of | 21 bytes | endpoint | Has On Behalf Of equals true |
| Field | Size | Type |
|---|---|---|
| User Agent | 4 bits | enum |
| Has On Behalf Of | 1 bit | boolean |
Enum Mapping:
| Integer Value | Mapped Value |
|---|---|
0 |
"Unknown" |
1 |
"Human" |
2 |
"Bot" |
3 |
"Service" |