shankh

Catch a malicious package once, warn every machine running it, via an alarm on ENS and Arkiv

shankh

Created At

ETHGlobal Mumbai

Project Description

Shankh checks installed Python packages against their public source, and lets the real maintainer flag a bad build on ENS and anyone who catches one post a signed alarm on Arkiv. Every machine sweeps both, compares locally, and re-checks what it hears. Live on Sepolia and the Arkiv testnet; automatically switching stolen keys off is next.

How it's Made

CLI (shankh/, Python + Typer): reads installed files and hashes from pip's RECORD, fetches the source archive from PyPI's JSON API, and diffs them. ENS reads shell out to Foundry's cast through the ENSIP-10 resolve() path. Arkiv reads and writes go through a small TypeScript bridge to @arkiv-network/sdk. 34 tests. ENSv2 on Sepolia (scripts/ens/): shankh.eth registered via commit-reveal; pypi.shankh.eth and reporters.shankh.eth are PermissionedRegistry proxies with their dangerous root roles revoked (emancipated). Each package has its own PermissionedResolver where the maintainer can only write shankh.source and only its KillSwitch can write shankh.revoked (key-scoped setter roles). KillSwitch.sol (Foundry): instant revoke(build), 48-hour timelocked un-revoke, syncs the resolver's text record on every change. Arkiv (arkiv/): shankh.report entities with indexed package, version, tier, build fingerprint and ENS flag; reads filter by the chain-recorded creator, never by package. Landing page (status-page/, Next.js on Vercel): server-rendered on every request, every live read capped at 4 seconds so one slow network can't hang the page. The hard parts:

Identifying a build. We first flagged builds by the source archive's hash, then realised the LiteLLM poison was in the wheel next to a clean source archive, and an installed package doesn't remember which file it came from. We now fingerprint the installed files themselves, so a maintainer flags exactly what people installed. Emancipation that actually holds. ENSv2's isEmancipated() can read true while upgrade roles are still held. We took the real role bitmap from verified source, rehearsed on an Anvil fork (which caught a wrong bitmap before it touched Sepolia), and proved the lock by attempting a re-grant that reverts. Privacy. Looking up one package on ENS tells the RPC provider what you have installed, so shankh scan fetches every package's list from the registry's own events and compares locally. The same rule applies to Arkiv: reads are by reporter, never by package.

background image mobile

Join the mailing list

Get the latest news and updates