Codemark

Before you sign, see which team released a contract under its ENS name and whether it was withdrawn.

Codemark

Created At

ETHGlobal Mumbai

Project Description

A wallet shows you 20 bytes and asks you to sign. In February 2025, Bybit's Safe signers approved a transaction that handed their wallet to an attacker's contract, because the page that built it had been swapped. Nothing on the signing screen could say "your team never released this code." EIP-7702 raises the stakes: one signature can let a contract control a whole account.

Codemark puts that answer in front of you before you sign. Teams release contracts under their ENS name, such as router-3-1-0.ci-1.pwnmeswap.eth. The Snap or MCP server reads the transaction itself, finds every contract it touches, including approval spenders and calls nested inside batches and Safe transactions, and checks each one against the publishers you pinned.

You get a plain answer: Verified, Released recently, Not verified or Don't sign. Below it is the trust path: publisher, release key, release, record, age. The first step that fails is marked in red, so you can see why.

If a release key leaks, one transaction withdraws everything that key released. Every check after that shows Key revoked. There's no list of wallets to notify and no server to update.

The same check runs in three places:

  • Lookup site: paste an address or try the demo contracts. No wallet or sign-up.
  • MetaMask Snap: checks each transaction before MetaMask asks you to confirm. It needs MetaMask Flask for now.
  • MCP server for AI agents: nobody reads the signing screen when an agent signs, so the server returns proceed, ask_user or refuse. It holds no keys and signs nothing.

Teams publish with a CLI or a GitHub Action, and there's no Codemark contract to deploy or audit. pwnmeswap.eth is live on Sepolia as a demo publisher, so you can check its releases today.

What to know before relying on it: Codemark tells you who published a contract and whether they still stand behind it, not what the code does. Pinning the real name is what protects you from imitators. The MCP server helps an honest agent that was handed a bad address. It doesn't check amounts or recipients, and a hijacked agent could skip it. Codemark runs on Sepolia today.

How it's Made

Codemark is a Bun monorepo in TypeScript. One checker package (packages/lib/shared, built on viem and zod) runs everywhere: in the browser for the React site, in the MetaMask Snap sandbox, in the CLI and in the MCP server. There is no Codemark server and no custom Solidity. The site is static and reads Sepolia and Arkiv directly from the browser.

ENSv2 (Sepolia) is what makes this work:

  • Registries: a publisher is a .eth name owned by a team Safe, registered through ETHRegistrar with MockUSDC. Each signing key is its own UserRegistry mounted under that name, so a key is a subtree. One unregister ends every name below it. On ENSv1, deleting ci-1.pwnmeswap.eth leaves router.ci-1.pwnmeswap.eth resolving.
  • Enhanced Access Control: the CI key holds only ROLE_REGISTRAR on one key registry, so it can add releases but not change or remove them. The security key holds only ROLE_UNREGISTER, so it can withdraw but not publish. Only the Safe can publish to the delegates key, where account-upgrade code lives.
  • Permissioned Resolver: every release gets its own resolver through VerifiableFactory, created with its records and with setter roles for the Safe only. The checker proves the CI key can't rewrite a release: the resolver must be a genuine factory proxy running the expected implementation, its logs since creation must show no record, role or upgrade changes, and the Safe must be the only role holder.
  • Universal Resolver: findResolver returning an offset other than 0 means the name has no resolver of its own (unregistered, pulled or under a cut key), and it's rejected.
  • Expiry: a key's 90-day TTL bounds everything below it.

Arkiv (Rabdi testnet) solves what ENS can't: ENS can't be searched by address. We write two entity types with @arkiv-network/sdk: codemark.release.v1 from the CI key and codemark.incident.v1 from the security key. The site reads them to find which publisher claims an unknown address, to list a publisher's releases, to explain why a release was withdrawn (a pulled name otherwise looks like it was never published) and to get the block numbers where the log scan starts. Rows are untrusted. A row only counts if its creator holds the matching role in ENS, every claim is re-derived from ENS at one pinned block, and a flooded index can never produce a green result.

MetaMask Snap: onTransaction and onSignature decode the request and show the same verdict and trust path as the site. Anything but a pinned, proven release that's old enough is critical for an account upgrade, which makes MetaMask ask for a double confirmation.

MCP server: code maps the checker's result to proceed, ask_user or refuse, so the model doesn't decide. A check that doesn't finish refuses. Trusted publishers come only from the operator's config and no tool can add one, so a prompt-injected agent can't talk its way into trusting an attacker. Publisher-written text is treated as model input: an unpinned publisher's reason is dropped.

The hacky parts:

  • Sepolia has two ENSv2 deployments side by side. We use the one the canonical Universal Resolver actually reads, and the checker re-reads ROOT_REGISTRY() at the start of every check and refuses to run if it changes.
  • The deployed contracts differ from the repository head, so our ABIs are pinned to contracts-v2 commit 07e55a05 and the checker's end-to-end tests run on an Anvil fork of Sepolia rather than mocks. An attack script publishes five forged releases that the checker must report as MISMATCH.
  • Token ids change on every register and role change, so releases are keyed by labelhash and the current id is read from the registry.
  • Pulling a release also reserves its labels, so a CI key can't simply re-register them.

CI runs typecheck, lint and tests on every push, plus a job against live Sepolia that confirms the Universal Resolver still reads this deployment. The releases are public: browse explorer.ens.domains/pwnmeswap.eth, and the README lists every transaction and shows how to read the records with plain viem and no Codemark code. A real withdrawal is live too: check 0x65aF9C81B6351c61F3657D47Ef29AEA319B7DAE5 on the lookup page and it says Don't sign, with the reason read from its Arkiv incident row. The router and portal under the same key still verify.

The landing page footer is one WebGL scene driven by scroll, with a fox (your wallet, such as MetaMask) running past verified contracts and leaping revoked ones.

background image mobile

Join the mailing list

Get the latest news and updates