Skip to content

Your contract hides the vote. The ledger still shows it.

Tell finds what a Midnight Compact contract reveals about its private inputs, measures it in bits, and shows the fix before you deploy.

Free and open source, Apache-2.0. In CI: uses: RohanGlitched/tell@v1

ballots, as stored on Preprod817fd936…741ed0ae
  1. vote 00e7c2…85caChen
  2. vote 00c6ab…d861Asha
  3. vote 005289…663fChen
  4. vote 003baa…92e3Bilal
  5. vote 006da8…7e6cDara
  6. vote 002751…8dbeChen

6 of 6 votes recovered in four guesses. Each is hash(choice) with only four possible choices. Read them from the indexer now.

Why this happensCompact checks that private data is disclosed on purpose. It does not check how much the disclosure gives away.

Midnight keeps private inputs off the chain. What a contract does with them can still give them away: a hash of a vote, a branch on a balance, the same tag on every post. Every contract has a tell.

Compiler and TellFive lines that compile, five secrets that leak.

Tell starts where disclose() stops.

Each line below is accepted by the compiler. Tell reads the compiler's own output and says what each one costs.
disclose(hash(vote))compiler: accepted
2 bitsAsserted below four, so four guesses recover it.
disclose(hash(id, salary))compiler: accepted
guessableid is public in the same call; the salary falls to brute force.
if (disclose(bid >= reserve)) a.insert(t)compiler: accepted
1 bitWhich set was written shows which side of the reserve the bid is on.
posts.insert(n, disclose(hash(key)))compiler: accepted
linkableThe same tag on every post: one identified post unmasks them all.
owner = disclose(degradeToTransient(sk))compiler: accepted
in the clearA cast, not a hash. The key itself is on the ledger.

The reportWritten to be read by a developer today and attached to an audit tomorrow.

Findings an auditor would write, in the time it takes to compile.

ballot-leaky.compact

Compact 0.31.1. Circuits register and vote and constructor. 3 findings.

  1. F-1

    Guessable hash

    choice() is hidden behind a persistentHash anyone can reverse. Circuit vote, line 36.

    critical
  2. F-2

    Linkable tag

    voterKey() is hidden, but leaves the same tag every time. Circuit register, line 27.

    low
  3. F-3

    Linkable tag

    voterKey() is hidden, but leaves the same tag every time. Circuit vote, line 32.

    low

What a chain observer records when vote runs

  1. 1voters.member(tag)
  2. 2ballots.member(tag)
  3. 3ballots.insert(tag, hash(choice()), 2 bits)

The fix Tell wrote and verified

+witness ballotsNonce(): Bytes<32>; // fresh random bytes per call, kept to open the commitment
+
- ballots.insert(tag, disclose(choiceHash(c)));
+ ballots.insert(tag, disclose(persistentCommit<Bytes<32>>(choiceHash(c), ballotsNonce())));

Scanned again

CompilesFinding goneGrade F to B
Open the full report

How it worksStatic analysis of what the compiler builds. No model, no sampling.

It reads your contract the way the compiler does.

  1. 1

    Compile

    Runs the Compact compiler your pragma asks for, preferring 0.31.1 for Ledger 8 and 0.36.0 for Ledger 9 (mainnet since November 6).

  2. 2

    Read the circuits

    Uses the compiler’s reduce-to-circuit form: helpers inlined, loops unrolled, every step a guarded binding.

  3. 3

    Trace and count

    Follows each witness and argument through hashes, casts and branches to every public write, counting the bits that survive.

  4. 4

    Grade and report

    A to F per contract and a fix per finding, as text, JSON, SARIF or a report you can share.

How Tell works, and what it cannot see

IntegrationsOne engine, wherever the contract is being written.

Run it where you work.

GitHub Actioncode scanning

Checks every pull request that touches a .compact file. Findings appear in GitHub code scanning on the line that leaks; the build fails above the severity you choose.

- uses: RohanGlitched/tell@v1
  with:
    path: contract
    fail-on: high

Command line

A readable report, JSON for scripts, SARIF for code scanning. Runs the compiler your pragma asks for.

npx tsx engine/src/cli.ts . --sarif tell.sarif --fail-on high

Web scanner

Paste a contract or a public repository. Share a report as a link that carries the contract itself; nothing is stored.

tell-midnight.vercel.app/scan

README badgenew

