Clinch

Sybil-proof token launches and Uniswap v4 batch swaps where splitting wallets never helps.

Clinch

Created At

ETHGlobal Mumbai

Project Description

Every token sale on Ethereum has to decide who gets the scarce supply, and every common rule for that counts wallets. Per-address caps, pro-rata splits and whitelists are free to break: a whale makes fifty wallets and takes fifty allocations. Uniform-price auctions such as Uniswap’s CCA fix splitting but reward lying, because a large bidder who understates demand keeps the clearing price low and buys the rest cheap. Arbitrum’s airdrop lost 21.8% to 148,000 sybil addresses despite months of forensics, LayerZero ended up paying bounty hunters to inform on sybils, and the industry’s answer has drifted toward KYC and biometrics on what are supposed to be permissionless sales.

Clinch is a sybil-proof, truthful auction engine built on the October 2026 adaptive-clinching result, which proves that if bidders’ budgets are enforceable, no set of fake identities beats one honest bid and bid order does not matter. On Ethereum, enforcing a budget is one line: escrow it. Each bidder deposits a budget and sets a max price. A price clock rises in steps, and at each step you clinch whatever remaining supply the other bidders can no longer afford, paying for those units at that price. The mechanism only ever sees the sum of everyone else’s escrowed money, so splitting across wallets changes nothing, shading your bid just drops you out earlier with fewer units, and there is no ordering to race for. In our simulations a whale gains 15x by splitting under a capped sale and 44% by shading under a uniform-price auction; under Clinch it gains nothing from either and slightly loses.

For the proofs and the measurements, see the research notes at https://clinch-ur-token.vercel.app/whitepaper.pdf.

Two products share one pure Solidity engine on Uniswap v4. ClinchLaunch sells a fixed supply on the clock, then in the same settle transaction initializes a full-range v4 pool at the discovered price with the proceeds and locks the liquidity forever. ClinchHook turns any v4 pool into a batch market: orders are escrowed for a few blocks, two-sided demand is matched by the same auction with the pool’s constant-product curve as the supply, and only the residual hits the pool in one swap inside unlock. Sandwich bots earn nothing because there is nothing to reorder, and the discretization surplus is rebated to traders. No admin keys; anyone can settle, and if nobody does, anyone can cancel and everyone is refunded in full.

Clinch needs no identity to be honest, but some issuers still want a per-person cap, so the World ID arm runs the same launch with hUSDC, a 1:1 USDC voucher that only a verified human can mint, capped at 2,000 USDC per World ID nullifier, bound to one wallet and non-transferable between wallets. The core contracts are untouched; identity composes on top of a mechanism that no longer needs it. Watching a launch also leaks interest, since every price read tells an RPC provider which address is about to bid on which sale, so the app routes reads through the EF’s Anon-RPC when a specifier is configured. No trackers or analytics in the client.

Live on Sepolia against Uniswap’s official v4 PoolManager with every contract verified: a six-bidder launch settled and seeded a CLNCH/USDC pool, a five-order two-sided WETH/USDC batch cleared in a single transaction, and the World ID arm is live with a success path and three rejection paths on chain. 99 Foundry tests with every claimed property fuzzed 2,000 times, Solidity checked bit-for-bit against a Python reference over 768 differential runs, an 80,000-strategy adversarial search that found no profitable deviation from honesty, and a sandwich bot that found no free lunch. The business case is simple: a launch where nobody can be cheated by whales, bots or sybils is a launch that does not need a credential, and any issuer on v4 can run one with a price and a budget instead of a KYC vendor.

How it's Made

The whole thing is one pure Solidity library, ClinchEngine, that computes every allocation; ClinchLaunch and ClinchHook are thin wrappers around it and only touch Uniswap v4 inside settle(). We built the engine twice on purpose: first in Python as a research reference (research/clinch), then in Solidity, and the Foundry suite calls the Python engine over FFI and asserts the two agree to the wei. That differential harness is what let us iterate on the math without fear; every one of the 99 tests, including 2,000-run fuzzing per property, pins a named theorem from the paper. The frontend carries a third copy, a TypeScript port, so every number on screen is either read from the chain or computed by an engine that matches the chain exactly, which is how the post-settlement replay can show a “matches chain” badge.

