Q9 — Formal Verification Reference

TLA+ Properties & Principles

What does REF formally specify, what invariants does TLC check, and what Rigorous Digital Engineering principles guide the verification architecture? A complete map of REF's three specification layers.

Consensus Spec
REFConsensus v1.9 (EV-008)
TLC States (Consensus)
152,658,351 generated · 0 on queue
Token Spec
TokenLifecycle (EV-009)
Methodology
Rigorous Digital Engineering
Core Position
REF uses TLA+ to express safety invariants as mathematical properties — checked exhaustively by TLC within finite bounds — not as prose assertions. Every property traces to a security requirement above and an implementation artifact below.
01 — Specification Architecture

Three Layers, One Verification Chain

REF's TLA+ specifications are organized into three layers, each addressing a distinct correctness domain. Together they form the assume-guarantee chain that connects cryptographic primitives to economic incentives.

Layer 1 — Byzantine Agreement
REFConsensus.tla v1.9
EV-008 · 4 validators (1 Byzantine) · 4 invariants · 152.7M states · 11m 06s · COMPLETE
Layer 2 — Token Lifecycle
TokenLifecycle.tla
EV-009 · 2 purchases, 3 nullifiers · 7 invariants · 269 states · COMPLETE
Layer 3 — Economic Deterrence
Mechanism Dominance Analysis
Analytic guard + locked dataset · 500 archived rows · 500/500 satisfy guard
"A specification is not documentation — it is a machine-checkable claim about what your system can and cannot do."
Rigorous Digital Engineering methodology
02 — Consensus Layer Properties

Byzantine Agreement Invariants

Four invariants checked by TLC across 152,658,351 states with non-vacuous Byzantine behavior. Configuration: 4 validators (v1–v4), 1 Byzantine (v4), 2 competing values, MaxHeight=1, MaxView=0. Zero violations. Zero states remaining on queue.

