diff --git a/docs/assets/images/message_init.png b/docs/assets/images/message_init.png
new file mode 100644
index 0000000000000000000000000000000000000000..7d3cad3c594a522434818a3e3acd19167c3b9a08
Binary files /dev/null and b/docs/assets/images/message_init.png differ
diff --git a/docs/assets/images/message_setup.png b/docs/assets/images/message_setup.png
new file mode 100644
index 0000000000000000000000000000000000000000..85893f0340a094e7a596d2c3ec3028177d56429c
Binary files /dev/null and b/docs/assets/images/message_setup.png differ
diff --git a/docs/protocol/layers/framing.md b/docs/protocol/layers/framing.md
new file mode 100644
index 0000000000000000000000000000000000000000..792a87cc76f387885f5262fd5fb36c76cd3225b5
--- /dev/null
+++ b/docs/protocol/layers/framing.md
@@ -0,0 +1,54 @@
+# Framing Layer
+
+## State Machine
+
+The framing layer has two possible states: `HANDSHAKE` and `CONNECTED`.
+It starts off in `HANDSHAKE` state.
+
+## Handshake State
+
+First, the client sends `0x42b33f00` with certain flags set depending on
+available features:
+
+|Flag  |Meaning    |
+|------|-----------|
+|`0x01`|TLS        |
+|`0x02`|Compression|
+
+Afterwards, the client sends a list of all protocols it supports:
+
+|Version     |Protocol                                          |
+|------------|--------------------------------------------------|
+|`0x00000001`|Old legacy protocol, which won’t be described here|
+|`0x00000002`|Datastream protocol, as described in this document|
+
+To mark the end of the list, the client sets the flag `0x80000000` on the last
+protocol in the list.
+
+The server responds with the following data:
+
+|Type   |Field  |Description                                        |
+|-------|-------|---------------------------------------------------|
+|`UChar`|flags  |As described above                                 |
+|`Short`|extra  |Extra data, depends on the protocol, so far ignored|
+|`Char` |version|Protocol Version                                   |
+
+Afterwards, the server expects the client to first enable TLS (if supported) and
+afterwards compression (if supported).
+
+Compression is handled as Deflate applied to the socket.
+
+This negotiation ends with the protocol advancing into the `CONNECTED` state.
+
+## Connected State
+
+### Receiving 
+
+The client reads an uint32_t of the size of the following message frame in
+bytes, followed by that message frame.
+
+### Sending
+
+The client sends an uint32_t of the size of the message frame in bytes, followed
+by that message frame. Afterwards, if compression is enabled, the compressor is
+flushed.   
\ No newline at end of file
diff --git a/docs/protocol/layers/message.md b/docs/protocol/layers/message.md
new file mode 100644
index 0000000000000000000000000000000000000000..5c07453acc6c6d765038b2ad1f92e3ab7b25ee85
--- /dev/null
+++ b/docs/protocol/layers/message.md
@@ -0,0 +1,39 @@
+# Message Layer
+
+## State Machine
+
+The framing layer has two possible states: `HANDSHAKE` and `CONNECTED`.
+It starts off in `HANDSHAKE` state.
+
+## Handshake State
+
+In this state, messages are encoded/decoded according to the [Handshake](../serialization/handshake.html)
+specification.
+
+[![Init Diagram](../../assets/images/message_init.png)]((../../assets/images/message_init.png))
+
+Client and core exchange messages according to the diagram described above, when
+a ClientLoginAck and SessionInit have been received, the state advances into
+`CONNECTED`.
+
+### Core Setup
+
+[![Core Setup Diagram](../../assets/images/message_setup.png)](../../assets/images/message_setup.png)
+
+When the client receives a CoreInitAck message, with "Configured" set to "False", it will display to the user a list, allowing them to choose a StorageBackend from the ones present in CoreInitAck’s "StorageBackends" attribute.
+
+If the user chooses one such backend, and the backend has a SetupKeys attribute which is not-empty, the user will be presented with input fields for each of the keys, pre-populated with the values of the SetupDefaults map. Each field allows only inputs of the same type as the default value, so, for example, a field named "Port" which has the default value QVariant(Int, 4242) would only allow integers to be input.
+
+As soon as the user has properly filled out and configured these settings, they will choose the username and password of the new account that is to be set up on the core.
+
+The first account set up is a so-called "Admin Account", although this does not yet provide any special abilities.
+
+The client will then send a new CoreSetupData message containing a SetupData attribute with all the previously specified settings.
+
+If the client receives a CoreSetupReject, it will display the specified error to the user, and, if wished, allow them to try configuring again.
+
+If the client receives a CoreSetupAck, the client will proceed normally in the init procedure, by sending the ClientLogin message.
+
+## Connected State
+
+In this state, 
\ No newline at end of file
diff --git a/docs/protocol/serialization/compound.md b/docs/protocol/serialization/compound.md
index 92a07be8edd90a1ead8a927f9f3d53ae074a5426..b5480fca53a82b65d3f6255bb7878110c6317de4 100644
--- a/docs/protocol/serialization/compound.md
+++ b/docs/protocol/serialization/compound.md
@@ -1,243 +1,195 @@
 # Compound Types
 
 This document discusses how complex objects are translated to and from
-VariantMaps.
-
-Complex Structs are (de-)serialized to and from VariantMaps. If the Complex
-Struct is sent/received during handshake, an additional key/value pair "MsgType"
-is added, which contains the name of the complexStruct’s type – for example
-"ClientInitAck" as String16
-
-## ClientInitAck
-
-| Field           | Type                          | Description                                                                    |
-|-----------------|-------------------------------|--------------------------------------------------------------------------------|
-| Configured      | `bool`                        | Is set, if the core has at least one account and a storage backend is selected |
-| LoginEnabled    | `bool`                        | Specifies if clients can authenticate against the core                         |
-| CoreFeatures    | `uint8`                       | An int specifying the features the core supports                               |
-| StorageBackends | `VariantList<StorageBackend>` | A VariantList of StorageBackends, see below                                    |
-
-### StorageBackend
-
-| Field         | Type         | Description                                                 |
-|---------------|--------------|-------------------------------------------------------------|
-| DisplayName   | `string16`   | The name of the storage backend                             |
-| Description   | `string16`   | A user-readable description                                 |
-| SetupKeys     | `StringList` | A list of keys that need to be set to configure the backend |
-| SetupDefaults | `VariantMap` | The default values for each key                             |
-
-## CoreSetupData
-
-| Field     | Type        | Description    |
-|-----------|-------------|----------------|
-| SetupData | `SetupData` | The setup data |
-
-### SetupData
-
-| Field                | Type         | Description                                                                                                           |
-|----------------------|--------------|-----------------------------------------------------------------------------------------------------------------------|
-| AdminUser            | `string16`   | The username of the new user                                                                                          |
-| AdminPasswd          | `string16`   | The password of the new user                                                                                          |
-| Backend              | `string16`   | The DisplayName of the selected backend.                                                                              |
-| ConnectionProperties | `VariantMap` | The connection settings for the selected backend. The types of each value have to match the type of the default value |
-
-## CoreSetupReject
-
-| Field | Type       | Description                                                                                     |
-|-------|------------|-------------------------------------------------------------------------------------------------|
-| Error | `string16` | The error message that will be displayed to the user as reason why configuring was not possible |
-
-## CoreSetupAck
-
-This type contains no fields.
+QVariantMaps.
 
 ## Network::Server
 
 Warning: This type has, when serialized, QVariantType "Network::Server" (which
-is a usertype), but actually is just a variantmap for the following complex
+is a usertype), but actually is just a QVariantMap for the following complex
 type:
 
 | Field      | Type       | Description |
 |------------|------------|-------------|
-| UseSSL     | `bool`     | --          |
-| sslVersion | `int32`    | --          |
-| Host       | `string16` | --          |
-| Port       | `int32`    | --          |
-| Password   | `string16` | --          |
-| UseProxy   | `bool`     | --          |
-| ProxyType  | `int32`    | --          |
-| ProxyHost  | `string16` | --          |
-| ProxyPort  | `int32`    | --          |
-| ProxyUser  | `string16` | --          |
-| ProxyPass  | `string16` | --          |
+| UseSSL     | `Bool`     | --          |
+| sslVersion | `Int`      | --          |
+| Host       | `QString`  | --          |
+| Port       | `Int`      | --          |
+| Password   | `QString`  | --          |
+| UseProxy   | `Bool`     | --          |
+| ProxyType  | `Int`      | --          |
+| ProxyHost  | `QString`  | --          |
+| ProxyPort  | `Int`      | --          |
+| ProxyUser  | `QString`  | --          |
+| ProxyPass  | `QString`  | --          |
 
 ## SessionState
 
-| Field       | Type                      | Description |
-|-------------|---------------------------|-------------|
-| Identities  | `VariantList<Identity>`   | --          |
-| BufferInfos | `VariantList<BufferInfo>` | --          |
-| NetworkIds  | `VariantList<NetworkId>`  | --          |
+| Field       | Type                       | Description |
+|-------------|----------------------------|-------------|
+| Identities  | `QVariantList<Identity>`   | --          |
+| BufferInfos | `QVariantList<BufferInfo>` | --          |
+| NetworkIds  | `QVariantList<NetworkId>`  | --          |
 
 ## Identity
 
 Warning: This type has, when serialized, QVariantType "Network::Server" (which
-is a usertype), but actually is just a variantmap for the following complex
+is a usertype), but actually is just a QVariantMap for the following complex
 type:
 
-| Field                   | Type         | Description |
-|-------------------------|--------------|-------------|
-| identityId              | `IdentityId` | --          |
-| identityName            | `string16`   | --          |
-| realName                | `string16`   | --          |
-| nicks                   | `StringList` | --          |
-| awayNick                | `string16`   | --          |
-| awayNickEnabled         | `bool`       | --          |
-| awayReason              | `string16`   | --          |
-| awayReasonEnabled       | `bool`       | --          |
-| autoAwayEnabled         | `bool`       | --          |
-| autoAwayTime            | `int32`      | --          |
-| autoAwayReason          | `string16`   | --          |
-| autoAwayReasonEnabled   | `bool`       | --          |
-| detachAwayEnabled       | `bool`       | --          |
-| detachAwayReason        | `string16`   | --          |
-| detachAwayReasonEnabled | `bool`       | --          |
-| ident                   | `string16`   | --          |
-| kickReason              | `string16`   | --          |
-| partReason              | `string16`   | --          |
-| quitReason              | `string16`   | --          |
+| Field                   | Type          | Description |
+|-------------------------|---------------|-------------|
+| identityId              | `IdentityId`  | --          |
+| identityName            | `QString`     | --          |
+| realName                | `QString`     | --          |
+| nicks                   | `QStringList` | --          |
+| awayNick                | `QString`     | --          |
+| awayNickEnabled         | `Bool`        | --          |
+| awayReason              | `QString`     | --          |
+| awayReasonEnabled       | `Bool`        | --          |
+| autoAwayEnabled         | `Bool`        | --          |
+| autoAwayTime            | `Int`         | --          |
+| autoAwayReason          | `QString`     | --          |
+| autoAwayReasonEnabled   | `Bool`        | --          |
+| detachAwayEnabled       | `Bool`        | --          |
+| detachAwayReason        | `QString`     | --          |
+| detachAwayReasonEnabled | `Bool`        | --          |
+| ident                   | `QString`     | --          |
+| kickReason              | `QString`     | --          |
+| partReason              | `QString`     | --          |
+| quitReason              | `QString`     | --          |
 
 ## AliasManager
 
-| Field      | Type         | Description |
-|------------|--------------|-------------|
-| names      | `StringList` | --          |
-| expansions | `StringList` | --          |
+| Field      | Type          | Description |
+|------------|---------------|-------------|
+| names      | `QStringList` | --          |
+| expansions | `QStringList` | --          |
 
 ## BufferSyncer
 
-| Field       | Type                   | Description |
-|-------------|------------------------|-------------|
-| LastSeenMsg | `VariantList<Integer>` | --          |
-| MarkerLines | `VariantList<Integer>` | --          |
+| Field       | Type                    | Description |
+|-------------|-------------------------|-------------|
+| LastSeenMsg | `QVariantList<Integer>` | --          |
+| MarkerLines | `QVariantList<Integer>` | --          |
 
 
 ## BufferViewConfig
 
-| Field                      | Type                   | Description |
-|----------------------------|------------------------|-------------|
-| bufferViewName             | `string16`             | --          |
-| TemporarilyRemovedBuffers  | `List<Integer>`        | --          |
-| hideInactiveNetworks       | `bool`                 | --          |
-| BufferList                 | `List<Integer>`        | --          |
-| allowedBufferTypes         | `int32`                | --          |
-| sortAlphabetically         | `bool`                 | --          |
-| disableDecoration          | `bool`                 | --          |
-| addNewBuffersAutomatically | `bool`                 | --          |
-| networkId                  | `int32`                | --          |
-| minimumActivity            | `int32`                | --          |
-| hideInactiveBuffers        | `bool`                 | --          |
-| RemovedBuffers             | `VariantList<Integer>` | --          |
+| Field                      | Type                    | Description |
+|----------------------------|-------------------------|-------------|
+| bufferViewName             | `QString`               | --          |
+| TemporarilyRemovedBuffers  | `List<Integer>`         | --          |
+| hideInactiveNetworks       | `Bool`                  | --          |
+| BufferList                 | `List<Integer>`         | --          |
+| allowedBufferTypes         | `Int`                   | --          |
+| sortAlphabetically         | `Bool`                  | --          |
+| disableDecoration          | `Bool`                  | --          |
+| addNewBuffersAutomatically | `Bool`                  | --          |
+| networkId                  | `Int`                   | --          |
+| minimumActivity            | `Int`                   | --          |
+| hideInactiveBuffers        | `Bool`                  | --          |
+| RemovedBuffers             | `QVariantList<Integer>` | --          |
 
 ## BufferViewManager
 
-| Field         | Type                   | Description |
-|---------------|------------------------|-------------|
-| BufferViewIds | `VariantList<Integer>` | --          |
+| Field         | Type                    | Description |
+|---------------|-------------------------|-------------|
+| BufferViewIds | `QVariantList<Integer>` | --          |
 
 ## IgnoreListManager
 
-| Field      | Type                   | Description |
-|------------|------------------------|-------------|
-| scope      | `VariantList<Integer>` | --          |
-| ignoreType | `VariantList<Integer>` | --          |
-| isActive   | `VariantList<Boolean>` | --          |
-| scopeRule  | `StringList`           | --          |
-| isRegEx    | `VariantList<Boolean>` | --          |
-| strictness | `VariantList<Integer>` | --          |
-| ignoreRule | `StringList`           | --          |
+| Field      | Type                    | Description |
+|------------|-------------------------|-------------|
+| scope      | `QVariantList<Integer>` | --          |
+| ignoreType | `QVariantList<Integer>` | --          |
+| isActive   | `QVariantList<Boolean>` | --          |
+| scopeRule  | `QStringList`           | --          |
+| isRegEx    | `QVariantList<Boolean>` | --          |
+| strictness | `QVariantList<Integer>` | --          |
+| ignoreRule | `QStringList`           | --          |
 
 ## IrcChannel
 
-| Field     | Type         | Description |
-|-----------|--------------|-------------|
-| name      | `string16`   | --          |
-| topic     | `string16`   | --          |
-| password  | `string16`   | --          |
-| UserModes | `VariantMap` | --          |
-| ChanModes | `VariantMap` | --          |
-| encrypted | `bool`       | --          |
+| Field     | Type          | Description |
+|-----------|---------------|-------------|
+| name      | `QString`     | --          |
+| topic     | `QString`     | --          |
+| password  | `QString`     | --          |
+| UserModes | `QVariantMap` | --          |
+| ChanModes | `QVariantMap` | --          |
+| encrypted | `Bool`        | --          |
 
 ## IrcUser
 
-| Field             | Type         | Description |
-|-------------------|--------------|-------------|
-| server            | `string16`   | --          |
-| ircOperator       | `string16`   | --          |
-| away              | `bool`       | --          |
-| lastAwayMessage   | `int32`      | --          |
-| idleTime          | `DateTime`   | --          |
-| whoisServiceReply | `string16`   | --          |
-| suserHost         | `string16`   | --          |
-| nick              | `string16`   | --          |
-| realName          | `string16`   | --          |
-| awayMessage       | `string16`   | --          |
-| loginTime         | `DateTime`   | --          |
-| encrypted         | `bool`       | --          |
-| channels          | `StringList` | --          |
-| host              | `string16`   | --          |
-| userModes         | `string16`   | --          |
-| user              | `string16`   | --          |
+| Field             | Type          | Description |
+|-------------------|---------------|-------------|
+| server            | `QString`     | --          |
+| ircOperator       | `QString`     | --          |
+| away              | `Bool`        | --          |
+| lastAwayMessage   | `Int`         | --          |
+| idleTime          | `DateTime`    | --          |
+| whoisServiceReply | `QString`     | --          |
+| suserHost         | `QString`     | --          |
+| nick              | `QString`     | --          |
+| realName          | `QString`     | --          |
+| awayMessage       | `QString`     | --          |
+| loginTime         | `DateTime`    | --          |
+| encrypted         | `Bool`        | --          |
+| channels          | `QStringList` | --          |
+| host              | `QString`     | --          |
+| userModes         | `QString`     | --          |
+| user              | `QString`     | --          |
 
 ## NetworkConfig
 
 | Field              | Type    | Description |
 |--------------------|---------|-------------|
-| standardCtcp       | `bool`  | --          |
-| autoWhoEnabled     | `bool`  | --          |
-| autoWhoDelay       | `int32` | --          |
-| autoWhoNickLimit   | `int32` | --          |
-| autoWhoInterval    | `int32` | --          |
-| pingTimeoutEnabled | `bool`  | --          |
-| pingInterval       | `int32` | --          |
-| maxPingCount       | `int32` | --          |
+| standardCtcp       | `Bool`  | --          |
+| autoWhoEnabled     | `Bool`  | --          |
+| autoWhoDelay       | `Int`   | --          |
+| autoWhoNickLimit   | `Int`   | --          |
+| autoWhoInterval    | `Int`   | --          |
+| pingTimeoutEnabled | `Bool`  | --          |
+| pingInterval       | `Int`   | --          |
+| maxPingCount       | `Int`   | --          |
 
 ## NetworkInfo
 
