ASM-Endersift

An AI agent that finds data sellers via ENS, pays them on Hedera and analyses the results on 0G.

ASM-Endersift

Created At

ETHGlobal Mumbai

Project Description

Endersift is an autonomous threat-intelligence agent that buys the data it needs from other agents, pays for each request on its own, and keeps a public record of every payment.

You give it a task, for example "check OpenSSL and lodash@4.17.21 for known vulnerabilities". The agent then works through these steps:

  1. Discover sellers on ENS.Three data providers are registered as ENSv2 subnames of chirag126.eth on Sepolia:

    • kev: the CISA Known Exploited Vulnerabilities list
    • cve: NVD CVE records
    • osv: the OSV open-source vulnerability database

    Each subname's text records publish what the provider sells, its endpoint, its price and its Hedera payout account. The agent reads these from the chain at run time, so nothing is hard-coded. Changing a record changes what the agent finds. Each provider and the agent also have an ERC-8004 identity.

  2. Plan with 0G. A model on 0G's mainnet Private Computer reads the task and the discovered catalogs. It decides which data to buy and returns its plan as schema-checked JSON. Every 0G call is capped at a worst-case cost before it is sent, and a ledger compares the agent's records with 0G's own billing.

  3. Pass the spending firewall.Before any money moves, a deterministic policy checks each purchase against limits per payment, per run and per day, and against a cap on the number of payments. The AI's output can't override it, and a purchase outside the limits is refused.

  4. Pay on Hedera with x402. Providers answer with HTTP 402 Payment Required. The agent signs an HBAR payment on Hedera testnet, a facilitator settles it, and the agent checks the settled transaction on the Mirror Node before trusting the data. Every payment is a real transaction you can open on HashScan.

  5. Analyse with 0G.The model turns the purchased data into a short security brief: which vulnerabilities matter, whether they are actively exploited, and what to do.

  6. Audit on Hedera Consensus Service. Each run's key events (plan, payments, result) are written to an HCS topic. Anyone can check them independently.

The web app shows the whole run live: discovery, plan, payments, verification and the final brief. It also has pages for payments, 0G usage, ENS permissions and evidence, a 7-day activity overview, voice input through Whisper on 0G, and three visual themes. The agent runs unattended too, producing a daily brief for a watchlist within a fixed budget.

Each track has a distinct role:

  • ENS- is how agents find each other and what they offer.
  • Hedera- is how they pay and prove what happened.
  • 0G-is where the agent's reasoning runs.

Remove any one of them and the system can't work. Every claim in the project is backed by on-chain evidence: Hedera transaction IDs, HCS messages, Sepolia transaction hashes and 0G request IDs.

How it's Made

Endersift is a TypeScript monorepo managed with pnpm. It runs on Node 22 using Node's built-in TypeScript type stripping, so the server runs its source files directly with no build step. Tests use node:test.

Structure:

  • apps/server: the agent. A Hono API, the task orchestrator, the scheduler for daily briefs, a SQLite database, and server-sent events that stream every step of a run to the browser.
  • apps/providers: three x402-protected data sellers (kev, cve, osv) that proxy CISA KEV, NVD and OSV.
  • apps/web: a React + Vite app with three themes, live run timelines and simple bar charts built from plain HTML elements.
  • packages/hedera, packages/ens, packages/zg, packages/policy: one package per integration, so each can be tested on its own.

Hedera: We use the official Hiero SDK (@hiero-ledger/sdk) and the x402 packages. A provider answers 402 Payment Required with its price. The agent's x402 client signs an HBAR transfer on Hedera testnet, and the Blocky402 facilitator settles it, with x402.org as a fallback. The agent doesn't trust the facilitator's answer on its own. It looks up the settled transaction on the Hedera Mirror Node and checks the payer, receiver, amount and success status before using the data. Payments go through an explicit state machine (quoted, approved, signed, settled, verified, failed), so a crash halfway never pays twice. Every run also writes plan, payment and result messages to a Hedera Consensus Service topic as a public audit trail. Hedera's fast finality and very low fees are what make per-request micropayments practical.

ENS: Providers are ENSv2 subnames of chirag126.eth on Sepolia. Their text records publish the service description, endpoint, price, payout account and an ERC-8004 agent ID. We use viem to discover them: read the registry's logs for subnames, then resolve each record through the Universal Resolver. The resolvers are PermissionedResolvers, and an operator key is allowed to change only specific records. We tested this on-chain: allowed edits succeed and forbidden ones revert. A provisioning script sets everything up, and changing a record really changes what the agent finds on its next run. Discovered endpoints and records are treated as untrusted input and validated before use.

0G: All AI runs on 0G Private Computer mainnet through the 0G Router (OpenAI-compatible). It uses 0gm-1.0-35b-a3b, with qwen2.5-vl-72b-instruct as a fallback, plus whisper-large-v3 for voice tasks. The planner and analyser use structured output: we turn zod schemas into JSON Schema with z.toJSONSchema, and any reply that doesn't match is rejected. Before each call we reserve its worst-case cost against per-call and daily caps. An inference ledger then compares our records with 0G's own usage history, so every request ID and its cost can be checked. Running on 0G means the model can't be quietly swapped, and every call has a billed, traceable ID.

Safety: The spending firewall in packages/policy is plain deterministic code: per-payment, per-run and daily limits plus a cap on payments per run. The model's output can propose purchases but can never override the firewall. Secrets are only in environment variables, are checked against a spec at startup and are redacted from logs. The ENS admin key and the 0G management key are never deployed. Access to the demo is protected by a code, with signed stateless sessions.

Deployment: Both services run on Render's free plan in Singapore. GitHub Actions runs type checks, linting, tests and a secret scan on every change.

Hacky bits worth mentioning:

  1. Render's free services sleep after 15 minutes. When the agent called a sleeping provider host from the server, it got HTTP 429 and the host never woke. A request from a real browser does wake it. So the web app wakes the provider host from the visitor's browser by calling its /health endpoint, which is allowed through a tightly scoped Content Security Policy. Meanwhile the agent waits up to 3 minutes per host before giving up.
  2. The free plan has no disk, so the database is wiped on every restart. Logins survive restarts because sessions are stateless HMAC-signed tokens derived from the access code. The evidence that matters lives on-chain anyway: on Hedera, HCS, Sepolia and in 0G's billing.
  3. Alchemy's free tier limits log queries to about 10 blocks. Our discovery uses adaptive log windows, which turned into thousands of requests on Alchemy. We switched to RPC providers that allow wider ranges.
  4. Every claim in our evidence files is produced by scripts from real transactions, never written by hand.

Tools: We built the project with Claude (Anthropic) through Claude Code as a coding agent, working in small reviewed pull requests. The AI usage section of the README describes this in detail.

background image mobile

Join the mailing list

Get the latest news and updates

ASM-Endersift | ETHGlobal