Agreement
Safety
Agreement == \A d1, d2 \in decided : /\ d1.validator \in Honest /\ d2.validator \in Honest /\ d1.h = d2.h => d1.val = d2.val
Exact-source transcription from REFConsensus_v1.9.tla. Within the EV-008 bounded state space, honest decision-history records at the same height cannot disagree. This is a bounded model result, not an unbounded or production-network no-fork theorem.
TLC checked · EV-008 · 152,658,351 states · 0 violations
LockedValueSafety
Safety
LockedValueSafety == \A v1, v2 \in Honest : (lockedValue[v1] # NIL /\ lockedView[v1] = lockedView[v2] /\ lockedValue[v2] # NIL /\ height[v1] = height[v2]) => lockedValue[v1] = lockedValue[v2]
Exact-source transcription. This invariant constrains honest locks at the same height and the same lockedView. It is not itself a cross-view safety invariant, and EV-008 at MaxView=0 did not exercise ViewChange.
TLC checked · EV-008 · 0 violations
UniqueHonestProposalPerRound
Integrity
UniqueHonestProposalPerRound == \A p1, p2 \in proposals : /\ p1.proposer \in Honest /\ p2.proposer \in Honest /\ p1.h = p2.h /\ p1.v = p2.v => p1.val = p2.val
Exact-source transcription. Honest proposal records at the same height and view cannot carry different values. Byzantine validators may equivocate through the explicit Byzantine action family; EV-008's safety claim remains bounded to the checked configuration and selected invariant set.
TLC checked · EV-008 · 0 violations
PrepareVotesReferenceProposals
Integrity
PrepareVotesReferenceProposals == \A pv \in prepareVotes : \E p \in proposals : /\ p.h = pv.h /\ p.v = pv.v /\ p.val = pv.val
Exact-source transcription. Every PREPARE vote record in the modeled prepareVotes set references a proposal with the same height, view, and value. The v1.9 model has no Msgs state variable.
TLC checked · EV-008 · 0 violations
Source Authority and EV-008 Checked Set

The canonical v1.9 source defines additional predicates including TypeOK, NoConflictingDecisions, NoConflictingPrepareQCs, and NoConflictingCommitsAtHeight. The EV-008 cfg selects exactly four invariants: Agreement, LockedValueSafety, UniqueHonestProposalPerRound, and PrepareVotesReferenceProposals. Defined does not mean TLC-checked.

Byzantine Non-Vacuity Evidence

The v1.9 spec includes explicit Byzantine actions: ByzPropose (251,966 executions), ByzPrepare (1,901,481 executions), ByzCommit (12,863,638 executions). The adversary was active across millions of state transitions — this is not a vacuous pass on a system with no Byzantine behavior.

Known Limitation — Documented for Transparency

MaxView=0 in the EV-008 harness. LockedValueSafety was selected and TLC-checked in the EV-008 harness at MaxView=0. The final action coverage records ViewChange=0:0 and ReceiveQC=83394:9327900. The run exercised ReceiveQC but no ViewChange transitions, so it does not establish lock-displacement safety across later views (MaxView >= 1).

03 — Token Lifecycle Properties

Purchase-to-Review Binding Invariants

Seven invariants checked by TLC across 269 states (exhaustive for the tiny harness: 2 purchases, 3 nullifiers, 2 content values). Clean pass on February 11, 2026. Zero violations. Zero states remaining on queue.

TypeOK
Well-Typedness
TypeOK == /\ purchases ⊆ Purchases /\ tokens ⊆ TokenRec /\ reviews ⊆ ReviewRec /\ nullifierSet ⊆ Nullifiers /\ ∀ t ∈ tokens: t.purchase ∈ purchases
All four state variables are well-typed, and every token references a purchase that has been registered. tokens is a set of token records, not a map from purchases.
TLC checked · EV-009 · 269 states · 0 violations
AtMostOneTokenPerPurchase
Integrity
∀ p ∈ purchases: |{t ∈ tokens : t.purchase = p}| ≤ 1
Each purchase generates at most one cryptographic token. Prevents token multiplication attacks where an adversary attempts to generate multiple review rights from a single transaction.
TLC checked · EV-009 · 0 violations
AtMostOneReviewPerToken
Integrity
∀ t ∈ tokens: |{r ∈ reviews : r.token = t}| ≤ 1
Each token can produce at most one review. Combined with the one-token-per-purchase invariant, this bounds the model to at most one review per registered purchase.
TLC checked · EV-009 · 0 violations
NoOrphanReview
Integrity
∀ r ∈ reviews: r.token ∈ tokens ∧ r.token.status = "valid"
Every review references a token that exists in tokens and whose status is "valid". TypeOK separately requires every token to reference a registered purchase.
TLC checked · EV-009 · 0 violations
NullifierUniqueness
Non-repudiation
∀ n ∈ nullifierSet: |{t ∈ tokens : t.nullifier = n}| = 1
Every nullifier in the spent set maps to exactly one token. Prevents nullifier collision attacks and ensures the double-spend check is sound.
TLC checked · EV-009 · 0 violations
NullifierImpliesReview
Consistency
∀ n ∈ nullifierSet: ∃ t ∈ tokens: t.nullifier = n ∧ ReviewsForToken(t) ≠ {}
Every nullifier in nullifierSet belongs to a token that has at least one review. In the model, SubmitReview adds the review and the token’s nullifier in the same state transition; review records reference a token, not a nullifier directly.
TLC checked · EV-009 · 0 violations
GlobalNullifierUniqueness
Cross-Purchase
∀ t1, t2 ∈ tokens: (t1.nullifier = t2.nullifier) ⇒ (t1 = t2)
No two distinct tokens share a nullifier. This holds over all tokens, not only nullifiers already present in nullifierSet, and is enforced by the IssueToken guard n ∉ NullifiersInUse.
TLC checked · EV-009 · 0 violations
Source Vocabulary and Checked Invariants

TokenLifecycle.tla defines exactly seven invariant operators in Inv, all listed above. Single-use review behavior is enforced by the SubmitReview nullifier guard and nullifierSet update. The model’s only token-status update is the RevokeToken replacement from "valid" to "revoked". No additional lifecycle-status operator is presented here as a source invariant.

04 — Mechanism Design Property

Economic Deterrence Invariant

Cryptographic controls establish specific modeled integrity properties under the stated assumptions; mechanism design addresses residual economic incentives such as merchant collusion.

HonestyDominance
IC/IR
α · C₀ · Nγ > k ⇒ v* = 0 is unique profit maximum \* R(v) = k·ln(1+v) — reward (diminishing returns) \* C(v,N) = C₀·e^(αv)·N^γ — cost (exponential scaling) \* D(v) = C'(v) - R'(v) increasing for α>0 \* D(0) > 0 ⇒ no fraud is profitable at any scale
When the dominance condition holds, the marginal cost of the very first fake review already exceeds its marginal benefit. Fraud is not merely expensive — it is economically dominated at every volume. Validated across 500 Monte Carlo parameter scenarios with 100% pass rate.
Analytic guard derived · Locked dataset 500/500 · Runtime checkable
Verification Evidence

Analytic: D(v) = C'(v) − R'(v). Since C'(v) = α·C₀·eαv·Nγ and R'(v) = k/(1+v), the condition D(0) > 0 reduces to α·C₀·Nγ > k.

Empirical: mc_results_quick.csv — 500 parameter draws, all 500 satisfy honesty_dominates = True over tested ranges (α ∈ [0.037, 0.205], C₀ ∈ [549, 39125], γ ∈ [1.77, 2.90], N ∈ [1041, 19969]).

05 — RDE Principles Embodied

Rigorous Digital Engineering in Practice

The TLA+ specifications embody four principles from Rigorous Digital Engineering that structure the entire verification approach.

↕

Refinement Chain

Each TLA+ spec traces to security requirements above (threat model, security properties) and implementation artifacts below (circuit signals, API schemas). The spec bridges "what must hold" and "what the code does."

⇋

Assume-Guarantee Composition

Layers state what they assume and guarantee. Crypto guarantees (binding, soundness) feed consensus assumptions. EV-008's bounded checked consensus properties feed economic IC/IR conditions. Documented in THREAT_MODEL.md §6.

⊢

Design by Contract

In the v1.9 consensus model, honest Propose and Prepare are guarded by CanVoteFor(validator, val). Commit additionally requires a prepare quorum and lockedValue[validator] = val with lockedView[validator] = view[validator]. A false guard disables that transition in the modeled state space. The result excludes that transition only within the checked model and bounded configuration; it does not establish the absence of analogous violations in deployment.

⊞

Bounded Model Checking

Properties are verified within explicit finite bounds (4 validators, MaxView=0 for consensus; 2 purchases, 3 nullifiers for tokens). Limitations are documented, not hidden. Unbounded verification requires theorem provers (TLAPS), planned for Phase 2.

06 — Cross-Layer Composition

The Assume-Guarantee Chain

REF's three layers compose through explicit contracts. Each layer's guarantees become the next layer's assumptions.

Cryptographic Layer → Consensus Layer → Economic Layer
Crypto Guarantees

Binding commitments (Poseidon), unforgeable signatures (Ed25519), sound proofs (Groth16 128-bit), domain-separated tags prevent cross-protocol replay.

Consensus Assumes

Attestations are unforgeable (honest merchant ⇒ valid signature). Tokens are binding (witness cannot be forged). Nullifiers are collision-resistant.

feeds into
EV-008 Bounded Checked Properties

Agreement, LockedValueSafety, UniqueHonestProposalPerRound, and PrepareVotesReferenceProposals, under the EV-008 finite bounds including MaxView=0. These results do not establish liveness, rotating-committee semantics, or cross-view safety.

Economics Assumes

Cross-layer use must import only claims established by the relevant artifacts. EV-008 Agreement does not by itself prove token immutability, network-wide nullifier uniqueness, or deployment participation rates.

07 — Verification Status Summary

What Is Checked, What Is Planned

Transparency requires distinguishing verified claims from planned work. Every entry traces to a specific artifact and TLC log.

Property
Layer
Status
Evidence
Agreement
Consensus
✓ Checked
EV-008 · 152.7M states
LockedValueSafety
Consensus
✓ Checked
EV-008 · 152.7M states
UniqueHonestProposalPerRound
Consensus
✓ Checked
EV-008 · 152.7M states
PrepareVotesReferenceProposals
Consensus
✓ Checked
EV-008 · 152.7M states
TypeOK
Token
✓ Checked
EV-009 · 269 states
AtMostOneTokenPerPurchase
Token
✓ Checked
EV-009 · 269 states
AtMostOneReviewPerToken
Token
✓ Checked
EV-009 · 269 states
NoOrphanReview
Token
✓ Checked
EV-009 · 269 states
NullifierUniqueness
Token
✓ Checked
EV-009 · 269 states
NullifierImpliesReview
Token
✓ Checked
EV-009 · 269 states
GlobalNullifierUniqueness
Token
✓ Checked
EV-009 · 269 states
HonestyDominance
Mechanism
✓ Validated
Analytic + MC (500/500)
View-Change Safety (MaxView ≥ 1)
Consensus
○ Planned
Requires larger harness
Liveness under Partial Synchrony
Consensus
○ Planned
Requires fairness + TLAPS
Spec↔Code Equivalence
Cross-Layer
○ Planned
Requires Cryptol/SAW
Intellectual Honesty Note

Bounded model checking proves properties hold within the explored state space — not universally. The green items are verified by TLC logs. The cyan items hold by construction (action guards) but are not separate INVARIANT lines. The amber items are gaps where formal methods expertise would accelerate the work. The refinement from TLA+ to running Circom/Python code is human-maintained, not machine-checked (DEF-02).