The mechanism is discretized adaptive clinching (Dobzinski, Lavi and Nisan 2008) with the AMM chord target and two-sided routing from arXiv 2610.36629. Prices are WAD fixed point over raw token units. The continuous price clock becomes a geometric ladder, capped so that every bidder’s limit lands exactly on a step, which the proportional exit rule needs. For the hook, the “supply” at each price is the constant-product pool itself: we solve a quadratic for the chord target, the rightmost point where a line of slope p through the cumulative (allocated, paid) point still sits on or above the pool’s cost curve, with two branches to keep the sqrt numerically stable. Because buyers pay the top of each ladder step, the engine leaves about 0.9·ε of volume above the curve; rather than let that leak, settle swaps everything the dominant side paid as exact input in one swap inside unlock and shares the pool’s actual output pro rata, so the discretization surplus comes back to traders. Settlement tolerates v4 rounding and any protocol fee via a single pips inequality.

Check out the whitepaper at https://clinch-ur-token.vercel.app/whitepaper.pdf.

Uniswap v4 (Build with Uniswap track) is the foundation and it shaped the design. The hook claims only three permissions: beforeInitialize so pools exist only through the hook, beforeAddLiquidity restricted to full range so the pool is exactly x·y = k, and beforeSwap that admits only the hook’s own settlement swap, which is what makes the batch guarantees hold between order and settle. Pools are fee 0 and ERC20 only because a fee breaks the chord geometry. The launch factory initializes a full-range pool at √P_X96 = √(price·2^192) and reserves the pool key on the hook in the same transaction, which closed a griefing vector where someone pre-initializes all 32 candidate tick spacings for a pair. Contract-level work bounds keep every accepted configuration under a 30M-gas block: (4·depth·1e14/ε + orders)·orders ≤ 10,000 for the hook, (ladder steps + maxBids)·maxBids ≤ 12,000 for the launch. A 32-order batch settles in 1.38M gas; the six-bidder demo launch took 99 steps and 3.68M. Our FEEDBACK.md records time-to-first-hook and the three doc gaps that cost us the most: the fee-0 constraint interaction, the hook address mining workflow, and swapping inside unlock from a hook’s own settle path.

World ID (Best Use of IDKit track) went in as a token rather than a gate. HumanGate is hUSDC, a 1:1 USDC voucher only a verified human can mint, capped at 2,000 USDC per nullifier for life and transferable only to registered venues, so the cap lives in the money and cannot be split or lent. World ID 4.0 has no verifier contract on Ethereum Sepolia, so we route IDKit 4.6 Proof of Human through an RP-signed request (key never reaches the browser), verify at the Developer Portal, and have the server sign (chainId, verifier, signalHash, nullifier, externalNullifier) for an AttestedWorldID contract; the one-wallet-per-nullifier rule is enforced on chain regardless, and on a chain with the router the same gate takes verifyProof directly. Tested on Sepolia with real staging Proof of Human proofs: success path, same identity on a second wallet refused, replayed attestation reverts, OverCap and NotTransferable rejections.

The Ethereum Foundation’s Anon-RPC (Best Use of Anon-RPC track) covers the leak the mechanism cannot: an auction is only neutral if nobody can see who is about to bid, and every “price if settled now” read tells an RPC provider which address is watching which sale. Reads route through @anon-rpc/browser-harness when a specifier is configured, with an honest unavailable state otherwise. The rest of the CROPS story is in the contracts: no admin keys, permissionless settle and cancel, no trackers or analytics in the client, and a keeper you can kill without the market noticing.

The app is Vite, React 18, TypeScript, wagmi v2, viem v2, Tailwind v4, with a WebGPU shader hero and a Paper Shaders fallback. On public chains all reads go through Multicall3 so a page’s values come from one block even behind a load-balanced RPC. The optional keeper (app/scripts/keeper.ts) scans hook logs in chunks because free-tier providers cap eth_getLogs at ten blocks, and prints only the RPC host because provider URLs carry API keys.

Hacky bits worth admitting: contract creation on Sepolia cost far more gas than forge’s local estimate, so deploys run with --gas-estimate-multiplier 1000, and the CREATE2 search for a hook address with the right permission bits needs --disable-block-gas-limit during simulation. An internal review turned up eight liveness issues (settle not fitting a block, liquidity removal mid-batch, tiny pools, slot griefing via ineligible orders, and so on); each is fixed or documented and pinned in test/Regression.t.sol. The one thing we refused to hack around: a certificate-only verifier for big launches would have been cheaper, but Lemma 4.12 certifies efficiency only and would quietly break sybil-proofness, so large launches wait for a multi-transaction ladder instead.

background image mobile

Join the mailing list

Get the latest news and updates

Clinch | ETHGlobal