Skip to content

ivanvolov/mil-fi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MilFi

AI-verified drone kills settle instantly on Hedera, gated by World ID human-backed agents.

A civilian spotter reports a threat → a 0G-hosted vision agent judges whether it's real → a defense unit intercepts it → a second 0G agent judges the intercept from post-strike imagery. Every hash and verdict is written to an immutable Hedera Consensus Service log, and a settle-agent built on the Hedera SDK reads that log and autonomously transfers DEFPOINT tokens to the unit's Hedera account — seconds, not months. Before paying, the settle-agent asks World's AgentKit whether the paying agent is backed by a real, unique, verified human; if not, the payout is refused. It sits on top of an air-defense coordination map we already run operationally at our own counter-UAV contracting company in Ukraine.

Live demo: https://mil-fi.onrender.com World Mini App (Selfie Check / AgentKit flows): https://worldcoin.org/mini-app?app_id=app_3e54fa415d153fbd5fd72033452b27f8

Full story, architecture, and per-sponsor requirement mapping: docs/ — start at docs/01-story.md.

Bounty evidence — at a glance

Sponsor Requirement Status Evidence
Hedera Autonomous agent payment on Testnet, HashScan link ✅ Done Payment flow below
Hedera ≥2 native services (HTS/HCS/Mirror Node/Scheduled) ✅ Done HTS (DEFPOINT) + HCS (evidence topic) + Mirror Node reads
Hedera Zero Solidity ✅ Done grep -r "\.sol" . → no hits
0G Inference actually runs on 0G Compute ✅ Done Real router calls, not OpenAI — 0G section
0G TEE-sealed inference ✅ Done (as of this run) OG_API_KEY_TEE (Private trust mode) now wired as the priority key in platform/server/src/config.ts
0G Proof-of-inference artifact ✅ Done Console screenshot + request/trace ids, see below
0G Contract addresses N/A by design No contracts deployed — the whole project is smart-contract-free (No-Solidity constraint); the on-chain trail is Hedera (HTS 0.0.9753000, HCS 0.0.9753001). Agentic ID is only required for Agentic-ID projects, which this is not
World AgentKit gates payout, negative case works ✅ Done Agent registered in AgentBook on World Chain (tx) + 402/403/authorized smoke — World section below
World Selfie/Identity Beta feedback doc ✅ Done docs/02-bounty/world-submission.md — Selfie + AgentKit sections
All Video (2:00–2:59) ✅ Done Submitted with the ETHGlobal form

Repo layout

  • platform/ — pre-existing air-defense coordination map (React + Fastify + MongoDB), declared as the pre-hackathon "starter" base per the Start Fresh rule. The Settlement Console, ledger panel, 0G verification agents, Hedera journal/settle-agent, and World payout-authorization wiring are new — built during the hackathon window. See platform/README.md.
  • verification/ — standalone 0G Compute vision-inference harness used to prototype Agent A/B before they were wired into platform/server. See verification/README.md.
  • app/ — World identity / AgentKit mini-app (Next.js). See app/CLAUDE.md.
  • docs/ — story, architecture, integration contract, submission checklist, validation evidence (07-validation.md), business model & roadmap (08-business-model.md), and planning artifacts (AI-tool attribution lives here too — see below).

Payment flow — live, verifiable on Hedera testnet

The settle-agent is built directly on the Hedera SDK (@hashgraph/sdk) — no Solidity, no smart contracts. When an engagement completes, it reads the evidence journal via Mirror Node, applies the government-set payout rule, checks World human-backing, and fires the HTS transfer itself — no human approves the transfer.

Everything below is a real testnet run, not a mock — click through and check it yourself:

What HashScan link
DEFPOINT token (HTS) https://hashscan.io/testnet/token/0.0.9753000
Evidence journal (HCS topic) https://hashscan.io/testnet/topic/0.0.9753001
Autonomous payout — engagement eng-7e26d38e4e (100 DEFPOINT, no human in the loop) https://hashscan.io/testnet/transaction/0.0.9713724-1785028775-015957706
Paying unit's account https://hashscan.io/testnet/account/0.0.9760875

Journal entries for that same engagement, in HCS sequence order (topic 0.0.9753001): report hash → seq 57, Agent A verdict → seq 58, downing recorded → seq 59, Agent B verdict → seq 60, payout receipt → seq 61. Each is independently fetchable from the public Mirror Node, e.g.:

curl https://testnet.mirrornode.hedera.com/api/v1/topics/0.0.9753001/messages/61
curl https://testnet.mirrornode.hedera.com/api/v1/transactions/0.0.9713724-1785028775-015957706

Negative case (World's required demo moment): a bot unit with no World identity submits the same claim → the settle-agent rejects it before any Hedera transfer is attempted ("no human backing (World)") — no transaction exists for that path because the agent refuses to spend.

World AgentKit — human-backed payout authorization

Before the settle-agent moves any money, the unit's claim-agent must obtain a signed payout authorization from the World service (Interface 1 in docs/04-integration-contract.md) — and that endpoint is gated by the real AgentKit protocol: HTTP 402 challenge → SIWE signature with the agent's wallet key → server-side verification → AgentBook lookup on World Chain. Details in docs/06-agentkit.md.

On-chain registration proof (AgentBook, World Chain mainnet):

  • Claim-agent wallet: 0xA07e1F5eC17363BFA5fEbf8c8682E9A48482ae00 (identity only — holds no funds)
  • Registration tx: 0xb9ec0636ab16b11ab7e40d08eda9761af1262282ed4f5085ed51de982bdff3dc (Blockscout mirror — the calldata visibly contains the agent address and the nullifier hash)
  • AgentBook contract: 0xA23aB2712eA7BBa896930544C7d6636a96b944dA
  • Verify yourself: AgentBook.lookupHuman(0xA07e…ae00) returns 0x2a81207095f2386480e0936b6d91e9b747d315f5ae9c80cafa70db618d5be — which is exactly the World ID nullifier hash of the human who approved the registration in World App. One registered human ⇒ one claim-agent ⇒ one payout stream; extra wallets all resolve to the same human or to nobody.

Three callers, three outcomes (cd platform/server && npm run agentkit:smoke, verified live):

  • bot (bare HTTP, can't answer the challenge) → 402 agentkit_signature_required
  • impostor (valid signature, unregistered key) → 403 not_human_backed — signature verified on-chain, AgentBook consulted, nobody home
  • registered claim-agent → signed authorization, backing=agentbook

Settlement-level evidence (the authorization actually gating Hedera money):

  • Human-backed unit → authorized → paid: engagement eng-658aeb98bf, World responded {"ok":true,"status":200}, settle-agent paid 100 DEFPOINT → https://hashscan.io/testnet/transaction/0.0.9713724-1785026085-018740608
  • Not human-backed → refused: engagement eng-6cd5ba5e58 completed the same World API round trip ({"ok":true,"status":200} — the call succeeded) but the response denied authorization ("no human backing"), so the settle-agent refused the payout — no transaction exists for it. This is the required negative case: the check isn't cosmetic, it genuinely gates whether money moves.

World Selfie Check — spotter eligibility, not login

Spotters are civilians on the front line reporting an incoming threat in real time — the entry point of the whole funnel. That report has to happen in seconds, from wherever they are, which rules out the two higher tiers as the eligibility bar: an Orb isn't reachable in a frontline city, and a passport-document check has too much friction for "I see a Shahed overhead right now." Selfie Check is the credential that's actually fast enough to require before a report counts — low friction for a legitimate spotter, but still enough of a bar to keep bots from flooding the system with fake reports.

So Selfie Check gates report:submit — no verified selfie, no report accepted — while payout release stays gated at Orb tier further down the pipeline (see the tier ladder in docs/03-architecture-bounty-map.md). That's an eligibility/abuse-prevention signal doing real access-control work, not a generic "login with World" screen. Full developer + user testing feedback for the beta: docs/02-bounty/world-submission.md.

0G Compute — verification agents

Agent A ("is this a threat?") and Agent B ("was it destroyed?") are calls to qwen2.5-omni hosted on 0G Compute's OpenAI-compatible router (router-api-testnet.integratenetwork.work), not OpenAI or a local model. The inference key is 0G's Private (TEE) trust mode, so the model runs inside a hardware enclave the caller can't see into.

Proof-of-inference for the same eng-7e26d38e4e run above — input photo, request id, and the raw verdict, so this is checkable without any 0G console access:

Agent A — input: verification/fixtures/drone2.jpg (report photo) · request id chatcmpl-a4702bf7-d056-4330-a97a-049edfa82e48

{ "is_threat": true, "classification": "shahed_class", "objects_seen": ["wreckage"],
  "confidence": 0.95, "reasoning": "The wreckage includes components consistent with Shahed-class drones." }

Agent B — input: verification/fixtures/drone.jpg (post-strike photo) · request id chatcmpl-a85cd209-bfdf-4332-aba5-c8573ee71b3f

{ "destroyed": true, "evidence_type": "wreckage", "consistent_with_prior": false,
  "objects_seen": ["fragment"], "confidence": 0.8,
  "reasoning": "The presence of wreckage suggests destruction, but the label indicates a different type of object than reported by Agent A." }

0G's own request-tracing fields. The id: "chatcmpl-..." above is the OpenAI-compatible field; 0G's router additionally returns its own internal trace object, which is what actually ties a call to the dashboard below:

"x_0g_trace": {
  "request_id": "eb96b28c-f360-4d35-a901-81e676964031",
  "provider": "0xa48f01287233509FD694a22Bf840225062E67836",
  "billing": { "input_cost": "13000000000000", "output_cost": "12000000000000", "total_cost": "25000000000000" }
}

Console Activity screenshotdocs/evidence/0g-activity-console.png. 38 real requests, 0.050883 0G total spend, qwen2.5-omni via provider 0xa48f…7836 — an exact match to the x_0g_trace.provider address above, directly linking this codebase's calls to this account's dashboard:

0G Activity console

Unlike Hedera, 0G Compute has no public, permissionless explorer for router requests — the console screenshot + trace ids above are 0G's own accepted proof-of-inference format for this kind of submission, not a self-serve link a judge can independently query.

On contract addresses: no contracts are deployed by design — the project is smart-contract-free end to end (the No-Solidity constraint applies repo-wide). The on-chain audit trail lives on Hedera (HTS 0.0.9753000, HCS 0.0.9753001). 0G's Agentic ID (an on-chain agent identity NFT) is only a requirement for Agentic-ID-based projects; minting IDs for Agent A/B is listed as future work in docs/03-architecture-bounty-map.md.

Network impact — what Hedera gets out of this

MilFi's unit economics are set by the war's arithmetic, and the arithmetic is large:

  • A lot of drones. Large Shahed raids against Ukraine now run into the hundreds of drones and decoys in a single night — and every one of them is a potential engagement: report, two agent verdicts, downing, settlement.
  • Thousands of transactions per raid night. One engagement writes ~7 Hedera transactions — five HCS journal messages (report hash, verdict A, downing, verdict B, receipt) plus the HTS payout, plus freeze/unfreeze on disputes. A single 300-drone raid night processed through MilFi is ~2,000+ Hedera transactions; a month of raids is tens of thousands. Rejected reports journal too, so traffic scales with reports, not just kills.
  • Accounts by construction, active by construction. Onboarding is Hedera account creation — every unit gets an account via AccountCreateTransaction (platform/server/src/hedera/token.ts), KYC-granted on the DEFPOINT token. Spotters and government operators follow the same path. And these are monthly-active accounts by design: the account is how a unit gets paid, so it's touched every engagement, not parked.
  • The value layer is already real. Ukraine's state-run e-points economy — the marketplace where units redeem points for drones, equipment, and weapons systems — is processing on the order of ₴150 billion (~$3.3B USD) in value. That marketplace redemption flow is exactly what DEFPOINT models: every credit and every redemption becomes a native HTS operation. MilFi is the settlement rail that moves that economy onto Hedera.
  • A new audience for Hedera. Defense contracting, state incentive programs, and critical-infrastructure protection are sectors with zero current Hedera presence — and every future conflict and infrastructure operator faces the same cheap-massed-drone problem.

The beachhead is us: MilFi deploys first on our own counter-UAV operations — our sites, our partnered units, our engagement volume — generating real Hedera traffic from day one, no external adoption required.

This isn't a hypothetical audience — our partnered units have already intercepted hundreds of hostile drones through operations coordinated on the platform this settlement layer sits on top of, and the submission video shows that hardware in the field. See docs/07-validation.md for the operational record and docs/08-business-model.md for how that beachhead turns into the ₴150B (~$3.3B USD) marketplace and the MoD's unit-budget restructuring.

AI-tool attribution

This project was built extensively with Claude Code (Anthropic) across all three components: 14 of the repo's 28 commits are Claude-co-authored. Planning artifacts, specs, and prompts used throughout the build live in docs/ and app/.claude/ — included in this repo, not hidden, per the event's AI-attribution rule.

Setup

Each component runs independently — see its own README for exact steps:

Releases

Packages

Contributors

Languages