Entry format v1

Every member of a format v1 entry, its type, when it is required, who fills it and the rules it follows.

Provisional

Format v1 is provisional until the external cryptography review ends. Logs written by pre-releases are not covered by the compatibility promise. The normative text is spec/format-v1.md.

An entry is one JSON object, stored as its canonical bytes (RFC 8785) on one line. Concepts are in Streams and entries and Integrity.

General rules

  • Any top-level member not listed below fails with unknown_field. Any other member inside the nested objects fails with invalid_field.
  • An optional member that is null is the same as an absent one; writers omit it.
  • All strings named below (ids, refs, versions, types, targets, handles) must be non-empty. Arrays may be empty. Values inside ext are free, within the canonical-bytes rules.
  • Numbers are integers only, between -(2^53 - 1) and 2^53 - 1.

Encodings

ValueEncoding
Hashsha256: and 64 lowercase hex digits
Public keyed25519: and the 32-byte key (RFC 8032) as 64 lowercase hex digits
Signatureed25519: and the 64-byte signature as 128 lowercase hex digits
Key fingerprintsha256: and the lowercase hex SHA-256 of the 32-byte public key
Stream idtnb1: and the first 32 hex digits of the genesis stream key's fingerprint
Entry idA ULID: 26 characters of Crockford base32, uppercase, first character 0 to 7
TimestampYYYY-MM-DDTHH:MM:SS.mmmZ: UTC, exactly three fraction digits, a valid calendar date
Key id1 to 128 characters from A-Z a-z 0-9 . _ : -
Body addressblob:ct-sha256: and 64 lowercase hex digits
Input digesthmac-sha256: and 64 lowercase hex digits

Every encoding has exactly one spelling: uppercase hex, a lowercase ULID or a timestamp without its milliseconds is invalid.

Fields

"Filled by" says who sets the member: the writer (the library, tenbri append or tenbrid) or the caller (the draft you send).

