VEST Protocol Architecture Overview
vest beginner 5 min read
ELI5
A post office where every letter gets a wax seal (Ed25519 signature), is stapled to its envelope in a numbered sequence, and is stored in a tamper-evident binder — if anyone removes or replaces a page, the numbering breaks and the seals no longer chain. VEST is that binder for timeline operations.
Technical Deep Dive
VEST (Verifiable Event State Tracker) is the cryptographic audit layer for the TimeChain collaborative platform. It ensures every timeline operation has non-repudiation, inclusion proof, and tamper-evidence.
Module Boundaries
src/lib.rs defines five modules and four public-export pairs:
| Module | Exported types | Responsibility |
|---|---|---|
signature | SignatureProof, AuditSignature | Ed25519 key/sig pairs + chained hashes |
proof | MerkleProof, ProofPath | RFC 6962-style inclusion proofs |
timeline_proof | TimelineProof, StateProof | Per-timeline proof chains |
audit_trail | AuditEntry, AuditLog | Append-only sequenced log |
verification | ProofVerifier, VerificationResult | Verification engine + counters |
Top-Level Orchestration
VestProtocol (defined in src/lib.rs) owns an AuditLog, a HashMap<String, TimelineProof>, and a ProofVerifier. Its three operations are:
audit_operation(op_id, op_data, signature)— verifies signature first, then appendscreate_proof(op_id)— looks up entry, derivesMerkleProoffrom itverify_timeline(timeline_id)— delegates toProofVerifier::verify_timeline_proof
Operation Flow
flowchart TD A[caller: audit_operation] --> B{verify_signature} B -->|fail| E[VestError::InvalidSignature] B -->|pass| C[AuditEntry::new] C --> D[AuditLog::append\nsets sequence_number] D --> F[return Ok]
G[caller: create_proof] --> H{AuditLog::get} H -->|None| I[VestError::OperationNotFound] H -->|Some| J[MerkleProof::from_entry] J --> K[return MerkleProof]Error Taxonomy
enum VestError { InvalidSignature(String), // signature.verify_chain() == false InvalidProof(String), // MerkleProof or ProofPath check failed ProofChainBroken(String), // TimelineProof::verify_chain() == false OperationNotFound(String), // op_id not in AuditLog}Wire Protocol & Production Scale
proto/protocols/vest.proto defines VESTProof, AuditEntry, SignedTreeHead, and SealedTimeline. Production targets (from requirements/SRS.md): 25,000 ops/s throughput, <30ms P95 verification, Tessera/Trillian as backing store.
Key Terms
- VestProtocol → top-level orchestrator in
src/lib.rs; owns log, proof chain map, and verifier - AuditLog → append-only
Vec<AuditEntry>withHashMapindex for O(1) lookup byop_id - TimelineProof → per-timeline chain of
StateProofobjects anchored by a rootAuditSignature - ProofVerifier → stateful counter-tracking engine; methods return
VerificationResultorResult<_, VestError> - VestError → four-variant enum covering signature, proof, chain, and lookup failures
Q&A
Q: What prevents audit_operation from appending an entry before checking the signature?
A: ProofVerifier::verify_signature is called first and returns Err(VestError::InvalidSignature) on failure; the ? operator short-circuits before AuditEntry::new is ever called.
Q: What is the default chain_depth of AuditSignature::default()?
A: 1 — the default is a minimal chain starting at depth 1 with an all-zeros previous hash and all-zeros signature bytes.
Q: Does verify_timeline return Ok(false) or Err(...) when the timeline_id is unknown?
A: Ok(false) — the HashMap::get returns None, so the else-branch returns Ok(false) without touching the verifier.
Examples
Sequence showing two operations being audited and a timeline proof being checked:
let mut vest = VestProtocol::new();let sig = AuditSignature::default(); // chain_depth=1, valid chainvest.audit_operation("op1", payload, sig)?; // verifies sig, appends seq=0let proof = vest.create_proof("op1")?; // MerkleProof { tree_depth: 1, siblings: 5 }let ok = vest.verify_timeline("tl-unknown"); // Ok(false) — timeline not in mapneighbors on the map
- Timeline Reconstruction implementing a new timeline UI control
- FNP Byzantine Fault Tolerance & Threat Model understanding FNP's Byzantine resilience
- FNP End-to-End Encryption & Zero Trust Architecture understanding FNP's security layers