Skip to content

pactnetwork/pact-tether

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pact × Tether WDK — money-back coverage for agent payments in USDT on Solana

Submission for the Tether Frontier Hackathon Track (Solana side track) on Superteam Earn.

pact pay gives an agent's x402 API call a refund guarantee, with the money moving as USDT on Solana out of a Tether WDK wallet. An AI agent runs pact pay <endpoint> instead of paying the API directly: its self-custodial WDK Solana wallet pays the call's price plus a small premium into a Pact coverage pool, Pact's facilitator makes the upstream call, a classifier grades the response, and if the call failed or the body is garbage, Pact refunds principal + premium in USDT to the agent's wallet. Pact only keeps the premium when the call worked. Nothing in WDK or in the upstream API changes.

What's here

Path What
SUBMISSION.md The full writeup — problem, what we built, how it works, why it fits the Tether track, what's real vs simulated, how to run, roadmap, links. Start here.
cli/ The pact pay × Tether WDK wrapper CLI + demo.sh. Node 20+. See cli/SPEC.md for the interface, JSON-shape, and honesty contract — that's canonical; this README and SUBMISSION.md don't duplicate it.
server/ A bundled zero-dep reference x402 resource server on :8402 — real 402 challenges in the Solana-devnet shape. Exists so the demo runs offline; set X402_BASE to point the CLI elsewhere.
dashboard/ A static one-page dashboard of the calls Pact has covered (settled / refunded / premium earned), with the WDK agent wallet per row.
VIDEO-SCRIPT.md ~90s demo-video script — shot list + voiceover.
PARTNERSHIP-ONEPAGER.md Standalone pitch to the Tether / WDK team.
PLAN.md The build plan and status — what's done, what's stubbed, open items.

Quick start

Node 20+.

cd cli
npm install      # pulls @tetherto/wdk-wallet-solana
./demo.sh        # baseline-success → baseline-FAIL → wrapped-success → wrapped-FAIL, ~40s

# single calls (endpoints: quote, weather, raw url)
node bin/pact-tether.js -v call quote SOL                   # baseline — WDK agent pays directly, eats USDT on failure
node bin/pact-tether.js -v pact pay quote SOL               # wrapped — Pact covers it, success path
node bin/pact-tether.js -v --force-fail pact pay quote SOL  # wrapped — induced failure, Pact refunds principal + premium

Add --json for the machine-readable row only; --live-devnet attempts the real WDK SPL transfer on devnet (needs a funded keypair + a dUSDT mint — see cli/SPEC.md §7). The dashboard is a static page in dashboard/ — open index.html or serve the directory, then point it at cli/pact-tether-calls.jsonl to run it live (see dashboard/README.md).

Real vs simulated — in brief

  • WDK Solana wallet: real, and used. cli/lib/wdk.js wraps @tetherto/wdk-wallet-solana — keypair derivation, address, transaction signing, SPL transfers. Rows carry wdkReal: true when it loaded; a labelled ed25519 fallback if it can't, but it tries the real one first.
  • The Solana x402 payment-proof binding: our code. WDK's x402 glue is EVM-only; there's no Solana x402 signer in WDK. The 402 → proof → retry binding in cli/lib/x402.js is ours, on top of the WDK Solana wallet. Not "WDK x402 on Solana."
  • The devnet "USDT": a mock SPL mint, labelled dUSDT (devnet mock). Tether issues no devnet USDT. Also: there is no "USDT0" SPL token on Solana — USDT0 is EVM-family; the Oct-2025 "USDT0 on Solana" news is the Legacy Mesh making the existing native USDT SPL mint part of the omnichain liquidity, not a new token. Mainnet would use the native USDT mint; devnet uses the labelled mock. We never print "USDT0 token on Solana."
  • The WDK Solana SPL transfer: real on devnet with a funded keypair + RPC; otherwise simulated and labelled (paymentSimulated: true). demo.sh runs simulated by default for reproducibility.
  • The Pact coverage settlement on Solana: simulated and labelled (settlementSimulated: true, b58 tx ids, (simulated) explorer links). Pact's live program settles USDC; a USDT pool needs a protocol redeploy (config change, not code) — out of scope here. The settlement maths (premium formula, principal+premium refund, Pact-nets-$0-on-failure) is real; only the chain I/O is faked. Swap points: cli/SPEC.md §7.

Full detail and the reviewer-facing version of all of this is in SUBMISSION.md and cli/SPEC.md.

Links

About

Pact Network × Tether WDK — money-back coverage for AI-agent x402 payments in USDT on Solana. Hackathon: Tether Frontier Hackathon Track.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors