> For the complete documentation index, see [llms.txt](https://docs.dimeformat.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dimeformat.io/encoding/general-encoding.md).

# General encoding

DiME items are generally encoded using Base64 and following this structure:

<figure><img src="/files/XvQ9iM6v5eUAnSjTdsYq" alt=""><figcaption><p>General DiME item structure and encoding</p></figcaption></figure>

Here the dots (‘.’) are used to separate each part of the DiME item. The position of each component is important:

* First component: the item header
* Second component: Base64 encoded JSON with item claims
* Last component: item signature package

It is possible to include any number of components, separated by additional dots (‘.’), between the second component and the last component. This is the case for several DiME items:

* Identity – include a trust chain as an additional component
* Message/data – include a Base64 encoded application-specific payload as an additional component

A DiME envelope follows a similar pattern, but uses colon (‘:’) to separate items and components:

<figure><img src="/files/WqMPNWQhkgDF6b7VHKE3" alt=""><figcaption><p>Envelope structure and encoding</p></figcaption></figure>

The standard Base64 encoding is used, not URL safe.
