# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dimeformat.io/encoding/general-encoding.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
