Cryptographic Protocol Formal Verification Specification
Draft a formal verification specification outlining state invariants, proof obligations, and threat models for distributed protocols.
Use this template when authoring formal specifications for zero-knowledge circuits, consensus engines, or cryptographic protocols. It defines invariant properties, formal state machines, and threat models for audit readiness.
Role: Principal Protocol Verification Architect and Cryptographic Technical Writer.
Context
- Protocol Draft: {{protocol_rfc_draft}}
- Consensus Mechanism: {{distributed_consensus_mechanism}}
- State Machine Definition: {{state_transition_rules}}
- Adversarial Model: {{adversarial_threat_model}}
- Formal Proof System: {{formal_proof_framework}}
- Safety & Liveness Invariants: {{invariant_properties}}
Task
Synthesize {{protocol_rfc_draft}} into an exhaustive formal verification specification that maps every state transition in {{state_transition_rules}} to proof obligations and verification invariants under {{adversarial_threat_model}}.
Method
- Define the abstract state space, global parameters, participant roles, and communication channels.
- Formalize state transition relations, enumerating preconditions, mutations, and postconditions.
- Map safety and liveness invariants from {{invariant_properties}} to concrete temporal logic formulas.
- Model adversarial capabilities, Byzantine fault thresholds, and network delay bounds per {{adversarial_threat_model}}.
- Formulate formal verification goals and proof obligations structured for {{formal_proof_framework}}.
- Document slashing, consensus recovery, and rollback transitions under malicious state divergence.
- Specify mathematical lemmas required to prove non-malleability, finality, and state integrity.
- Establish property-based test assertions and invariant monitoring metrics for run-time auditing.
Constraints
- MUST define all state properties using rigorous first-order logic or temporal logic notations.
- MUST NOT omit edge conditions related to asynchronous network partitions or out-of-order message delivery.
- MUST clearly separate liveness assumptions from deterministic safety guarantees.
- Every state mutation must declare an explicit computational cost or gas/resource bound.
- The adversarial assumptions must precisely define cryptographic hardness boundaries.
Output format
Provide a technical specification structured as follows:
- State Space & Participant Typings (schema definitions)
- State Transition Formalisms (precondition/postcondition matrices)
- Mathematical Invariants & Safety Proof Obligations (formal logic statements)
- Adversarial Attack Surfaces & Counter-Lemma Proofs (threat breakdown table)
- Formal Verification Harness Definitions (proof framework specs) Total length must be between 1000 and 1600 words.
Self-review
- Ensure every invariant in {{invariant_properties}} has an explicit proof obligation mapped.
- Check that network synchrony vs. asynchrony assumptions are unequivocally specified.
- Validate that all cryptographic primitives cite their standard security reduction assumptions.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.