Inspiration

The future of commerce isn't just digital—it's autonomous. As AI agents become increasingly capable of making economic decisions, we identified a critical gap: there's no trustless infrastructure for AI-to-AI financial transactions. Traditional payment systems require human oversight and trust intermediaries. We envisioned AutoTrust PayMesh as the Economic Operating System for autonomous AI agents, enabling programmable money flows with built-in escrow, negotiation, and streaming payment capabilities.

The MNEE hackathon challenged us to build real-world applications for programmable money, and we saw an opportunity to create the foundational layer for an entire ecosystem of AI-driven commerce.

What it does

AutoTrust PayMesh is a production-ready escrow settlement system built on the MNEE ERC-20 stablecoin. It provides:

  • Smart Escrow Contracts: Lock MNEE tokens with deterministic release/refund rules enforced by smart contracts
  • AI-Powered Verification: Multi-agent systems (Compliance, Operations, and Arbiter agents) autonomously verify transaction conditions using Groq's Llama 3.3-70b
  • Negotiation Sandbox: AI-to-AI price negotiation engine where agents haggle and reach consensus before executing transactions
  • Streaming Payments: Real-time, per-second payment streams for ongoing services (e.g., 0.05 MNEE/sec)
  • Complete Audit Trail: Backend indexer captures all on-chain events with an Ops Log API for full transparency
  • Production Deployment: Fully containerized services deployed on Google Cloud Run with live demo URLs

How we built it

Smart Contract Layer (Solidity 0.8.24)

  • Implemented MNEEEscrow.sol with OpenZeppelin's battle-tested libraries
  • Built a rigid state machine (Funded → Locked → Release/Refund) preventing invalid transitions
  • Integrated reentrancy guards and pausable functionality for security
  • Native MNEE token integration with streaming payment logic

Backend Intelligence Layer (Node.js/Express)

  • Integrated Groq API (Llama 3.3-70b-versatile) for ultra-low latency AI inference
  • Built RAG (Retrieval Augmented Generation) system with specialized knowledge base for policy enforcement
  • Created multi-agent orchestration managing Compliance, Operations, and Arbiter agents
  • Implemented event indexer using ethers.js v6 to capture and serve transaction history

Frontend Console (Next.js 14)

  • Built with wagmi v2 and viem for robust Web3 integration
  • Implemented dark/light themes with i18n support (EN/ES)
  • Created real-time balance tracking and escrow status monitoring
  • Designed Negotiation Sandbox with client-side agent simulation

Cloud Infrastructure

  • Containerized all services (frontend, backend, blockchain node) with Docker
  • Deployed to Google Cloud Run for scalable, serverless execution
  • Configured custom networking for inter-service communication
  • Set up CI/CD pipeline for rapid iteration

Challenges we ran into

  1. Smart Contract State Management: Ensuring atomic state transitions while supporting both instant and streaming payments required careful design of the escrow state machine.

  2. AI Agent Coordination: Orchestrating multiple AI agents to reach consensus on transaction verification without introducing single points of failure was complex. We solved this with confidence scoring aggregation.

  3. Real-time Event Indexing: Keeping the backend in sync with on-chain events while handling potential reorgs and missed blocks required robust error handling and recovery mechanisms.

  4. Cloud Deployment Complexity: Containerizing a full blockchain node alongside application services and managing inter-service networking in a serverless environment presented significant DevOps challenges.

  5. Gas Optimization: Balancing feature richness with gas efficiency, especially for streaming payments that could potentially execute many small transactions.

Accomplishments that we're proud of

Full Production Deployment: Live demo with working frontend, backend, and blockchain node on Google Cloud Run

AI-Native Architecture: First-class integration of multi-agent AI systems for autonomous transaction verification

Zero Trust Design: Completely non-custodial system where users maintain full control of their private keys

Comprehensive Documentation: Detailed README with architecture diagrams, workflow explanations, and quick-start guides

Real Innovation: Built novel features like AI-to-AI negotiation and streaming payments that don't exist in traditional escrow systems

Security First: Implemented OpenZeppelin standards, reentrancy guards, and role-based access control

What we learned

  • Smart Contract Design Patterns: Gained deep understanding of escrow mechanics, state machines, and security best practices in Solidity

  • AI Agent Orchestration: Learned how to design multi-agent systems that can make financial decisions with appropriate confidence thresholds

  • Event-Driven Architecture: Mastered patterns for building reliable event indexing systems that bridge on-chain and off-chain worlds

  • Production-Grade Web3: Discovered the complexities of deploying full blockchain infrastructure in cloud environments

  • RAG System Design: Built practical retrieval-augmented generation systems for domain-specific AI applications

What's next for AutoTrust PayMesh

Phase 1: Mainnet & Oracles

  • Deploy to Ethereum mainnet with MNEE token integration
  • Implement Work Validator Oracles for automated service delivery verification
  • Build agent reputation system based on transaction history

Phase 2: Developer Ecosystem

  • Launch mobile app for iOS/Android
  • Create API Marketplace where AI agents can discover and purchase services
  • Release enterprise SDK for white-label solutions

Phase 3: Cross-Chain Expansion

  • Support Arbitrum, Base, and other L2s for lower gas fees
  • Implement cross-chain escrow using bridge protocols
  • Build unified liquidity pools across chains

Phase 4: Advanced AI Features

  • Multi-party escrow for complex supply chains
  • Predictive dispute resolution using historical data
  • Automated contract negotiation with game-theory-optimal strategies

AutoTrust PayMesh represents our vision for the future of autonomous commerce—where AI agents can transact securely, negotiate fairly, and build reputation through verifiable on-chain history. This is just the beginning of the Economic Operating System for AI.

Built With

Share this project:

Updates