Skip to content

Checkpoints (C2SP)

Status: implemented in v0.11. Breaking: replaces the v0.10 JSON TreeHead / SignedTreeHead checkpoints and the signer POST /v1/checkpoint protocol. No compatibility with v0.10 checkpoints, signer state files, or databases.

Witness log checkpoints use the C2SP formats, so standard transparency-log tools and independent public witnesses can read, verify and cosign them:

Receipts, receipt leaves, key epochs and key transitions are unchanged except where noted below.

The log and its key

Each network has a log origin (a cosigner-style name, recommended form example.org/witness/<network-id>) and an Ed25519 log key, held by the gateway. The gateway is the log: it signs every checkpoint note with the log key. C2SP witnesses reject checkpoints without a valid log signature. Clients require it too, but it is not what they rely on for split-view protection: that comes from the cosignatures.

The public verification config gains a log object:

{
  "id": "example-network",
  "key_epoch": 1,
  "log": {"origin": "example.org/witness/example-network", "public_key": "<hex>"},
  "witnesses": [
    {"id": "example.org/witness/signer-1", "pubkey": "<hex>"},
    {"id": "example.org/witness/signer-2", "pubkey": "<hex>"},
    {"id": "example.org/witness/signer-3", "pubkey": "<hex>"}
  ],
  "threshold": 2,
  "signature_scheme": "ed25519",
  "time_policy": {"max_skew_secs": 300}
}
  • log.origin stays the same for the life of the network. log.public_key belongs to the key set and can change in a key transition, just like signer keys.
  • KeySet gains log_public_key. KeyTransitionBody::to_bytes() appends 32-byte log public key after the threshold. key_set_digest appends str(log.origin) || 32-byte log public key before max_skew_secs.
  • Witness ids are used as cosigner names. They must be valid C2SP names: non-empty, at most 255 bytes, no Unicode spaces, + or control characters. Schema-less URLs are recommended.
  • The log key must not equal any signer key.

Checkpoint note

example.org/witness/example-network
1042
aGVsbG8gd29ybGQgdGhpcyBpcyBhIDMyIGJ5dGUgcm9vdCE=

— example.org/witness/example-network <base64(key ID || Ed25519 log signature)>
— example.org/witness/signer-1 <base64(key ID || timestamp || Ed25519 cosignature)>
— example.org/witness/signer-3 <base64(key ID || timestamp || Ed25519 cosignature)>
  • Body: exactly three lines, which are origin, tree size (ASCII decimal, no leading zeros), and base64 RFC 6962 root hash. Witness never emits extension lines and its verifier rejects notes that have them.
  • Log signature: signed-note Ed25519, type 0x01, key name = origin, key ID = SHA-256(origin || 0x0A || 0x01 || log pubkey)[:4], over the note body.
  • Signer cosignatures: cosignature/v1, type 0x04, key name = witness id, key ID = SHA-256(id || 0x0A || 0x04 || signer pubkey)[:4]. The signed message is cosignature/v1\ntime <ts>\n<origin>\n<size>\n<root b64>\n, and the signature bytes are 8-byte big-endian timestamp || 64-byte signature.
  • Signers reuse their receipt key for cosignatures. That is safe because the messages cannot collide: receipt messages start with witness/v2/receipt\0, key transitions with witness/v2/key-transition\0, and cosignatures with cosignature/v1\n.
  • The checkpoint has no gateway timestamp. Time comes from the cosignature timestamps.
  • Leaves are unchanged (receipt_leaf). RFC 6962 and RFC 9162 use the same Merkle hashing.

Verifying a checkpoint

verify_checkpoint(note, history, now, policy?) -> VerifiedCheckpoint:

  1. Parse the signed note strictly: valid UTF-8, no control characters except newline, canonical base64, at most 64 signature lines.
  2. The body must be exactly three valid lines, and the origin must equal log.origin.
  3. Find the key epoch: the newest non-compromised epoch in the verified key history whose log key verifies the log signature and whose signers provide at least threshold valid cosignatures.
  4. Signature lines with an unknown (name, key ID) are ignored. A line whose name and key ID match a known key but whose signature fails rejects the whole note, as signed-note recommends. A cosignature timestamp more than max_skew_secs in the future is rejected.
  5. Optional client witness policy { "witnesses": ["<vkey>", ...], "threshold": k }: the note must also carry at least k valid cosignatures from those vkeys. This is how a client requires independent witnesses the operator did not choose.