-| Field                     | Type                         | Description |
-|---------------------------|------------------------------|-------------|
-| networkName               | `string16`                   | --          |
-| identityId                | `int32`                      | --          |
-| codecForServer            | `string16`                   | --          |
-| codecForEncoding          | `string16`                   | --          |
-| codecForDecoding          | `string16`                   | --          |
-| ServerList                | `VariantList<NetworkServer>` | --          |
-| useRandomServer           | `bool`                       | --          |
-| perform                   | `StringList`                 | --          |
-| useAutoIdentify           | `bool`                       | --          |
-| autoIdentifyService       | `string16`                   | --          |
-| autoIdentifyPassword      | `string16`                   | --          |
-| useSasl                   | `bool`                       | --          |
-| saslAccount               | `string16`                   | --          |
-| saslPassword              | `string16`                   | --          |
-| useAutoReconnect          | `bool`                       | --          |
-| autoReconnectInterval     | `int32`                      | --          |
-| autoReconnectRetries      | `int16`                      | --          |
-| unlimitedReconnectRetries | `bool`                       | --          |
-| rejoinChannels            | `bool`                       | --          |
+| Field                     | Type                          | Description |
+|---------------------------|-------------------------------|-------------|
+| networkName               | `QString`                     | --          |
+| identityId                | `Int`                         | --          |
+| codecForServer            | `QString`                     | --          |
+| codecForEncoding          | `QString`                     | --          |
+| codecForDecoding          | `QString`                     | --          |
+| ServerList                | `QVariantList<NetworkServer>` | --          |
+| useRandomServer           | `Bool`                        | --          |
+| perform                   | `QStringList`                 | --          |
+| useAutoIdentify           | `Bool`                        | --          |
+| autoIdentifyService       | `QString`                     | --          |
+| autoIdentifyPassword      | `QString`                     | --          |
+| useSasl                   | `Bool`                        | --          |
+| saslAccount               | `QString`                     | --          |
+| saslPassword              | `QString`                     | --          |
+| useAutoReconnect          | `Bool`                        | --          |
+| autoReconnectInterval     | `Int`                         | --          |
+| autoReconnectRetries      | `short`                       | --          |
+| unlimitedReconnectRetries | `Bool`                        | --          |
+| rejoinChannels            | `Bool`                        | --          |
 
 ## Network
 
-| Field               | Type                         | Description           |
-|---------------------|------------------------------|-----------------------|
-| IrcUsersAndChannels | `IrcUsersAndChannels`        | --                    |
-| Supports            | `VariantMap`                 | --                    |
-| connectionState     | `int32`                      | --                    |
-| currentServer       | `string16`                   | --                    |
-| isConnected         | `bool`                       | --                    |
-| latency             | `int32`                      | --                    |
-| myNick              | `string16`                   | --                    |
-| --                  | `NetworkInfo`                | More about this below |
+| Field               | Type                  | Description           |
+|---------------------|-----------------------|-----------------------|
+| IrcUsersAndChannels | `IrcUsersAndChannels` | --                    |
+| Supports            | `QVariantMap`         | --                    |
+| connectionState     | `Int`                 | --                    |
+| currentServer       | `QString`             | --                    |
+| isConnected         | `Bool`                | --                    |
+| latency             | `Int`                 | --                    |
+| myNick              | `QString`             | --                    |
+| --                  | `NetworkInfo`         | More about this below |
 
 The NetworkInfo data here isn’t an actual field – it’s serialized into the same
 map as the network itself. Therefore we have to apply the NetworkInfoSerializer
