Freeboard

A CLI and Compact contract for proving a DeFi position is solvent without revealing the position.

TypeScript · Midnight · Compact

01 / 06

Brief

Before a lender, DAO, or insurer extends terms, it may need to know a borrower is still above a liquidation threshold. Today that usually means seeing the whole position: collateral, debt, and threshold. A zero-knowledge proof over numbers the borrower typed in is not enough either. It only proves the arithmetic works, not that the position is real.

Build

Freeboard is a Compact contract and CLI on Midnight. An oracle signs the private position; the circuit verifies that signature before it runs division-free, Aave-style health-factor math. The ledger receives only SAFE or AT_RISK, the attestation time, and a check count. The --tamper command changes the collateral after signing so the same circuit can demonstrate a real in-circuit rejection.

Key decisions

  • The attestation check comes before the math. Without it, the proof would be a rigorous check of self-reported numbers and little else.
  • The ledger has nowhere to store collateral, debt, or threshold. Privacy is structural: those fields do not exist, while the observation time is disclosed so a verifier can judge freshness.
  • I migrated the whole SDK stack to a beta release line because it was the only installable combination consistent with the current compiler and tagged Schnorr keys. The mismatch and tradeoff are documented rather than hidden.
  • I built an interactive dashboard, then removed it after the scenario object appeared in rendered HTML and exposed the numbers the UI claimed to hide. The shipped web page is static; the CLI remains the product interface.

Outcome

Published as freeboard-cli on npm, with a live static site. Three scenarios were verified against a contract deployed to a local Midnight ledger-9 devnet: SAFE, AT_RISK, and a forged position rejected in-circuit. I submitted it to Midnight Buildathon Wave 1; judging was still in progress when this was written, so there is no placement to report.