Skip to main content

Event Envelope

Every event in Trailproof uses the same 10-field envelope. Your domain-specific data goes in payload — Trailproof handles the rest.
Trailproof doesn’t validate or inspect payload contents. It stores them opaquely. Your application is responsible for payload structure.

TrailEvent Fields

Auto-Generated vs. Caller-Provided

You provide (required):
  • event_type — what happened
  • actor_id — who did it
  • tenant_id — which tenant (use "default" for single-tenant)
  • payload — domain-specific data
You can optionally provide:
  • trace_id — correlate events across systems
  • session_id — group events within a session
Trailproof auto-generates:
  • event_id — UUID v4
  • timestamp — ISO-8601 UTC
  • prev_hash — from the hash chain
  • hash — SHA-256 of the event
  • signature — if a signing key is configured

Event Type Convention

Event types follow a namespaced pattern: {project}.{domain}.{action}
Trailproof doesn’t enforce this convention — event types are just strings. The naming pattern is a recommendation for consistency.

Example

Validation

Trailproof validates required fields on emit(). Missing or empty required fields throw a ValidationError:
Python
All four required caller fields — event_type, actor_id, tenant_id, and payload — must be non-empty. Trailproof raises ValidationError immediately on empty or missing values.

Next Steps

Hash Chain

How events are cryptographically linked.

API Reference

Full API documentation for both SDKs.