Inspiration
Shipping demurrage is a massive, archaic financial black hole. When cargo vessels are delayed at port, they rack up steep penalties ranging from $10,000 to $30,000 per day. Yet, the multi-billion-dollar maritime industry still relies on manual, weeks-long reconciliation, exhaustively cross-referencing complex charter party legal contracts with port Statement of Facts (SoF) logs and vessel timestamps.
We built AnchorClaim for NTU InnovateX Hackathon 2026 (Track 1: Payments & Financial Infrastructure; Track 2: AI Agents & Real-World Use Cases) to eliminate this multi-week capital deadlock by fusing the autonomous reasoning of AI Agents with the trustless settlement guarantees of Web3 smart contracts.
What it does
AnchorClaim is an AI-powered maritime audit agent and on-chain escrow settlement engine that transforms weeks of demurrage dispute resolution into a verifiable, second-scale automated pipeline:
parse contract (step 1) -> calculate demurrage (step 2) -> settle on-chain (step 3)
Autonomous Legal Parsing (Step 1): The Voyage Sentinel agent uses a local LLM (qwen2.5 via Ollama) to extract laytime allowances, demurrage rates, and suspension/exclusion clauses (e.g., bad weather, strikes) from charter parties into structured JSON, backed by an instant regex fallback.
Deterministic Laytime Audit & AIS Cross-Check (Step 2): Computes net laytime by deducting contractually excused suspension hours (e.g., deducting 6h of weather delays for MV Ocean Star), cross-checks port logs against actual AIS in-port tracking hours, and calculates the exact penalty owed.
Trustless On-Chain Settlement (Step 3): Writes an evidence hash and penalty calculation to the AnchorClaimEscrow.sol smart contract via Web3.py. The contract automatically deducts the demurrage penalty and releases the remaining balance. If AIS data contradicts port logs (e.g., MV Delta Spirit), auto-settlement is blocked and routed to manual review.
Persistent Audit Caching & Fleet Search: Audit results are cryptographically hashed by voyage inputs and cached to disk (.cache/) for instant retrieval on repeat views. Editing contract terms automatically invalidates the cache, while a real-time fleet console allows filtering by vessel name, IMO number, or port.
How we built it
We engineered a modular, production-ready Python and Solidity architecture:
Step 1 — LLM Contract Parser (agent/step1_parse_contract.py): Powered by local Ollama (qwen2.5) to extract legal parameters into structured data, with a built-in regex fallback for zero-dependency mock mode.
Step 2 — Calculation & AIS Telemetry Engine (agent/step2_calculate.py): Deterministically deducts laytime suspensions, calculates financial penalties, and cross-checks stated port hours against AIS tracking logs.
Step 3 — Web3 Settlement Engine (agent/step3_settle_onchain.py): Integrates Web3.py to submit cryptographic attestations and invoke payout functions on AnchorClaimEscrow.sol.
Full Pipeline & Caching Engine (agent/audit_pipeline.py & agent/cache.py): Ties the three steps into an end-to-end pipeline with SHA-256 disk caching, supporting automatic cache invalidation and forced re-runs (?refresh=1).
Web API & Console (backend/server.py & frontend/index.html): A lightweight Flask API that powers an English light-mode web console. Every figure displayed in the UI is computed live via /api/audit/, guaranteeing zero hardcoded presentation data.
Smart Contract Layer (contracts/AnchorClaimEscrow.sol): EVM smart contract holding deposited voyage security bonds and executing attestor-gated disbursements.
Challenges we ran into
Bridging Probabilistic AI with Deterministic Financial Settlement: LLMs can hallucinate parameters. We enforced a strict JSON schema extraction layer combined with deterministic Python calculations, ensuring the on-chain settlement receives exact mathematical proofs rather than unstructured model outputs.
Detecting Telemetry Discrepancies & Fraudulent Logs: To prevent claims based on falsified Statement of Facts (SoF) logs, we implemented safety gating: when stated port logs diverge significantly from AIS physical tracking (like in our MV Delta Spirit test case), the system halts automated execution and flags the voyage for dispute review.
Zero-Latency Repeat Views with Safe Invalidation: Running full LLM inference on every UI click adds unnecessary overhead. We implemented a deterministic SHA-256 input-hashing cache that survives server restarts, serves cached audits instantly, and automatically purges whenever contract terms are edited.
Accomplishments that we're proud of
Unified Single Source of Truth: The Flask Web UI, CLI commands (audit_pipeline.py), and API endpoints all consume the exact same underlying Python engine, every metric is computed live.
True Dual-Track Hackathon Execution: Solved both Financial Infrastructure (trustless escrow cutting locked capital from 30+ days to seconds) and AI Agents in the Real World (local LLM contract comprehension and multi-source telemetry verification).
Zero-Setup Out-of-the-Box Experience: Designed the entire pipeline with intelligent fallbacks, judges and developers can clone and launch the full web demo in seconds with standard Python, while retaining the ability to switch on live Ollama and EVM nodes with a single .env toggle.
What we learned
Legal maritime charter parties contain intricate laytime exceptions (e.g., shifting weather conditions, port congestion, strike clauses) that require structured extraction prompts to achieve reliable parameter identification.
Real-world DeFi utility thrives when smart contracts are paired with autonomous off-chain agents that can ingest, verify, and attest messy physical supply chain data.
What's next for AnchorClaim
Live Satellite AIS Stream Ingestion: Connect the pipeline to live streaming AIS APIs (such as AISStream) for continuous real-time vessel monitoring before docking.
Autonomous Dispute Mediation Briefs: Extend the agent pipeline to automatically generate legal dispute packets and compromise proposals whenever AIS data and port logs flag a discrepancy.
Layer-2 Rollout: Deploy AnchorClaimEscrow.sol onto low-latency, low-fee Ethereum L2s (e.g., Arbitrum, Base) to support high-frequency, micropayment-level demurrage adjustments for global fleet operations.
Built With
- flask
- javascript
- llm
- ollama
- python
- qwen
Log in or sign up for Devpost to join the conversation.