FieldTypeRequiredFilled byDescription
vintegeralwayswriterFormat version, 1
idstring (entry id)alwayswriter, or callerUnique within the stream. The writer generates it when the draft has none; tenbrid takes it from the Idempotency-Key.
streamstring (stream id)alwayswritertnb1: id of the stream; also the checkpoint origin
seqintegeralwayswriterStarts at 1, increases by exactly 1; at most 2^53 - 1
tsstring (timestamp)alwayswriter, or callerTime claimed by the writer, not proven
hlcobject {wall, count}nocallerHybrid logical clock: wall milliseconds since the Unix epoch, count a counter, both non-negative integers. Never decreases within a stream.
traceobject {trace_id, span_id}nocaller (tenbrid: from traceparent; the Rust writer with its otel feature: from the active span)OpenTelemetry span active when the entry was written: 32 and 16 lowercase hex digits
durabilitystringnocaller (tenbrid fills intents)Promise that applied when the intent was acknowledged
groupstringno, only on seq 1callerStream group the lane belongs to (group keys reserved)
kindstringalwayscaller (tenbrid fills it per endpoint)See kinds
phasestringper kindcaller (tenbrid fills it per endpoint)intent or outcome
intentstring (entry id)per kindcallerThe intent an outcome or reconcile closes
statusstringper kindcallerResult of an outcome or reconcile
sourcestringper kindcaller (tenbrid default: sdk)Where the entry came from
degradedbooleannocallertrue when written in fail-open mode
principalobject {kind, id}per kindcaller (tenbrid: the token's)Whoever acted
actionobject {type, target}per kindcallertype the action type; target optional, a reference, possibly personal data
subjectstringnocallerPseudonymous handle selecting the per-subject keys used for erasure (Privacy)
inputsarray of {ref, version, digest}nocaller (the Python and TypeScript bindings: from a run's reads)ref and version plaintext, digest an input digest (keyed)
ruleobject {ref, version, result}nocallerThe rule that allowed or refused. Must be absent when source is proxy or ingest.
approvalobject {by, entry}nocallerby the approver (a principal object), entry the entry hash of an earlier approval entry in this stream
linksarray of {stream, seq, hash, rel}nocallerEntries in other streams; rel optional. Checked for shape only (following a link is reserved).
bodystring (body address)nocallerAddress of the encrypted body, as DataKeys::seal_body in tenbri-crypt returns it (Privacy)
attestationsarray of {key, sig}nocallerExtra signatures by the principal or an approver
extobjectnocallerExperimental features. Hashed and signed like everything else; meaning may change while a feature is Experimental.
keyobjectper kindwriterThe key event of a key entry; see key events
prevstring (hash)every seq but 1writerEntry hash of the previous entry; absent on seq 1
signerstring (key id)alwayswriterKey that signed the entry
sigstring (signature)alwayswriterEd25519 over tenbri/entry/v1, 0x00, and the canonical entry without sig

A draft sent to tenbri append or tenbrid that contains v, stream, seq, prev, signer or sig is refused with invalid_field ( `<member>` is filled in by the writer).

Allowed values

MemberValues
kinddecision, approval, key, reconcile, note
phaseintent, outcome
statusok, error, refused, unknown
sourcesdk, proxy, ingest
durabilitylocal, replicated, postgres
principal.kindagent, person, service
links[].relcause, handoff, approval
key.opcertify, rotate, revoke
key.rolestream, session

rule.result is a free, non-empty string.

Rules per kind

KindRequiresForbids
decision, phase intentphase, source, principal, actionintent, status, key; source: ingest
decision, phase outcomephase, source, principal, action, status; intent unless source is ingestkey; intent when source is ingest
approvalprincipal (the approver), action (what is approved)phase, intent, status, key
keykeyphase, intent, status
reconcileintent, status: unknownphase, key
notenothingphase, intent, status, key

Across the stream:

  • An outcome names an intent that appears earlier and has no outcome yet (bad_intent).
  • A reconcile names an earlier intent with neither an outcome nor a reconcile (bad_intent). An outcome that arrives after a reconcile is still accepted and supersedes it.
  • Writers reconcile an intent with no outcome after 1 hour by default.
  • approval.entry names the entry hash of an earlier approval entry (bad_approval).
  • key and reconcile entries are written by tenbri and tenbrid themselves; tenbrid refuses them in a draft.

Key events

The key member of a key entry. Details in Keys.

opMembersSigned byEffect
certifyid, pub, role (stream or session), not_after (sessions only)The current stream keyAdds a key. role: stream only in the genesis entry, which the new key signs itself.
rotateid, pubThe current stream keyThe new key becomes the current stream key
revokeid, from (a sequence number, at least 1)The current stream keyEntries signed by key id at from or later fail with key_revoked, including earlier-written ones

Session keys are certified for 24 hours by default; an entry with a ts later than its session key's not_after fails with key_expired.

Attestations

An attestation's sig is the Ed25519 signature of key over tenbri/attestation/v1, 0x00, and the canonical entry without seq, prev, signer, sig and attestations. A principal or approver signs the draft (its id, ts and stream already set) before the writer places it.

Example

The intent entry from spec/vectors/entries.json, pretty-printed here. Stored, it is one line with no whitespace.

{
  "action": {
    "target": "zendesk:ticket/4821",
    "type": "reply_ticket"
  },
  "body": "blob:ct-sha256:305531dcc50ebca31cf1d5b31e9fc76ed51f66b3b6dd5a030c6539ae6532f979",
  "durability": "local",
  "hlc": {
    "count": 0,
    "wall": 1791986533318
  },
  "id": "01M4XBH0Y60000000000000003",
  "inputs": [
    {
      "digest": "hmac-sha256:80dadc04df5bae022b918452d942e5ee756e6cf3a7f8ac8f462c8f9a521ac847",
      "ref": "policy:refund",
      "version": "14"
    },
    {
      "digest": "hmac-sha256:61eb70aa07259d108510291f2f6e0eb8f216dc1138c119b6ec3a122ab3f3c573",
      "ref": "contract:acme-sante",
      "version": "3"
    }
  ],
  "kind": "decision",
  "phase": "intent",
  "prev": "sha256:3b75c4e724b4379a38fd76be9b9cee650516210c57a4236c624804cc6eaf72f0",
  "principal": {
    "id": "support-assistant",
    "kind": "agent"
  },
  "rule": {
    "ref": "grants:support-assistant",
    "result": "allow",
    "version": "7"
  },
  "seq": 3,
  "sig": "ed25519:7bbb976272f395acd659aa26289b113761cf3af937c1609b64ca658d8494a0fc7cc46cb50177b79f64c932912e09b198df497d43fda6e393a2e6e70517f9eb0e",
  "signer": "sess:a1",
  "source": "sdk",
  "stream": "tnb1:170241c12e8724974ea3b10fe536b7d8",
  "subject": "subj_7f3c91d2",
  "trace": {
    "span_id": "00f067aa0ba902b7",
    "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  },
  "ts": "2026-10-14T14:02:13.318Z",
  "v": 1
}

The genesis entry of the same stream, as stored:

{"id":"01M4XBGYZP0000000000000001","key":{"id":"stream:a","op":"certify","pub":"ed25519:26ea1e8cd907cac3977eecd8cee7fa3d13aa0303ce53ce7fe359c3ebf17c525d","role":"stream"},"kind":"key","seq":1,"sig":"ed25519:d2b825716f782a98b54cffca6c2996837d11d5c0a52324bf7f21d0bc8b05c8b0306a9684ba3878e3dc848493353914c836b9991a2bc3bba1f57e38981869c501","signer":"stream:a","stream":"tnb1:170241c12e8724974ea3b10fe536b7d8","ts":"2026-10-14T14:02:11.318Z","v":1}
Edit on GitHub

On this page