# Language-neutral witness algorithms

```text
OBSERVE(checkpoint, log_public_key):
  validate checkpoint schema and protocol version
  verify Ed25519 log signature over canonical checkpoint body
  recompute Merkle root from privacy-safe leaf hashes
  reject if root or tree size differs

CONSISTENT(previous, later):
  reject if later.tree_size < previous.tree_size
  reject if previous leaf hashes are not exact prefix of later leaf hashes
  reject unless roots recompute for both checkpoints
  same size plus different root = fork/inconsistent history

WITNESS(checkpoint, witness_identity, witness_private_key):
  OBSERVE(checkpoint)
  create statement with controlled and identity_assurance explicit
  sign canonical UTF-8 statement body using Ed25519

VERIFY_STATEMENT(statement):
  validate schema and protocol version
  verify signature using statement witness_public_key
  return signature result separately from identity assurance and independence
```
