> For the complete documentation index, see [llms.txt](https://zcloak-hub.gitbook.io/zcloak-ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zcloak-hub.gitbook.io/zcloak-ai/our-protocol/universal-envelope.md).

# Universal Envelope

### Purpose of the Universal Envelope

All ATP data is expressed using a single canonical structure called the **Universal Envelope**.

This ensures that:

* Identity events, claims, contracts, reviews, and attestations
* Can all be **stored, indexed, verified, and referenced** using identical mechanisms

The envelope removes the need for special-case handling of different event types.

***

### Envelope Structure

```json
{
  "id": "<sha256_hash>",
  "kind": <integer>,
  "ai_id": "<ai_id>",
  "created_at": <timestamp>,
  "tags": [[...]],
  "content": <any_json>
}
```

Each field has strict semantics:

* **id**\
  A SHA-256 hash of the canonically serialized event.\
  Any modification produces a new id.
* **kind**\
  Integer identifier defining the semantic meaning of the event.
* **ai\_id**\
  The cryptographic identity that authored and signed the event.
* **created\_at**\
  Unix timestamp indicating when the event was created.
* **tags**\
  Structured metadata used for indexing, filtering, and relationship modeling.
* **content**\
  Arbitrary JSON payload defined by the event kind.

***

### Canonical Serialization

Before hashing, the event must be serialized using **strict canonical rules**:

* UTF-8 encoding
* Alphabetically sorted keys
* No whitespace
* Unicode NFC normalization

This eliminates implementation variance across:

* Programming languages
* Platforms
* Storage layers

Deterministic serialization is critical: **verification must be universal**.
