compact guard

Security scans for Midnight contracts, recorded on-chain without exposing unfixed bugs.

Repo

About

## Wave 2 submission

New project, built entirely in Wave 2.

compact-guard finds what the Compact compiler can't: disclosures, hashes, commitments and access checks that compile but are unsafe. Results are recorded on Midnight, where counts are public and full reports stay private until the bugs are fixed.

Live site: https://compact-guard.onrender.com Code: https://youtu.be/rYjtzSiiOFg Registry contract (Preprod): e27624e00a5f3a1fcc64f1b370aaea3f5d028eb9fb4be92ff852dbb44be24538

WHAT WE BUILT

1. Compact parser: our own tree-sitter grammar, run as WASM. Zero parse errors on every official Midnight example we tested. 2. Analyzer with 8 rules from Midnight's security guidance: ownPublicKey() used for authorization, guessable hashes (e.g. a vote), reused commitment randomness, private keys in public Set/Map, Merkle paths not bound to the caller's leaf, missing domain separation, whole-struct disclosure, one-time actions without a nullifier. It tracks every value from witness to ledger through helper circuits and struct fields. Each finding links to the Midnight docs. 3. Tested on Midnight's own examples: first version raised 17 warnings; after reworking the analysis, 0 warnings and 12 review notes, each a real design question (e.g. election links one voter across three circuits). 4. CLI with text, JSON and SARIF 2.1.0 output, plus a GitHub Action for code scanning (runs green on the repo). 5. Registry contract in Compact: stores source hash, finding counts, tool version and a persistentCommit of the report hash. Attesters prove knowledge of a secret (never ownPublicKey()); domain-separated hashes; fresh randomness per commitment; witnesses.ts and a simulator test suite. 6. Deployed to Preprod with 11 real attestations: the registry itself, Midnight's bulletin board, six docs examples and three test contracts (two deliberately vulnerable). The registry's own report is revealed on-chain (block 3,039,250) and its SARIF hash matches. 7. Hosted web UI: paste a contract to see findings and whether that exact source is attested; browse every attestation read live from the Preprod indexer.

WHY MIDNIGHT

A security report is dangerous to publish before its bugs are fixed. The registry lets a project prove it was scanned, and with what result, without exposing unfixed vulnerabilities. The attester can reveal the report later and prove it is the one committed.

TESTING

41 analyzer, 12 CLI, 10 registry simulator and 11 parser tests pass. All 16 corpus contracts compile with compiler 0.31.1. compact-guard scans its own registry with 0 errors and 0 warnings.

LIMITS

Static and heuristic, so a clean result is not a proof of safety. No cross-file imports yet. One attester so far.

NEXT

Attest from CI on every merge, attestation status in wallets and explorers, cross-file analysis.

From the public Akindo product page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

Not checked yet.

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.