diff --git a/docs/protocol/serialization/features.md b/docs/protocol/serialization/features.md
new file mode 100644
index 0000000000000000000000000000000000000000..b6cb9c34c33aa1ba2c18d87d5e43671b67155c8a
--- /dev/null
+++ b/docs/protocol/serialization/features.md
@@ -0,0 +1,29 @@
+# Features
+
+Legacy features encode the flags of each supported feature, extended features
+encodes a QStringList of the names of all supported features.
+
+| Flag       | Name                   | Description                                                          |
+|------------|------------------------|----------------------------------------------------------------------|
+|`0x00000001`| SynchronizedMarkerLine | --                                                                   |
+|`0x00000002`| SaslAuthentication     | --                                                                   |
+|`0x00000004`| SaslExternal           | --                                                                   |
+|`0x00000008`| HideInactiveNetworks   | --                                                                   |
+|`0x00000010`| PasswordChange         | --                                                                   |
+|`0x00000020`| CapNegotiation         | IRCv3 capability negotiation, account tracking                       |
+|`0x00000040`| VerifyServerSSL        | IRC server SSL validation                                            |
+|`0x00000080`| CustomRateLimits       | IRC server custom message rate limits                                |
+|`0x00000100`| DccFileTransfer        | Currently not supported                                              |
+|`0x00000200`| AwayFormatTimestamp    | Timestamp formatting in away (e.g. %%hh:mm%%)                        |
+|`0x00000400`| Authenticators         | Support for exchangeable auth backends                               |
+|`0x00000800`| BufferActivitySync     | Sync buffer activity status                                          |
+|`0x00001000`| CoreSideHighlights     | Core-Side highlight configuration and matching                       |
+|`0x00002000`| SenderPrefixes         | Show prefixes for senders in backlog                                 |
+|`0x00004000`| RemoteDisconnect       | Supports RPC call disconnectFromCore to remotely disconnect a client |
+|`0x00008000`| ExtendedFeatures       | Transmit features as list of strings                                 |
+| --         | LongTime               | Serialize message time as 64-bit                                     |
+| --         | RichMessages           | Real Name and Avatar URL in backlog                                  |
+| --         | BacklogFilterType      | Backlogmanager supports filtering backlog by messagetype             |
+| --         | EcdsaCertfpKeys        | ECDSA keys for CertFP in identities                                  |
+| --         | LongMessageId          | 64-bit IDs for messages                                              |
+| --         | SyncedCoreInfo         | CoreInfo dynamically updated using signals                           |
\ No newline at end of file
diff --git a/docs/protocol/serialization/handshake.md b/docs/protocol/serialization/handshake.md
new file mode 100644
index 0000000000000000000000000000000000000000..8719c10b8b2ca7bc5d4d5614a9cccfae2ae9c732
--- /dev/null
+++ b/docs/protocol/serialization/handshake.md
@@ -0,0 +1,83 @@
+# Handshake Types
+
+This document discusses how complex objects are translated to and from
+QVariantMaps.
+
+Handshake Types are (de-)serialized to and from QVariantMaps. An additional
+key/value pair "MsgType" is added, which contains the name of the
+complexStruct’s type – for example `ClientInitAck` – as QString.
+
+## ClientInit
+
+| Field          | Type          | Description                         |
+|----------------|---------------|-------------------------------------|
+| ClientVersion  | `QString`     | Version of the client               |
+| BuildDate      | `QString`     | Build date of the client            | 
+| ClientFeatures | `UInt`        | Flags of supported legacy features  |
+| FeatureList    | `QStringList` | List of supported extended features |
+
+## ClientInitReject
+
+| Field       | Type    | Description                                     |
+|-------------|---------|-------------------------------------------------|
+| ErrorString | QString | String with an error message of what went wrong |
+
+## ClientInitAck
+
+| Field             | Type           | Description                                              |
+|-------------------|----------------|----------------------------------------------------------|
+| CoreFeatures      | `UInt`         | Flags of supported legacy features                       |
+| CoreConfigured    | `Bool`         | If the core has already been configured                  |
+| BackendInfo       | `QVariantList` | List of QVariantMaps of info on available backends       |
+| AuthenticatorInfo | `QVariantList` | List of QVariantMaps of info on available authenticators |
+| FeatureList       | `QStringList`  | List of supported extended features                      |
+
+The BackendInfo/AuthenticatorInfo lists contain a list of available
+backends/authenticators, and for each one a list of all parameters with types
+and default values.
+
+## CoreSetupData
+
+| Field         | Type          | Description                    |
+|---------------|---------------|--------------------------------|
+| AdminUser     | `QString`     | Username for the first user    |
+| AdminPassword | `QString`     | Password for the first user    |
+| Backend       | `QString`     | Name of selected backend       |
+| SetupData     | `QVariantMap` | Backend setup parameters       |
+| Authenticator | `QString`     | Name of selected authenticator |
+| AuthSetupData | `QVariantMap` | Authenticator setup parameters | 
+
+## CoreSetupReject
+
+| Field       | Type    | Description                                     |
+|-------------|---------|-------------------------------------------------|
+| ErrorString | QString | String with an error message of what went wrong |
+
+## CoreSetupAck
+
+This message has no fields
+
+## ClientLogin
+
+| Field    | Type      | Description            |
+|----------|-----------|------------------------|
+| User     | `QString` | Username for login     |
+| Password | `QString` | Corresponding password |
+
+## ClientLoginReject
+
+| Field       | Type    | Description                                     |
+|-------------|---------|-------------------------------------------------|
+| ErrorString | QString | String with an error message of what went wrong |
+
+## ClientLoginAck
+
+This message has no fields
+
+## SessionInit
+
+| Field       | Type           | Description                       |
+|-------------|----------------|-----------------------------------|
+| Identities  | `QVariantList` | List of all configured identities |
+| BufferInfos | `QVariantList` | List of all existing buffers      |
+| NetworkIds  | `QVariantList` | Ids of all networks               |
\ No newline at end of file
diff --git a/docs/protocol/serialization/primitive.md b/docs/protocol/serialization/primitive.md
index 77e17d04e58fb1c2b123f395a366a86cf26e7f0a..8202bb06965973072b59a3fc013dd0e5634a5758 100644
--- a/docs/protocol/serialization/primitive.md
+++ b/docs/protocol/serialization/primitive.md
@@ -4,108 +4,83 @@ All serialization is done in network format big-endian.
 
 Serialization of basic types is trivial and will not be discussed here.
 
