ZK circuits
There are nine circuits — one for each kind of action you can take. A circuit is just a tiny program that checks a single, specific claim is true. Here is what each one does, in plain English. No math required.
Each runs in your browser, takes a few seconds to a couple of minutes, and produces a small proof the Vault can check on-chain. You never see most of them — they fire automatically as you deposit, bet, and settle.
Putting money in
Deposit. The moment you add USDC, this proof guarantees the private note you receive is worth exactly what you put in — not a cent more. It's the safety catch on the whole system: without it, someone could deposit $1 and claim a $1,000 note, draining the shared pool. It also stamps the note with your wallet, which is what later lets only you withdraw.
Placing a bet
Bet authorization. The workhorse you trigger every time you bet. In one shot it proves three things: that you genuinely own a note sitting in the vault, that the note holds enough to cover the bet plus the small fee, and that the leftover change is correctly recorded as a fresh note — all without revealing which note is yours or how much it held. This is the proof that lets you bet privately.
Collecting a win
Settlement credit. When a market resolves and you backed the winning side, this claims your payout. You prove you held the winning position; the Vault itself looks up the official payout from Polymarket's settlement contracts and fills in the numbers, so no one can exaggerate their winnings. Your money arrives as a new private note.
Taking money out
Withdrawal. Turns a note back into real USDC. It proves you own the note and that the destination is your own depositing wallet — the funds physically cannot be sent anywhere else. This is the rule that makes PolyShield a private vault rather than a mixer.
When an order doesn't fully go through
Bet cancel. Some orders are all-or-nothing; if the market can't fill yours, it's cancelled. This proof refunds your full stake into a fresh note so nothing ever gets stuck.
Partial credit. For limit orders that only fill part-way, this returns the unfilled remainder. You keep the shares you actually bought and get the rest of your money back.
When a market is voided
Cancel credit. Occasionally a market resolves to "no outcome" — the question became void or meaningless. Once the Vault confirms on-chain that the market truly paid out nothing to anyone, this proof refunds your bet in full.
Selling early & tidying up
Position close. You don't have to wait for a market to resolve. If you sell your shares back before settlement, this credits the sale proceeds into a new note.
Consolidate. Over time you collect several small notes — change from bets, credits from wins. This merges up to four of your notes into one larger note. Pure housekeeping: no money moves and no bet is placed.
.nr files — those are a human-readable specification for reference only; they are never compiled or used to make a proof.)