About the Project

What Inspired Us

The idea for Diptos came from three painful, real-world settlement failures we experienced firsthand:

  1. The Refurbished iPhone Scam: A close friend paid full price for what was sold as a brand-new iPhone, only to discover after delivery that the device was refurbished and tampered with. Because the payment had already cleared with zero cryptographic proof-of-condition or programmatic holdback, recovering the funds turned into a dead end.
  2. Hunting Bounties & Freelance Delivery Friction: As builders actively shipping bounties and freelance engineering sprints, we constantly hit the same wall—completing deliverables on time only to wait weeks for manual approvals, chase unresponsive payers, or lose 10%–20% to middleman platforms.
  3. Why Traditional Invoice Factoring Fails: Working with industry clients showed us that legacy invoice factoring is slow, paper-heavy, and binary—if a deliverable is delayed by a few hours or misses a minor acceptance check, traditional contracts freeze everything into subjective disputes rather than adjusting settlement mathematically.

We asked: What if any payment—whether for a physical high-value item, a bounty sprint, or an autonomous AI agent task—could be locked in native USDC on Arc, verified cryptographically against objective acceptance criteria, and governed by continuous mathematical decay instead of human arguments?


What We Built

Diptos (diptos.xyz) is a self-pricing settlement and proof-of-work verification protocol built natively on Arc Testnet (Chain ID: 5042002), where USDC is both the native gas token and the atomic settlement currency.

Instead of binary all-or-nothing payouts or 15% middleman fees, Diptos turns any deliverable into a verifiable on-chain settlement link (app.diptos.xyz/pay/:id) or a 12-line SDK call (@diptos/sdk on npm) combining four core primitives:

  1. Macro-Calibrated Risk Pricing ($\lambda$): Live implied probabilities from Gemini Prediction Markets dynamically calibrate the link's latency risk parameter ($\lambda$) at origination.
  2. Continuous Time-Entropic Collateral Decay (TECD): Rather than binary pass/fail penalties, DiptosEscrow.sol executes 18-decimal WAD fixed-point decay math directly on-chain: $$V_{\text{payee}}(\Delta t) = V_0 \cdot e^{-\lambda \left(\frac{\Delta t}{T}\right)^{1.5}}$$ where $V_0$ is the locked USDC principal, $T$ is the agreed SLA window, and $\Delta t = \max(0, t_{\text{settle}} - t_{\text{deadline}})$ is the delivery latency. On-time delivery pays out 99.5% instantly (0.5% protocol fee); late delivery automatically splits the principal into a fair payee payout plus an instant mathematical rebate back to the buyer—zero human arbitrators required.
  3. Cryptographic AI Proof-of-Work (Grok AI + EIP-712): When a contributor submits a GitHub PR, deployment URL, or verification proof, our Grok AI (grok-3-mini) auditor inspects the live evidence against the link's acceptance criteria, hashes the canonical evidence payload (keccak256), and signs a chain-bound EIP-712 release digest verified on-chain via ecrecover.
  4. Spoken Executive Deal Briefs (ElevenLabs) & Real-Time Indexing (QuickNode): Buyers and contributors can listen to live audio/mpeg deal briefings synthesizing on-chain principal, SLA countdowns, and Gemini risk odds via ElevenLabs TTS, while QuickNode Streams (HMAC-SHA256 verified) and Arc RPC index settlement events in sub-second real time.

How We Built It

  • Smart Contracts (Foundry + Solidity on Arc Testnet 5042002): Authored DiptosEscrow.sol (native 18-decimal USDC msg.value custody, on-chain WAD TECD math, chain-bound EIP-712 RELEASE_TYPEHASH + per-escrow nonces, and permissionless claimTimeoutRefund) and DiptosRegistry.sol (canonical keccak256 anti-double-spend commitment ledger and counterparty reputation tracking). Verified with 15/15 unit tests and 256-run invariant fuzz suites confirming zero wei dust loss ($P_{\text{payee}} + P_{\text{rebate}} + P_{\text{fee}} = V_0$).
  • Autonomous Agent & Consumer SDK (@diptos/sdk): Built and packaged a zero-dependency-leak TypeScript SDK (tsup dual ESM + CJS + .d.ts) giving both human checkout apps and autonomous AI agents programmatic guardrails for USDC settlement.
  • Three-Surface Web Architecture (React, TypeScript, Vite, viem, Vercel):
    • diptos.xyz — Protocol overview, live Arc Testnet deal feed, interactive on-chain TECD simulator, and verified contract ledger.
    • app.diptos.xyz — Origination studio and /pay/:id settlement checkout room with explicit EIP-1193 wallet connection.
    • sdk.diptos.xyz — Interactive developer documentation portal and live Arc RPC + Gemini risk execution console.

Challenges We Faced & What We Learned

  • Native 18-Decimal USDC vs. 6-Decimal ERC-20 Accounting on Arc: Arc uses native USDC with 18 decimals for msg.value and gas while bridging ERC-20 interfaces at 6 decimals. Designing our WAD fixed-point exponential approximation in Solidity required strict invariant fuzz testing across 256 runs so integer truncation never loses or creates a single wei of USDC.
  • EIP-712 Cross-Chain & Replay Hardening: Ensuring byte-for-byte parity between viem's signTypedData off-chain and DiptosEscrow.sol's DOMAIN_SEPARATOR + per-escrow nonce on-chain taught us how critical strict domain binding (chainId == 5042002) is when AI agents sign financial attestations.
  • Stateless Serverless Event Indexing: Because Vercel serverless functions scale horizontally without shared memory, we backed our HMAC-verified QuickNode webhook buffer with authoritative viem getLogs queries ordered by (blockNumber, logIndex) so live escrow feeds stay deterministic even across cold starts.

Built With

  • ai-agents
  • arc
  • circle
  • defi
  • eip-712
  • elevenlabs
  • escrow
  • foundry
  • gemini-prediction-markets
  • grok-ai
  • micropayments
  • node.js
  • npm-sdk
  • quicknode
  • react
  • smart-contracts
  • solidity
  • tailwindcss
  • typescript
  • usdc
  • vercel
  • viem
  • vite
  • web3
  • xai
Share this project:

Updates

Submission history