What a Chandra chain guarantees, against whom, and what that guarantee rests on. A hash chain makes changes detectable. It does not make them impossible. Whether a change is detected depends on who holds an earlier chain head.
Each governed subject (a spoke) has its own append-only chain of Context Units (CUs). Every CU carries the SHA-256 hash of its predecessor's complete canonical serialization, header and payload, including before/after snapshots and artifact content. Merge CUs name two branch heads, which makes the record a DAG rather than a strict line. The verifier checks each branch back to its root.
Recomputation is done by GET /api/chain/verify. It returns the chain length, or the first broken CU and the reason. A spoke whose chain fails verification refuses new appends until the failure is resolved, so a break cannot be buried under later records.
| Parameter | Current implementation |
|---|---|
| Hash function | SHA-256 (FIPS 180-4), hex-encoded |
| Canonical encoding | Canonical JSON of the predecessor CU. Conformance requires deterministic output, byte-identical across implementations. RFC 8785 (JCS) is the recommended form. |
| Fields covered | The entire predecessor CU: every header field (id, timestamp, sequence, actor, session, subject, predecessor, prev-hash) and every payload field (artifact, before/after snapshots, author, model, prompt lineage, notes, tags) |
| Genesis | The root CU of each spoke carries 64 zero characters. The first CU of an instance is a seed event recording its own initialization. A self-hosting instance stores the protocol specification as CU-0001. |
| Signatures | None in the current protocol. Integrity rests on the hash chain and witnessing; attribution rests on the authenticated session at publish time. Per-principal signing is specified within Chandra Passport and is on the roadmap. |
| Timestamps | Node clock, integer seconds, UTC. The timestamp is covered by the hash, but nothing outside the node attests to it unless it is witnessed (see below). |
The useful question for any tamper-evident log is which adversary it detects, not whether it is "immutable." The answer depends on whether some party outside the node has recorded a chain head.
| Adversary action | Chain alone | With external witness |
|---|---|---|
| Modify a stored CU or its artifact | Detected by recomputation | Detected |
| Modify the newest CU (the chain head) | Not detected; its hash lives in a successor that does not exist yet | Detected once its header has been witnessed |
| Delete, insert, or reorder a CU mid-chain | Detected because the link breaks | Detected |
| Truncate the tail (drop the latest CUs) | Not detected; a shorter chain is still well-formed | Detected once the witness holds a later head |
| Operator rewrites the whole chain and recomputes every hash | Not detected | Detected for any portion the witness has seen |
| Show different chains to different examiners (equivocation) | Not detected | Detected if witnesses compare heads |
| Backdate a CU | Not detected; the node clock is trusted | Bounded by the time the witness first saw a later head |
| Publish under someone else's name | Outside the hash chain. This depends on authentication at the publish endpoint until per-principal signing ships. | |
Chandra has a built-in witnessing path. An echo target is an external URL that receives the header of each CU after it is published, including its hash and its predecessor's hash. Echo targets are append-only records on the node. A target can be deactivated but not deleted, and failed dispatches are themselves recorded as CUs. An echo target run by a party other than the operator (an auditor, a regulator, a counterparty, or a second institution) holds a sequence of heads the operator cannot recall. Each item in the table above marked "With external witness" depends on such a target existing and keeping what it receives.
Dispatch is currently asynchronous, so there is a window in which a CU is committed on the node but not yet witnessed. The protocol therefore separates three moments:
Anchoring to a public ledger, such as a periodic digest of hub heads, is one form of audit publication. It is not required, but some external witness is. Without one, Chandra protects against outside tampering, not against the operator.
Certificate Transparency (RFC 6962, RFC 9162) is the closest cryptographic relative. It is an append-only log under a single operator, made trustworthy by signed tree heads and by monitors that compare them. CT uses a Merkle tree, which gives logarithmic-size inclusion and consistency proofs. Chandra's per-spoke linear chains give O(n) proofs within a spoke, but they keep unrelated subjects from contending and let an examiner read one subject's history on its own. Periodic per-hub Merkle checkpoints over spoke heads, in the RFC 9162 style, are the natural extension and are on the roadmap.
Git uses the same hash-linking, but rewriting history is a supported operation and there is no attribution requirement. Blockchains add consensus among mutually distrustful writers, which Chandra does not need (why). Recent work on audit logs for AI agents records agent actions with similar hash-linking. What Chandra adds is governance at append time. Every CU names an accountable principal, merges require a human, a broken chain halts its spoke, and the append can gate the action it records.