Your repository's grade on its README, refreshed about once a day.

[![Tell privacy grade](https://tell-midnight.vercel.app/api/badge/OWNER/REPO)](https://tell-midnight.vercel.app/scan#r=OWNER/REPO)

Pull-request reviewwith verified fixes

The Action comments on the changed lines of each pull request with the finding, the bits it gives away and, where one passes, a verified patch as a suggestion you commit.

- uses: RohanGlitched/tell@v1
  with:
    comment: true
    suggest-fixes: true
    comment-on: medium

VS Code

Leaking lines marked on open and save, with the bits and the fix on hover, a quick fix that shows Tell's patch, and the grade in the status bar.

Problems: critical: choice() is hidden behind a persistentHash anyone can reverse (2 bits)
Status bar: Tell: F

MCP serverfor coding agents

Agents that write Compact call tell_scan on what they wrote, tell_check_fix after each edit, and tell_explain_rule for the why. Runs locally; nothing is sent anywhere.

claude mcp add tell -- node /path/to/tell/mcp/dist/server.js

EvidenceAll of it reproducible from the open repository.

Proved on Midnight Preprod, not just in a test.

Two ballots, the same 6 votes, one line apart. The site reads both from the indexer and runs the attack Tell predicted.

ChenAshaChenBilalDaraChen

6 of 6 votes recovered

Hash the four candidates, match the ledger. See it live

0 of 6 recovered

Each vote is a commitment with a salt only the voter holds. See it live

Every buildathon app, scanned

111 public repositories, 248 contracts compiled, 96 projects analysed circuit by circuit. 15 with a finding at medium or worse, each read by hand.

A 47B 34C 14F 1

Read the survey

The leak zoo

Eleven leaks, eleven fixes (22 contracts), 22 attack tests in CI.

  • ballothash(vote)attacked, fixed
  • paybandhash(id, salary)attacked, fixed
  • reservebranch on a bidattacked, fixed
  • boardsame tag per postattacked, fixed
  • vaultkey cast to publicattacked, fixed
  • rafflehash in the constructorattacked, fixed
  • faucetshielded mint, public nonceattacked, fixed
  • depositbid paid in the clearattacked, fixed
  • clubown leaf as a lookup keyattacked, fixed
  • keyringaccount id is the private keyattacked, fixed
  • pollhash in a Ledger 9 eventattacked, fixed

Tell DeskCoordinated disclosure for privacy leaks, on Midnight.

Tell the team before you tell the world.

A public report of a privacy leak exposes the users first. Tell Desk seals the finding on Midnight, lets the team answer and fix it without announcing an open bug, and records the contract’s grade for wallets to read.

live on Preprod

To the maintainers of a contract

Sealed finding

On chain: a commitment, a time, a statusEmbargo: 90 days
T
  1. 1
    Seal

    The researcher seals the report. The ledger stores a commitment, a per-report tag, the time and status pending. The text goes to the team off chain.

  2. 2
    Acknowledge

    The maintainer proves in zero knowledge that they hold the opening and a credential for that project. Status: acknowledged.

  3. 3
    Fix

    Same proof again once the fix is out. Status: fixed. The chain never said which project it was: the proof hides among every registered maintainer credential, counted live below.

How Tell Desk works

Who paysThe engine, CLI, Action and every rule are Apache-2.0.

Free for open source. Paid for private code and audit work.

Open-source core

live

Free

Always free. Public repositories never pay.

  • Apache-2.0
  • SARIF for GitHub code scanning
  • Public repositories, unlimited

Hosted pull-request bot

planned

$49 per private repository a month

Planned; a hypothesis to test with the first pilot. Priced per repository, not per seat: Midnight teams are small. Public repositories stay free.

  • Private repositories
  • Fix suggestions on the pull request
  • Grade history per contract

Audit-firm license

in progress

$3,000 to $6,000 a year per firm

A price we will test, not sold yet. Pilot talks requested with two firms on November 7; the first engagement is free.

  • Bulk and private scans
  • Report templates
  • Rule updates for each compiler release

Ecosystem sponsorship

planned

By agreement

$30,000–60,000 for 12 months, to be requested; everything it pays for stays open source.

  • Compiler and ledger release tracking
  • Template integration
  • Public survey reruns
Who Tell is for

Before you deployA contract’s history is public forever.

Find the tell before someone else does.

Scan a contract