tocsin

Open standard for onchain registry of scam address reports, verified on your device before you sign

tocsin

Created At

ETHGlobal Mumbai

Project Description

Every wallet decides whether an address is dangerous by asking a company. Some keep their own list; most pull from Etherscan, Blockscout, Blockaid, ScamSniffer, etc. over an API. The user cannot verify the answer, and the company learns every address the user checks. Devcon 8 is full of talks about light clients and anonymous RPCs because access to Ethereum is still centralised. Security is the part nobody solved yet.

Tocsin is an append-only log of scam infrastructure that lives in Ethereum state. It has no owner, no pause, no upgrade, and no delete. Anyone appends flags, but only into their own namespace, and the contract hashes every flag into the writer's chain so nothing can be removed or rewritten. The log never says who to believe. A trust list, signed by whoever maintains it and published under an ENS name, says which writers count. A wallet pins the lists it wants. One listed writer warns, two independent writers block, and the user can always override on the device.

The wallet reads it without trusting anyone. Helios verifies the state root, one storage proof covers the writers the user's lists name, the entries come from any mirror and are replayed against the proven head, and every address check runs locally. All execution reads go through the EF's Anon-RPC worker, so the RPC can neither lie nor learn what was looked up. In the demo the RPC says "clean"; the wallet catches the chain mismatch, pulls the same entries from a mirror it does not trust either, and blocks anyway.

We do not chase throwaway lookalike addresses, which a local prefix check handles better. We remember what attackers reuse for years: the operators that plant dust, the funders behind them, drainer receivers and spenders, malicious delegates, and malicious tokens. A flag costs its writer about half a cent. Readers pay nothing.

There is an ERC draft, "Append-Only Threat Flag Log", that specifies the log, the entry format, the trust lists, and the read procedure. The log runs on Sepolia. Trust lists live as ENSv2 subregistries. The wallet does the whole read path through Helios and Anon-RPC. All of it is open source, MIT for the code and CC0 for the ERC.

How it's Made

The contract is Solidity, built with Foundry inside Scaffold-ETH 2. It stores no flags. Each writer gets a head and a count at a fixed storage slot, and an append folds the new leaf hash into the head, so a reader proves a writer's whole history with one storage proof. We deploy with CREATE2 through the deterministic deployment proxy, salt zero, so the address is the same on anvil, Sepolia and mainnet. It is live on Sepolia with 92 seeded leaves under the maintainer key and one under the detector's. The tests cover normative cases 1 to 9 from our ERC draft, the signature and ERC-1271 boundaries, fuzzed batches, a replay invariant and a gas snapshot that puts a flag in a 100-leaf batch at 9,865 gas. We also wrote ERC-7730 clear-signing descriptors for both write functions, append and appendSigned.

The wallet side is one TypeScript reader built on viem, copied into both hosts. It proves the heads of the pinned writers against a state root, pulls their entries with eth_getLogs from any source, replays the hash chain from a checkpoint and checks addresses on the device. If the logs don't hash to the proven head it returns unverifiable, never clean. Trust lists are EIP-712 documents signed by a maintainer and published as a text record under an ENS name. The reader finds a record with one eth_call to the Universal Resolver, CCIP-read off, so a host can route it through its light client, and it pins the maintainer on first use. One listed writer warns and two independent writers block. The hub itself is on ENSv2 Sepolia, set up with ensjs 5: tocsin.eth owns an emancipated subregistry, so nobody can revoke a claimed name, and a MirrorRegistrar lets whoever owns label.eth claim label.tocsin.eth in one transaction. A hot key may set only the list record, through ENSv2's text-record roles. Three lists ship by default: our own core.tocsin.eth and two curator lists.

Two hosts use the reader. Kohaku, the EF privacy wallet, is the primary one and ships as two patches on a pinned upstream clone, so the repo holds no Kohaku source. A TocsinController in kohaku-commons checks the send recipient, the spenders and EIP-7702 delegates in sign-account-op, the permit spenders in sign-message, and the token contract itself, so a malicious token blocks Send whatever the recipient. A Tocsin page in Settings holds the RPC and the sync. The MetaMask Snap uses transaction and signature insights to check recipients, spenders, Permit2 and EIP-2612 spenders, Uniswap swap recipients and token contracts, and raises MetaMask's critical warning on a match. The Snap reads proofs from a configured RPC.

The hacky part is the Anon-RPC wiring in Kohaku. We fetch the Anon-RPC worker through a mainnet Helios, a16z's light client, so it checks the worker's hash against the on-chain specifier before we load it. Then we shim globalThis.fetch so the reads go through the worker over Tor. The RPC never learns which addresses you check. The worker lives in an offscreen document, the service worker relays its fetches over a named port, and the harness's isolation frame is a manifest sandbox page because the extension CSP blocks the inline one. Every Tocsin read goes through the worker, and Kohaku's own balance, gas and bundler reads stay direct on purpose. Kohaku takes the header and proofs from one RPC for now, so a lie about the head is only as detectable as that RPC is honest, while a lie about the entries still fails replay. Nym has a switch and no test yet.

For the demo we built a seed script, a relayer, a detector, a lying RPC proxy, a snapshot mirror and a one-button demo board. The detector is an automated writer with its own name, detector.tocsin.eth, and its own list. It flags the operators behind address-poisoning dust, applies the ERC-4337 sender rule, and its live mode found two real sprayers in a 40-block scan of mainnet. Point the wallet at the lying proxy and it says "unverifiable, chain mismatch at sequence N". Pull the same entries from the mirror and the block comes back. All three beats were verified in Kohaku on 6 November with no direct RPC request leaving the service worker, and one script starts the Tor gateway, the static site and the lying proxy. A walkaway test deletes our ENS records, list host and mirror, and the built Snap still blocks the seeded drainer.

background image mobile

Join the mailing list

Get the latest news and updates