Inspiration

Custom manufacturing, freelance engineering, and bespoke commerce happen every day inside direct messages. While chat is the fastest way for buyers and sellers to negotiate deliverables, budgets, and deadlines, unstructured threads leave both sides exposed to scope creep, unrecorded edits after payment, and slow disputes with no objective audit trail. We built PACT to turn casual chat negotiations into binding, self-enforcing agreements—where AI extracts structured terms, device biometrics seal the contract, multimodal vision verifies delivery, and PayPal moves money only when every condition is met.

What it does

PACT is an autonomous AI escrow agent built around five real-time stages: Conversational AI Term Extraction (Conversation): As the buyer and seller negotiate in plain English, Google Gemini Flash parses the live chat stream and extracts atomic commercial terms (deliverable specs, quantities, materials, milestone splits, and deadlines) with confidence scores and source-message links. Both parties review and explicitly confirm each term before it enters the contract. Predictive Risk & Scenario Engine (Scenarios): Before any funds move, PACT scans confirmed terms for ambiguous specifications, tight turnarounds, and missing edge cases, suggesting one-click protective clauses. Immutable SHA-256 Contracts & Biometric Signing (Agreement): Confirmed terms compile into a 13-section formal contract stamped with a deterministic SHA-256 version hash (V1 to V2). Both parties sign using WebAuthn device biometrics (Touch ID, Face ID, or Windows Hello) with a WebCrypto fallback, binding their public keys directly to that exact contract version. Dual-Gated PayPal Escrow & Payouts (Payments): Milestone deposits and payouts stay programmatically locked until mutual biometric signatures are verified on the active SHA-256 contract. Buyers fund milestones via PayPal Checkout (with Pay Later support), automated invoices are generated on contract lock, and milestone releases trigger PayPal Payouts directly to the seller. Gemini Vision Inspection, Evidence Vault & AI Dispute Resolution (Vault): Sellers upload photo proof of completed goods. Gemini Vision checks the image against the locked contract specs (counts, colors, materials, custom details) to unlock payout release. Every image hash, biometric signature, and PayPal transaction ID is logged in a tamper-evident Evidence Vault. If a delivery falls short, PACT's AI Dispute Mediator audits the vault against the locked contract and executes an instant partial refund via the PayPal Refunds API.

How we built it

Frontend & Real-Time Workspace: Built with Next.js 14 (App Router), TypeScript, and Tailwind CSS, featuring a split-screen Buyer and Seller workspace with isolated one-click demo sessions and dynamic invite codes. Database & Live Sync: Powered by Supabase PostgreSQL and Supabase Realtime WebSockets so chat messages, term confirmations, contract hashes, biometric signatures, and PayPal payment states update instantaneously across both users. Multimodal AI: Integrated Google Gemini Flash for structured JSON term extraction, risk analysis, Vision-based deliverable verification, and dispute adjudication. Cryptographic Security: Combined deterministic SHA-256 contract payload hashing with WebAuthn hardware biometric signatures so neither party nor the AI can silently alter terms once signed. PayPal Financial Rails: Integrated PayPal Orders v2, Capture, Invoicing, Payouts, and Refunds v2 APIs to automate deposits, milestone releases, and dispute refunds.

Challenges we ran into

Preventing AI Hallucinations from Moving Money: Letting an LLM trigger payments directly from raw chat is unsafe. We solved this by requiring bilateral human confirmation on every extracted term before compiling a deterministic SHA-256 contract, and dual-gating PayPal disbursements on verified signatures and Vision checks. Cross-Border Sandbox & Redirect Handling: Running multi-party PayPal Checkout flows on hosted HTTPS required handling regional currency rules and popup return contexts cleanly. We implemented dynamic origin resolution, explicit PayPal experience_context routing, and server-verified capture handling. Multi-Party Session Isolation: Testing buyer and seller flows simultaneously required isolated auth sessions without cookie conflicts. We built dedicated demo login routes paired with Supabase Realtime channels so both sides operate independently in real time.

Accomplishments that we're proud of

Taking a custom commerce deal from raw chat messages to a biometric SHA-256 contract, Vision-verified deliverable, and settled PayPal payout in under 90 seconds. Binding hardware WebAuthn signatures directly to SHA-256 contract versions so every PayPal transaction is cryptographically traceable to an agreed specification. Closing the loop on buyer and seller protection by pairing Gemini Vision evidence checks with automated PayPal partial refunds.

What we learned

Separating probabilistic AI extraction from deterministic cryptographic hashing and dual-gated payment state machines creates an autonomous workflow users can safely trust with real funds. Combining PayPal's Orders, Capture, Payouts, and Refunds APIs with programmatic contract verification turns traditional escrow into instant software infrastructure.

What's next for PACT

Multi-Milestone Supply Chain Schedules & Webhooks: Supporting complex multi-tranche B2B deliveries with live PayPal webhook reconciliation and carrier tracking verification. ERP & Audit Exports: Exporting signed SHA-256 contract receipts and PayPal settlement logs directly into accounting and compliance tools. Messaging Platform Extensions: Bringing PACT's AI term extraction and PayPal escrow triggers directly into WhatsApp Business, Slack, and email threads.

Built With

Share this project:

Updates

Submission history