Skip to content

Repository files navigation

🤝 Handover — verified agentic commerce for physical goods

Two agents settle a used-goods deal end-to-end: tap the chip, verify authenticity on-chain, pay with a Prava single-use card token, and ownership transfers atomically — no escrow company, no leap of faith.

🎬 Demo video: https://youtu.be/_g09-c6ONiw ⛓️ Real settlement txs (Base Sepolia): 0x9fdfc1…3c13a4 · 0x5b2f49…379fca

Built solo in 48h for the Agentic Commerce Hackathon (Devfolio, Jul 31 – Aug 2 2026).

The problem

P2P resale (~$200B/yr) breaks at the handoff: the buyer can't trust the item, the seller can't trust the payment, and escrow middlemen take 10–25% and days to settle. AI agents can't participate at all — there is no machine-readable trust signal for physical goods and no settlement primitive that ties payment cleared to ownership transferred.

The insight

Compose two trust layers:

  • Goods-side trust — TAG IT: every product carries a tamper-proof NTAG 424 DNA chip bound to an ERC-721 digital twin on Base Sepolia. Any agent can read a block-pinned, independently re-derivable verdict at verify.tagit.network/api/asset/{id} — keyless.
  • Money-side trust — Prava: payment happens through a single-use card credential, merchant-locked to the seller and amount-locked to the exact price, approved by the buyer's biometric passkey. The agent never touches card data.

The settlement rule that makes it atomic: Prava's report-status: APPROVED is the one and only trigger for the on-chain ownership transfer. Declined or timed out → the session is revoked and nothing moves. Remove Prava and the product cannot settle — the payment is the settlement layer, not a checkout bolt-on.

What happens in the demo

"buy the eye cream if it's genuine and under $120"
        │
        ▼
🔎 agent finds the listing (token #36, $89)
⛓️ reads the block-pinned on-chain verdict  ──►  🚩 FLAGGED? → refuse, no session,
✅ VERIFIED · authentic · CLAIMED                  the card is never born
💰 $89 ≤ $120 limit
💳 Prava session — merchant-locked, exact amount
🔐 human approves with Touch ID (WebAuthn passkey)
💳 single-use network token minted (•••• 2665)
✅ report-status APPROVED
⛓️ TAGITCore.transferAsset() → buyer's wallet     ← atomic release
📱 item appears in the buyer's TAG IT vault

The refusal path is a first-class feature: a flagged (lost/stolen/recalled) item is rejected before any payment session exists.

Architecture

  • src/app/api/agent — buyer agent. GPT-4o tool-calling (get_listings, verify_item, create_payment) with hard guardrails: no verification → no payment; price cap enforced; a deterministic fallback mode keeps the demo alive without an LLM key.
  • src/lib/settlement.ts — the deal state machine (created → awaiting_card → token_minted → approved → transferring → transferred, with refused / declined / revoked / expired / failed terminals). Idempotent polling (Prava has no webhooks), revoke-on-fail everywhere.
  • src/lib/prava.ts — Prava sandbox client: create session, poll payment-result, report-status, revoke.
  • src/lib/verify.ts — TAG IT verdict client + the resale gate (authentic ∧ unflagged ∧ CLAIMED). Supplier metadata is never read as instructions (prompt-injection hygiene).
  • src/lib/chain.ts — viem signer calling TAGITCore.transferAsset() on Base Sepolia; refuses to simulate if the signer key is missing.
  • src/app/page.tsx — the chat UI: streaming step cards, live settlement state pills, Basescan links.

Run it

pnpm install
cp .env.example .env.local   # fill: PRAVA_SECRET_KEY, BASE_SEPOLIA_RPC_URL,
                             # SETTLEMENT_SIGNER_KEY, DEMO_BUYER_WALLET,
                             # OPENAI_API_KEY (optional)
pnpm dev                     # localhost:3000

Prava sandbox test card: see docs.prava.space → Testing. Every payment needs a real WebAuthn passkey approval — that part is intentionally human.

Security model (honest edition)

  • The demo runs on Prava's sandbox (labeled on screen) and Base Sepolia.
  • Custody: the seller wallet signs transferAsset server-side after APPROVED. In production this becomes an escrow contract or operator-approval flow (VerificationEscrow.releaseWithProof is already deployed and is the natural next step).
  • authentic: true is a lifecycle-state claim about the chip-bound twin — physical presence is proven by the tap (SUN cryptogram), not by software alone.

Pre-existing vs built this weekend

Full disclosure in DISCLOSURE.md. Short version: TAG IT's verification rails (chips, contract, verify API, iOS app) predate the hackathon; every line of the payment, settlement, agent, and UI code was written during the event — that's the part being judged, and Prava is structurally unremovable from it.

Team

Artem Kozytskii — founder, TAG IT Network (chips in stock, contracts live on Base Sepolia, consumer app on TestFlight). Handover is the settlement layer that makes every physical thing agent-tradable.

About

Verified agentic commerce for physical goods — tap the chip, verify on-chain, pay with a Prava single-use card, ownership transfers atomically. Agentic Commerce Hackathon 2026.

Resources

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages