Skip to main content

Quickstart

Get up and running with Trailproof in 5 minutes. You’ll install the library, emit events, query them, and verify the chain is intact.

Installation

Python
TypeScript / Node.js

1. Create a Trailproof Instance

By default, Trailproof uses an in-memory store — perfect for getting started.

2. Emit Events

Every event needs an event_type, actor_id, tenant_id, and payload. Trailproof auto-generates event_id, timestamp, and the hash chain fields.
The first event in the chain uses a genesis hash of 64 zeros as its prev_hash. Every subsequent event links to the hash of the previous event.

3. Query Events

Filter events by type, actor, tenant, time range, or any combination. Results are paginated with cursor-based navigation.

4. Verify Chain Integrity

Walk the entire hash chain to confirm no events have been tampered with.
If a tampered event is detected, broken contains the indices of all affected events. Because each event depends on the previous hash, tampering event N causes events N through the end to appear broken.

5. Persist to Disk

Switch to the JSONL file store for events that survive restarts.
The JSONL file is human-readable. Inspect it with cat events.jsonl | jq . or grep "user-42" events.jsonl.

Next Steps

Event Envelope

Learn about the 10-field event structure.

HMAC Signing

Add cryptographic provenance to your events.

JSONL Store

Configure persistent file-based storage.

Verification

Deep dive into chain integrity verification.