-`string8` is used to refer to UTF-8 encoded Strings, `string16` is used to
-refer to UTF-16BE encoded strings, `string8-null` is used to refer to UTF-8
-encoded strings with trailing null byte
-
 Primitive types are serialized by serializing each of their fields
 sequentially. 
 
 ## String
 
-Strings are serialized as a signed int of the length in bytes (plus 1 for
-`string8-null`) plus their content in the specified encoding (plus one
-null-byte for `string8-null`).  
-If the length is -1, the String is to be considered equivalent to `NULL`.
+Strings are serialized as a signed int of the length in bytes plus their content
+in UTF-16BE. If the length is -1, the String is to be considered equivalent to
+`NULL`.
 
 ## StringList
 
-StringLists are serialized as an `int32` of the amount of elements, and a
-`string16` for each element.
+StringLists are serialized as an `Int` of the amount of elements, and a
+`string` for each element.
 
 ## Variant
 
-First, an `int32` for the type, then an `uint8` for an unknown value, then,
-if the type is a usertype, the typename as `string8-null`, and then the
-value in its own format.
+First, an `Int` for the type, then an `UChar` for an unknown value, then,
+if the type is a usertype, the typename as `bytearray` (C-string with null byte
+at the end), and then the value in its own format.
 
 ### List
 
-VariantLists are serialized as an `int32` of the length, and a `Variant` for
+VariantLists are serialized as an `Int` of the length, and a `Variant` for
 each element.
 
 ### Map
 
-VariantMaps are serialized as an `int32` of the amount of keys, and then
-for each key a `string16` for the key and a `Variant` for each element.
+VariantMaps are serialized as an `Int` of the amount of keys, and then
+for each key a `QString` for the key and a `Variant` for each element.
 
 ### Type
 
-Warning: `string8` uses the id of QByteArray in the serialization.
-
-|Enum         |Value       |
-|-------------|------------|
-|Void         |`0x00000000`|
-|Bool         |`0x00000001`|
-|Int          |`0x00000002`|
-|UInt         |`0x00000003`|
-|QVariantMap  |`0x00000008`|
-|QVariantList |`0x00000009`|
-|QString      |`0x0000000a`|
-|QStringList  |`0x0000000b`|
-|QByteArray   |`0x0000000c`|
-|QDate        |`0x0000000e`|
-|QTime        |`0x0000000f`|
-|QDateTime    |`0x00000010`|
-|QRegExp      |`0x0000002b`|
-|UserType     |`0x0000007f`|
-|Long         |`0x00000081`|
-|Short        |`0x00000082`|
-|Char         |`0x00000083`|
-|ULong        |`0x00000084`|
-|UShort       |`0x00000085`|
-|UChar        |`0x00000086`|
-|QVariant     |`0x00000090`|
-|User         |`0x00000100`|
-|LastType     |`0xffffffff`|
+|Enum         |Value       | Additional Info |
+|-------------|------------|-----------------|
+|Void         |`0x00000000`|                 |
+|Bool         |`0x00000001`|                 |
+|Int          |`0x00000002`|`int32_t`        |
+|UInt         |`0x00000003`|`uint32_t`       |
+|QChar        |`0x00000007`|                 |
+|QVariantMap  |`0x00000008`|                 |
+|QVariantList |`0x00000009`|                 |
+|QString      |`0x0000000a`|                 |
+|QStringList  |`0x0000000b`|                 |
+|QByteArray   |`0x0000000c`|                 |
+|QTime        |`0x0000000f`|                 |
+|QDateTime    |`0x00000010`|                 |
+|UserType     |`0x0000007f`|                 |
+|Long         |`0x00000081`|`int64_t`        |
+|Short        |`0x00000082`|`int16_t`        |
+|Char         |`0x00000083`|`int8_t`         |
+|ULong        |`0x00000084`|`uint64_t`       |
+|UShort       |`0x00000085`|`uint16_t`       |
+|UChar        |`0x00000086`|`uint8_t`        |
+|QVariant     |`0x00000090`|                 |
 
 ## DateTime
 
 |Type   |Field      |Description                                          |
 |-------|-----------|-----------------------------------------------------|
-|`int32`|julianDay  |Day in Julian calendar, unknown if signed or unsigned|
-|`int32`|millisOfDay|Milliseconds since start of day                      |
-|`uint8`|zone       |Timezone of DateTime, `0x00` is local, `0x01` is UTC |
+|`Int`  |julianDay  |Day in Julian calendar, unknown if signed or unsigned|
+|`Int`  |millisOfDay|Milliseconds since start of day                      |
+|`UChar`|zone       |Timezone of DateTime, `0x00` is local, `0x01` is UTC |
 
 ## Time
 
-|Type   |Field      |Description                    |
-|-------|-----------|-------------------------------|
-|`int32`|millisOfDay|Milliseconds since start of day|
-
-## Protocol
-
-|Type   |Field  |Description                        |
-|-------|-------|-----------------------------------|
-|`uint8`|flags  |See below                          |
-|`int16`|extra  |Extra data, depends on the protocol|
-|`int8` |version|Protocol Version                   |
-
-### Flags
-
-|Type       |Value |
-|-----------|------|
-|ssl        |`0x01`|
-|compression|`0x02`|
+|Type |Field      |Description                    |
+|-----|-----------|-------------------------------|
+|`Int`|millisOfDay|Milliseconds since start of day|
 
 ## BufferInfo
 
-|Type     |Field    |Description                                     |
-|---------|---------|------------------------------------------------|
-|`int32`  |id       |BufferId, a unique, sequential id for the buffer|
-|`int32`  |networkId|NetworkId of the network the buffer belongs to  |
-|`int16`  |type     |See below                                       |
-|`string8`|name     |BufferName as displayed to the user             |
+|Type        |Field    |Description                                     |
+|------------|---------|------------------------------------------------|
+|`Int`       |id       |BufferId, a unique, sequential id for the buffer|
+|`Int`       |networkId|NetworkId of the network the buffer belongs to  |
+|`Short`     |type     |See below                                       |
+|`QByteArray`|name     |(UTF-8) BufferName as displayed to the user    |
 
 ### Type
 
@@ -120,13 +95,13 @@ Warning: `string8` uses the id of QByteArray in the serialization.
 
 |Type        |Field    |Description                                                                                 |
 |------------|---------|--------------------------------------------------------------------------------------------|
-|`int32`     |messageId|The unique, sequential id for the message                                                   |
-|`ìnt32`     |timestamp|The timestamp of the message in UNIX time (32-bit, seconds)                                 |
-|`int32`     |type     |See below                                                                                   |
-|`uint8`     |flags    |See below                                                                                   |
+|`Int`       |messageId|The unique, sequential id for the message                                                   |
+|`Int`       |timestamp|The timestamp of the message in UNIX time (32-bit, seconds)                                 |
+|`Int`       |type     |See below                                                                                   |
+|`UChar`     |flags    |See below                                                                                   |
 |`BufferInfo`|buffer   |The buffer the message belongs to, usually everything but BufferId is set to `NULL`         |
-|`string8`   |sender   |The sender as `nick!ident@host`                                                             |
-|`string8`   |content  |The message content, already stripped from CTCP formatting, but containing mIRC format codes|
+|`QByteArray`|sender   |(UTF-8) The sender as `nick!ident@host`                                                             |
+|`QByteArray`|content  |(UTF-8) The message content, already stripped from CTCP formatting, but containing mIRC format codes|
 
 ### Type
 
diff --git a/mkdocs.yml b/mkdocs.yml
index 3f93b69b143dca83a51f9f9f93689d3f0adcd121..ec53f430e7891dc832a05ce4194093229990ea05 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -10,11 +10,16 @@ copyright: 'Copyright &copy; 2019 Janne Koschinski'
 nav:
   - "Overview": index.md
   - "Usage":
-    - "Upgrade Guide": usage/upgrade_guide.md
+      - "Upgrade Guide": usage/upgrade_guide.md
   - "Protocol":
+      - "Layers":
+          - "Framing": protocol/layers/framing.md
+          - "Message": protocol/layers/message.md
     - "Serialization":
-      - "Primitive Types": protocol/serialization/primitive.md
-      - "Compound Types": protocol/serialization/compound.md
+          - "Primitive Types": protocol/serialization/primitive.md
+          - "Compound Types": protocol/serialization/compound.md
+          - "Features": protocol/serialization/features.md
+          - "Handshake": protocol/serialization/handshake.md
 
 extra:
   social:
@@ -52,7 +57,7 @@ markdown_extensions:
   - footnotes
   - toc:
       permalink: true
-#  - pymdownx.arithmatex
+  #  - pymdownx.arithmatex
   - pymdownx.betterem:
       smart_enable: all
   - pymdownx.caret