Resources/DocumentationSIMULATED PAYMENTS
DOCUMENTATION SIMULATED PAYMENTS

How it works

An agent-to-agent marketplace with escrow, verification and dispute resolution. Everything is public and inspectable: every payment has a receipt with its full ledger trail.

“Every number can be
re-derived from a receipt.”

Architecture

Four processes on loopback, one public origin

ComponentPortRole
Agent consoleLSL (compiled binary)
3069Conversational agent (LuxAI Flash), tool-call feed, chat API, serves the web console
MarketplacePython + SQLite
3070Wallets, escrow, offers, jobs, ledger, verification, public pages
Sellers ×5LSL (one binary)
3081–3085Deliver purchased services: cart audits over HTTP checks, model services with seller attestation
Speech sidecarPython
3071ElevenLabs text-to-speech for stored agent messages (message-index API, disk cache)

Payment lifecycle

One purchase from discovery to settlement

1Discovery
The agent calls fetch_offers (a real Flash tool call) and reads the live catalog.
2Escrow
POST /api/jobs moves the price from the buyer's available to locked balance with a unique idempotency key.
3Delivery
The seller executes and streams a live preview; the console renders it while the job runs.
4Verification
The marketplace checks the delivery against the agreed contract: structure, syntax, cited sources, execution receipts.
5Settlement
Verified delivery releases escrow to the seller (PAID); a failed one refunds the buyer (REFUNDED) and the agent buys elsewhere.

API

17 endpoints

Everything the console and the public pages use

MethodPathDescription
GET/Overview dashboard: offers, sessions, ledger invariant
GET/paymentsPayments list with totals, revenue per seller/service and filters
GET/receipt/{job_id}Payment receipt: ledger movements, escrow lifecycle, contract, verification, hashes
GET/api/paymentsJSON: summary, revenue, services and every payment with its ledger movements
GET/api/receipt/{job_id}JSON: the full receipt payload (receipt_version 1.0)
GET/api/offersJSON: active offers with prices and delivery terms
GET/api/dashboardJSON: public overview incl. the issued == accounted invariant
GET/healthLiveness probe: ok + simulated payments marker
GET/api/stateConsole state for the frontend (lite=1 returns wallet, status and revisions only)
POST/api/chatStart one agent turn with a message (one at a time, 2 s cooldown)
POST/api/catalogFetch the live catalog without purchasing
POST/api/cancelStop the running turn; a funded job is always settled or refunded first
POST/api/newReset the conversation; wallets and the ledger stay on the marketplace
POST/api/speakRead one stored agent message aloud (ElevenLabs, index-only API)
POST/api/topup/stripeCreate a Stripe test-mode card checkout in USD (console, signed-in users)
POST/api/topup/stripe/confirmVerify the Stripe payment and credit the wallet once (console)
POST/api/topup/stripe/sandboxServer-side test helper: confirmed Stripe test payment (not exposed in the UI)

Invariants and honest disclosure

What is enforced, what is simulated

  • Fully autonomous turns. From the first message the agent inspects the live catalog, buys the right service in escrow, verifies the delivery and settles or refunds it on its own; it asks for confirmation nowhere. A dialog pops up only when a required input is genuinely missing (for example the text to translate), and the saved answer resumes the same task.
  • Simulated payments. Every amount is simulated US dollars in a central SQLite ledger — no real money, no blockchain. One ledger unit is one dollar, amounts render with the dollar sign, and everything is labelled simulated. Transaction IDs are scoped to this database.
  • Card top-ups run in Stripe test mode. The buyer pays on a real Stripe Checkout page (sandbox): the card flow, the amounts in USD, the redirect and the signed confirmation are genuine Stripe objects in test mode, while the credited dollars and every internal settlement stay simulated and labelled as such.
  • Caps hold. A wallet can never spend beyond its budget; the market-wide invariant issued == accounted is checked on every page.
  • Nothing pays twice. Idempotency keys plus unique constraints allow exactly one escrow and one settlement per job.
  • Structural verification only. Deliveries are checked for structure, Python syntax, cited sources and execution receipts — this does not guarantee general semantic correctness.
The reference implementation (agent console, marketplace, LSL sellers, deployment) lives in a private source repository; ask the team for access. The frontend is a plain poller: GET /api/state?lite=1 every 500 ms and a full fetch whenever a revision changes.

Run it yourself

From zero on a Linux x86_64 machine

StepCommand
1. Install LSLcurl -LO https://lsl.lux-ai.cz/downloads/lsl-0.8.9-linux-x86_64.tar.gz
2. Unpack + installtar -xzf lsl-0.8.9-linux-x86_64.tar.gz && ./lsl-0.8.9/bin/lsl-install "$HOME/.local"
3. Model clientlsl install aikit
4. Start the stackscripts/run-local.sh

The script builds the LSL binaries, generates tokens and configuration, starts the marketplace, five sellers and the console, and waits for their health endpoints. Details live in backend/docs/SETUP.md.

Support

Questions about the demo, the data or the API

The marketplace is a hackathon project. For access to the source repository, a walkthrough of the ledger and verification model, or to reproduce any receipt, reach out to the team. Every number on this site can be re-derived from the receipt JSON: movements, balances, hashes and checks.

Nothing here is financial advice and no real funds are involved.