TVL Protected: $3B+Projects Secured: 1500+Years in Web3 Security: 7+

Formal Verification for Smart Contracts

Tests check the cases you thought of. Formal verification proves a property holds for every input and every call sequence. QuillAudits derives your invariants, writes the Certora specs, and ends each rule as proven or as a reproducible exploit.

We respond within 24 hours

What Is Formal Verification?

Formal verification is a method that uses mathematics to prove a smart contract satisfies a written property for every possible input and execution path. You state a rule the contract must never break, and a prover either proves the rule always holds or returns the exact scenario that violates it.

What it is
A mathematical proof that a contract satisfies a written property for every possible input, caller, and call sequence.
What you get
Each property ends as proven, or as a concrete counterexample showing the exact state and call that breaks it.
Where it fits
After manual review and fuzzing, on the accounting, access control, and state machine logic you cannot afford to get wrong.
What it is not
A replacement for an audit. A proof only covers the properties somebody wrote down, so the specification still needs expert review.

Last updated November 2026.

Why Web3 Needs Formal Verification in 2026

Audits and tests are still necessary. Four things changed that make them insufficient on their own for high-value contracts.

Record incident volume

$935.3M lost across 87 DeFi hacks in H1 2026.

That is the QuillAudits H1 2026 DeFi Security Report count. Immunefi logged 207 crypto incidents in the same six months, the highest half-year count it has recorded. Most dollars went to key compromise and bridge failures, but contract logic bugs stayed the most frequent way in.

AI finds bugs faster

A four-year-old bug fell in six hours.

In May 2026 an AI-assisted review produced a working double-spend proof of concept against Zcash Orchard in about six hours. The flaw had been live since 2022 and had survived expert review. Attackers have the same tools.

Read our Zcash Orchard analysis
AI writes more code

Code ships faster than humans can read it.

Teams now generate large parts of their contracts with AI. Review time has not grown to match. A machine-checked proof scales with the code in a way line-by-line reading does not, which is why pairing AI-written code with formal verification is now an open topic among Ethereum researchers.

The real bottleneck

The prover was never the hard part.

Provers are mature. What blocked adoption was deciding which properties to prove and encoding them correctly, work that used to need a dedicated formal methods engineer for weeks. That specification layer is what QuillAudits automates.

Sources: QuillAudits H1 2026 DeFi Security Report, Immunefi H1 2026 ecosystem update, QuillAudits Zcash Orchard analysis.

What Formal Verification Can Prove

Properties fall into six classes. Each one becomes an invariant or a rule that Certora Prover checks against every reachable state.

Property classes QuillAudits formally verifies, with an example invariant and typical protocol types
Property classExample invariantTypical for
Solvency and accountingTotal assets are always greater than or equal to total liabilities.Vaults, lending markets, stablecoins, liquid staking
Supply conservationtotalSupply always equals the sum of all user balances.Tokens, share-based vaults, rebasing assets
AuthorizationOnly the owner can pause, upgrade, or change fee parameters.Any protocol with roles, governance, or upgradeability
Value flowNo call sequence lets a user withdraw more than they deposited.Bridges, escrows, staking, reward distributors
State machine validityA closed position can never return to active.Auctions, vesting, governance, liquidations
Cross-contract consistencyVault share accounting always matches the token contract.Multi-contract systems and integrations

How QuillAudits Formal Verification Works

Quill FV is a multi-agent pipeline that sits on top of Certora Prover. AI does the specification work. The prover does the proving. An auditor signs every verdict.

  1. 01 / Recon

    Read the protocol.

    We map storage, entry points, roles, state transitions, and external dependencies, then mine your existing Foundry and Hardhat tests for scenarios, boundary values, and revert paths.

  2. 02 / Discover

    Derive the properties.

    Every storage variable is interrogated. Coupling analysis, value flow tracing, state machine extraction, a role by function matrix, and threat-driven anti-properties produce the candidate invariants.

  3. 03 / Prioritize

    Rank and pre-falsify.

    Candidates are ranked P0 to P3, with critical accounting first. Each one is checked against the code before any spec is written, so likely violations are flagged early.

  4. 04 / Specify

    Write the CVL.

    We generate per-contract and system-level Certora specs, harness contracts where internals need exposing, and a ledger documenting how every external call is linked or summarized.

  5. 05 / Prove

    Run the prover.

    Specs pass a quality gate with no placeholders and no unjustified assumptions, then run on Certora Prover with rule sanity and vacuity checking always on.

  6. 06 / Triage

    Classify every failure.

    Each failure is labeled as a spec error, vacuous rule, timeout, or likely bug. Spec errors, vacuity, and timeouts are repaired and rerun, up to three attempts per rule, before an engineer takes over.

  7. 07 / Validate

    Turn it into a PoC.

    A counterexample is only a finding once it is reachable on a real chain state. Likely bugs are lowered to a Foundry test. If the exploit reproduces it is confirmed, otherwise it is a false positive.

  8. 08 / Report

    Hand over the proofs.

    You receive the property table, prover run links, counterexample traces, confirmed bugs with PoCs, and the full assumptions ledger. An auditor signs off on every verdict.

Formal Verification vs Fuzzing vs Audit vs Testing

Each technique catches a different class of problem. None of them replaces the others.

Comparison of unit testing, fuzz testing, manual audit, and formal verification for smart contracts
ApproachWhat it doesWhat you getWhat it misses
Unit testingRuns the specific cases you wrote.Confidence that those cases behave correctly.Every case nobody thought to write.
Fuzz testingRuns millions of randomized inputs and call sequences against invariants.Finds bugs quickly. Cannot show that none remain.States the random search never reaches.
Manual auditExperts read the code, question the design, and model attackers.Finds logic, economic, and design flaws tools do not understand.Paths too numerous for a person to trace exhaustively.
Formal verificationProves a written property over every input and execution path.A mathematical proof, or an exact counterexample.Any property that was never specified.

Need the randomized side as well? See formal verification and fuzz testing or start with a smart contract audit.

Tools We Use and What You Receive

Everything produced during the engagement is yours, including the specs.

01 / Tooling

The right prover for each property.

  • Certora Prover · Primary proving engineMulti-transaction invariants and rules written in CVL. Best for DeFi protocols with complex state and cross-contract accounting.
  • Halmos · Symbolic testingBounded symbolic execution of Foundry-style tests. Open source, fast, and a natural fit for teams already on Foundry.
  • Solidity SMTChecker · First-pass checksBuilt into the compiler. Low friction assertion and overflow checks before heavier proofs are worth running.
  • Foundry · Exploit validationEvery likely bug from the prover is reproduced as a runnable test, so a finding ships with proof that it is real.
02 / Deliverables

Proofs you can re-run.

  • Formal verification reportProperties proven, properties violated with counterexample traces, and properties skipped with the reason. Delivered as markdown and PDF with prover run links.
  • Spec and config files you ownThe .spec and .conf files plus any harness contracts, committed to your repository and reusable in CI on every pull request.
  • Assumptions ledgerEvery summarized oracle, token, or bridge call and every precondition, written down so a reviewer can challenge it.
  • Foundry PoCs for confirmed bugsA runnable exploit test for each confirmed counterexample, with a recommended fix and a re-verification run after you patch.

What Formal Verification Does Not Prove

A vendor that sells formal verification as a guarantee is overselling it. These are the limits, and how we handle each one.

It proves the spec, not your intent.

If a property is missing or wrong, the prover will certify the contract against the wrong rule. This is why our auditors review the property list before anything is proven.

It does not model incentives.

Oracle manipulation, governance capture, and economic attacks depend on markets and people. They need manual review and economic analysis.

It does not cover operations.

Key compromise and bridge configuration drove most 2026 losses by value. Those need opsec, multisig, and infrastructure review, not a prover.

Proofs rest on assumptions.

External calls are summarized and loops are bounded. A proof is only as honest as the assumptions behind it, so we list all of them.

Formal Verification FAQs

Formal verification is a method that uses mathematics to prove a smart contract satisfies a written property for every possible input and execution path. You state a rule, such as total supply always equals the sum of balances, and a prover either proves it can never be violated or returns the exact scenario that breaks it.

No. They answer different questions. An audit asks whether the design and the rules themselves are right, and it catches economic and logic flaws that no tool understands. Formal verification proves that specific rules always hold. Strong security reviews use both, and QuillAudits runs formal verification after manual review, not in place of it.

No. It proves only the properties that were specified, under the stated assumptions. A property nobody wrote is not covered, and a wrong specification produces a proof of the wrong thing. It also does not cover key management, oracle manipulation, or economic attacks.

Fuzzing runs millions of random inputs and call sequences looking for a failure. It finds bugs fast but cannot prove none remain. Formal verification reasons about all inputs symbolically, so a property is either proven or broken with a counterexample. Fuzzing searches for failures, and formal verification decides whether a failure is possible.

Contracts where one accounting or access control error is catastrophic: lending markets, vaults, stablecoins, bridges, liquid staking, and anything upgradeable holding significant value. Simple contracts are usually well served by an audit, unit tests, and fuzzing. Most teams verify only the handful of invariants they cannot afford to get wrong.

Certora Prover is the primary engine, with properties written in CVL. We also use Halmos for symbolic testing of Foundry tests and the Solidity SMTChecker for first-pass checks. Confirmed counterexamples are reproduced as Foundry proof of concept tests.

AI handles the specification layer, which is the slow part. Our multi-agent pipeline reads the code, tests, and docs, derives and ranks candidate invariants, and writes the Certora specs. The proving is done by Certora Prover, not by a language model, and an auditor reviews the properties and signs every verdict.

The prover returns a counterexample trace. We classify the failure as a spec error, a vacuous rule, a timeout, or a likely bug. Spec problems are fixed and rerun. A likely bug is checked for reachability and reproduced as a Foundry test, and only a reproduced exploit is reported as a confirmed finding.

A vacuous rule passes without testing anything, usually because its preconditions can never be true. It looks like a proof but protects nothing. We run every spec with sanity and vacuity checks on, so a rule that passes trivially is flagged and rewritten instead of counted as proven.

Yes. QuillAudits' specification generation skills are free to use with your own Certora Prover account and API key. They analyze your contracts and write the specs, and Certora's infrastructure runs the proofs. Contact us for access. Prover usage is billed by Certora under your own plan.

Which invariants can your protocol not afford to break?

Send us the repository. You get back a ranked list of the properties worth proving and a fixed scope for proving them, whether or not you engage us.

We respond within 24 hours

Formal verification proves the stated properties under the documented assumptions. It is not a guarantee that a contract is free of vulnerabilities. Certora Prover is a product of Certora. QuillAudits is an independent security firm and uses it as a third-party proving engine.

Related QuillAudits services

WE SECURE EVERYTHING YOU BUILD.

From day-zero risk mapping to exchange-ready audits, QuillAudits helps projects grow with confidence. Smart contracts, dApps, infrastructure, compliance: secured end to end.

QuillAudits Logo


ISO 27001Circle Alliance Program
Uniswap FoundationAethiropt-collectivePolygon SPNBNB Chain Kickstart

All Rights Reserved. © 2026. QuillAudits - LLC