VerifiedCheckpoint {
  origin, tree_size, root_hash, key_epoch,
  cosignatures: [{ name, timestamp }],        // all valid cosignatures, signers and policy witnesses
  fresh_as_of,                                // threshold-th newest signer cosignature timestamp
}

fresh_as_of means at least threshold signers signed this checkpoint at that time or later. Freshness checks (--max-checkpoint-age, the auditor's stale_checkpoint) use it, so a single signer cannot make a stale log look fresh.

Signers are C2SP witnesses

Each signer implements tlog-witness@v1.1.0 for its network's log:

  • POST /add-checkpoint follows the spec exactly. The request body is old <size>, proof lines, a blank line, then the checkpoint note. The responses:
    • 404 for an unknown origin;
    • 403 for a missing or bad log signature;
    • 400 when the old size is larger than the checkpoint size;
    • 409 with Content-Type: text/x.tlog.size and body <stored size>\n when the old size is stale;
    • 422 for a bad proof, a same-size root mismatch, or a non-empty proof for old size 0;
    • 200 with the signer's cosignature line.

No bearer token is required: the log signature is the authentication, as in the spec. Requests are rate-limited per IP and size-limited. A signer with an unhealthy clock returns 503. - It persists the cosigned checkpoint atomically before replying, checking and updating under one lock. - GET /<lowercase hex SHA-256 of origin>/checkpoint (public) returns the latest cosigned checkpoint: the log signature plus this signer's cosignature. This is the C2SP monitoring endpoint, and it replaces v0.10's GET /v1/checkpoint. /v1/checkpoint/state is removed. - Signer config gains log_origin and log_public_key (which must match the network). The signer's cosigner name is its id.

The gateway submits to signers at <endpoint>/add-checkpoint, using its latest stored size as old. On 409 it rebuilds the proof from the reported size and retries once.

External witnesses

The gateway can also submit each checkpoint to external C2SP witnesses listed in --external-witnesses <file> / WITNESS_EXTERNAL_WITNESSES:

[{"name": "witness.example/w1", "vkey": "witness.example/w1+1a2b3c4d+B...", "url": "https://witness.example/submit"}]

Valid cosignatures they return are attached to the stored checkpoint. The gateway stores a checkpoint once its own signers reach the threshold; external cosignatures are best effort and are never required by the gateway. Clients that want them require them with a witness policy. External witnesses must be configured with the log's vkey (witness keys vkeys prints it). Public witness networks list logs on request; see Transparency-log witnesses. There may be at most 63 signers and external witnesses combined, leaving one signature line for the log.

Gateway API

Route Returns
GET /checkpoint Latest checkpoint note, text/plain (the C2SP tiled-log location)
GET /v1/log/checkpoint { "checkpoint": "<note>" }
GET /v1/log/checkpoint/:size Checkpoint at a size, if one was published
GET /v1/log/proof?hash=&tree_size= LogInclusionProof { leaf_index, tree_size, audit_path, checkpoint }
GET /v1/log/consistency?first=&second= LogConsistencyProof { old_checkpoint, new_checkpoint, hashes }
GET /v1/log/consistency-proof?first=&second= Bare ConsistencyProof (unchanged)

/v1/log/sth* routes are removed. A refresh re-submits the same tree with old = size. Witnesses re-cosign it with a new timestamp, and the stored note for that size is replaced. The log signature is identical because the body is unchanged.

Clients can also build proofs from public Merkle hash tiles.

Auditor and clients

  • witness-auditor --signer <id>=<url> reads each signer's monitoring endpoint and compares it with the gateway's history, as in v0.10. --monitor-witness <vkey>=<url> does the same for any C2SP witness, including external ones.
  • witness verify-proof, witness log checkpoint --verify and the auditor accept --witness-policy <file>.
  • witness keys vkeys --network-config <file> prints the log vkey and each signer's cosigner vkey, for configuring external witnesses or standard tools.

Interoperability evidence

  • interop/go checks the reference notes, keys, and signatures with the Go sumdb/note and Torchwood libraries.
  • The live test runs unmodified Torchwood litewitness against a Witness gateway. The CLI accepts the checkpoint when its policy requires that witness and rejects it when the policy requires a different one.