DEV Community
Follow
Building ClearAudit: evidence-gated USDC settlement on Arc
ClearAudit is a settlement rail designed for situations where traditional trust mechanisms fail, ensuring secure custody and verifiable payouts. It comprises an Arc vault for secure escrow, an Arkiv system for expiring public fingerprints, and a Next.js application layer that enforces a fail-closed gate before wallet interaction. The system requires three key properties: non-redirectable custody, an un-trust-dependent payout justification, and a time-limited retention window for sensitive artifacts. ClearAudit maps these requirements to Arc for custody, Arkiv for expiring fingerprints, and the application gate that links them.The Arc vault, specifically BountyVault v4, is immutable and uses Arc USDC as the settlement token, with a fixed arbitrator address. Deals can be created in three modes: as a named payee escrow, an open task for the first claimant, or a contest with an arbitrator awarding shares. The vault contract ensures distinct roles for funder, payee, and arbitrator, and funds are only pulled after the deal row is written. ClearAudit's architecture maintains a separation between the Arc product and the Ethereum Foundation (EF) research artifact on chain 1337, with no state or value transfer between them.Sensitive artifacts like exploit recovery proofs are stored as a fingerprint on Arkiv, with the vault storing a hash that the application layer must keep consistent. The vault's release function refuses payouts without live evidence, relying on the Arkiv fingerprint for verification. After a challenge window, a settleAfterChallenge function allows payment if evidence remains live and no dispute occurred. The Arkiv fingerprint is temporary, expiring after 30 days and becoming un-served by the storage layer.The application gate acts as a fail-closed mechanism, refusing to prompt a wallet signature unless an independent check against Arkiv passes, ensuring that no payout occurs without a matching, live, and unexpired evidence fingerprint. This gate verifies deal details against the Arkiv report, including payer, payee, amount, and a criteria hash. The frontend, built with Next.js, provides interfaces for managing deals, claiming rewards, and publicly re-running the evidence check via the /evidence route. An additional EIP-8141 path demonstrates gasless transactions on the EF alt-mempool, separate from the main Arc product.