Highbury Formal

Formal verification  /  On-chain credit & vault accounting

Financial invariants, proven.

We state what a protocol's accounting must never do, then prove it holds for every input in range — with Z3, an exact-integer replay of the deployed source, and planted bugs that every proof must catch.

I.  Ledger

Live Verification Ledger

Every entry is reproducible from public, verified source. A result is recorded only after its mutation tests confirm the proof is not vacuous.

Ledger in preparation First entries  December 2026

Entries are published only after each protocol has received notice. All research is independent, on public and verified source code: entries are not commissioned by, affiliated with, or endorsed by the protocols listed, and each result holds within the scope modelled in its report. It is not an audit or a guarantee of security.

II.  Benchmark

Seven historical exploits, from pre-exploit source.

We pinned each protocol's public source at a commit dated before its exploit and ran the same four invariants we use on every engagement: solvency, no profit loop, no unbacked minting, no authorization bypass. A case counts only if the violation replays with exact integers and the project's fix is proved to close it.

7 / 7Exploits flagged
$430MReported losses, approx.
0False alarms on fixed & clean code
IncidentDateReported lossInvariant brokenWorst case foundResult
Euler FinanceDonation without a solvency check2023-03-13~$197MINV-SOLV · INV-PROFITAttacker more than doubles the equity put inFlagged Fix proved
Nomad BridgeZero trusted root2022-08-01~$190MINV-AUTHSolver selects root 0: any unproven message executesFlagged Fix proved
Popsicle FinanceFee entitlement not settled on transfer2021-08-04~$20MINV-BACKPays out 2× the fees collectedFlagged Fix proved
bZx / FulcrumSelf-transfer balance caching2020-09-14~$8MINV-BACKBalance doubles in one transferFlagged Fix proved
Hundred FinanceCompound V2 fork, empty-market rounding2023-04-15~$7MINV-PROFITRedeem pays 25%+ of market cash above share valueFlagged Fix proved
Cover ProtocolStale reward accumulator2020-12-28~$4MINV-BACKMints 2·10¹² × the period's emissionFlagged Fix proved
RaftShare mint rounded up2023-11-10~$3.3MINV-BACK1 wei deposited, 10¹⁸ creditedFlagged Fix proved

Controls: the same invariants hold, with no counterexample, on OpenZeppelin ERC4626 v5 and the Uniswap V2 pair, and both catch a planted bug. This is a hindsight benchmark: each exploit was known before it was modelled, so it shows the method can express, detect, size and prove fixes for these bug classes, not how often a blind review would find them. Losses are public post-mortem figures, rounded. Protocols named here were not reviewed by us before their incidents and are not clients. Protocol, runner and pinned sources are available on request.

III.  Method

Three independent lines of evidence.

A proof is only as good as its model. We test the model against the code, and the proof against deliberate failure.

i.

Proof

Each invariant is negated and handed to the Z3 SMT solver with an exact model of the contract's integer arithmetic, including every rounding direction. Unsat means no input in range can break it.

ii.

Replay

The deployed source is transcribed line by line into exact-integer Python, with reverts modelled as atomic rollbacks, and driven through hundreds of thousands of randomized histories on live parameters.

iii.

Mutation

We plant bugs — a flipped rounding, a missing term — and require every proof and replay check to catch them. A check that cannot fail is not reported.

IV.  Proof

A proof, in full.

After a borrower default, a recovery price is floored once and applied to every claimant. Is any payout ever larger than its exact pro-rata share of the reserve?

recovery_payout.pyz3-solver
from z3 import *

ONE = 10**18                 # RECOVERY_FULL
R, T, b, price, pay = Ints("reserve total claim price pay")

s = Solver()
s.add(1 <= T, T <= 4 * 10**15, 0 <= b, b <= T, 0 <= R, R <= 4 * 10**15)
# price = floor(R * 1e18 / T)
s.add(price * T <= R * ONE, R * ONE < price * T + T, price >= 0)
# pay = floor(b * price / 1e18)
s.add(pay * ONE <= b * price, b * price < pay * ONE + ONE, pay >= 0)

# negate the invariant: some payout exceeds b * R / T
s.add(pay * T > b * R)
print(s.check())
$ python recovery_payout.pyunsat

V.  Contact

Engagements and disclosures by private correspondence.

contact@highburyformal.com