# Protocol Introduction
- [Introduction](#introduction)
- [Envelope](#envelope)
- [Data Types](#data-types)
- [Primitive Types](#primitive-types)
- [List Types](#list-types)
- [Variable Sizes](#variable-sizes)
## Introduction
The Tokenized Protocol provides a fairly simple system for defining message types, contents, and encoding. Using the methods described below everything is defined. Then code is generated to read and write those messages. Then smart agents and wallets can use that code to operate on the protocol.
## Envelope
The Tokenized Protocol uses the [envelope](https://github.com/tokenized/envelope) protocol to wrap and encode its messages. The envelope protocol provides a common method for Tokenized and other protocols to identify which protocol is being used, its version, and other meta data about a payload. It also enables a common method of encryption and providing MetaNet information. The envelope protocol is responsible for encoding the "header" data and the payload within an OP_RETURN payload.
The Tokenized Protocol uses the following fields of the envelope protocol to specify the message contained. The payload is then encoded using [protobuf](https://developers.google.com/protocol-buffers/), which provides a common method of encoding binary and ascii fields within a predefined data structure.
| Type |
Description |
| int | A signed integer. size is the number of bytes for the integer. Valid values for size are 1, 2, 4, 8. |
| uint | An unsigned integer. size is the number of bytes for the integer. Valid values for size are 1, 2, 4, 8. |
| float | A floating point number. size is the number of bytes for the float. Valid values for size are 4 and 8. |
| bool | A boolean stored as 1 byte. Zero is false, non-zero is true. |
| bin | Fixed length binary data. size is the length in bytes of the data. |
| varbin |
Variable length binary data.
varSize defines the maximum size of the data as defined in Variable Sizes.
|
| fixedchar |
Fixed length text data.
The data is assumed to be UTF-8 unless the first two bytes are a valid UTF-16 BOM (Byte Order Method).
size is the length in bytes of the data.
|
| varchar |
Variable length text data.
The data is assumed to be UTF-8 unless the first two bytes are a valid UTF-16 BOM (Byte Order Method).
varSize defines the maximum size of the data as defined in Variable Sizes.
|