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

{
  "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.

Last updated