Stellar Bazaar is an open-source foundation for a Stellar x402 facilitator and discovery network. The project is intended to build on @x402/stellar and make it practical for sellers, buyers, agents, and infrastructure operators to discover paid HTTP resources and settle x402 payments on Stellar.
The long-term goal is to provide:
- a production-ready x402 facilitator for Stellar
/verify,/settle, and/supportedfacilitator endpoints- Bazaar discovery endpoints at
/discovery/resourcesand/discovery/search - automatic cataloging of x402 resources that publish Bazaar discovery metadata
- HTTP and MCP resource discovery
- an MCP server for agent search and paid calls
- Stellar testnet and pubnet support
- future support for the x402
uptopayment scheme - hosted and self-hosted deployment paths
The MVP integrates the official x402 v2 Stellar exact scheme and demonstrates the complete testnet path: discover a resource, receive HTTP 402, create a buyer authorization, verify it, settle it, and receive the protected result. The settlement is independently inspectable on Stellar testnet.
It currently provides:
- real
/supported,/verify, and/settlefacilitator endpoints - a PostgreSQL-backed
/discovery/resourcesendpoint with bounded filters and pagination - one controlled paid testnet resource carrying official Bazaar discovery metadata
- an end-to-end demo using the official Stellar and x402 client packages
- shared configuration and types
- Bazaar resource types, repository/search interfaces, and PostgreSQL/in-memory repositories
- SDK package scaffolding for future seller and buyer helpers
- strict TypeScript, linting, formatting, tests, Docker, Compose, and CI
Automatic metadata ingestion, /discovery/search, MCP tools, pubnet, and the upto scheme are deliberately not claimed by this MVP.
apps/
facilitator/ HTTP facilitator service for x402 over Stellar
mcp/ future MCP discovery server for agents
packages/
bazaar/ discovery metadata, catalog repository, and search interfaces
sdk/ seller and buyer helper utilities
shared/ shared configuration, HTTP helpers, and public types
Payment handling is delegated to @x402/stellar. Discovery remains separate from payment execution so cataloging, search, and agent workflows can evolve without acquiring payment authority.
Requirements:
- Node.js 22 or newer
- npm 10 or newer
Install dependencies:
npm installRun checks:
npm run format:check
npm run lint
npm run typecheck
npm testRun a disposable-account Stellar testnet settlement demo:
npm run demo:testnet -w @stellar-bazaar/facilitatorThe demo funds fresh buyer, facilitator, and seller accounts through Friendbot, starts the controlled resource, confirms its unpaid 402, and uses @x402/fetch to authorize and retry the request. The resource delegates verification and settlement to the local facilitator before returning its result. Testnet secret keys exist only in memory for that run.
See docs/testnet-evidence.md for the first confirmed transaction and reproduction details.
Start the facilitator locally:
cp .env.example .env
# Set FACILITATOR_PRIVATE_KEY to a funded Stellar testnet account secret.
# Set DEMO_SELLER_ADDRESS to expose and catalog the paid address inspector.
npm run dev -w @stellar-bazaar/facilitatorThe service listens on http://localhost:4020 by default.
GET /healthreturns service health and configured Stellar network.GET /supportedreports x402 v2,exact,stellar:testnet, fee sponsorship, and the configured facilitator signing address.POST /verifyvalidates the x402 v2 request envelope and delegates Stellar transaction verification and simulation to@x402/stellar. It never submits a transaction.POST /settledelegates verification, transaction reconstruction, fee sponsorship, submission, and confirmation polling to@x402/stellar.GET /discovery/resourcesreturns an x402 v2 Bazaar listing with bounded filtering and pagination. PostgreSQL is used whenDATABASE_URLis configured; local runs without it use an empty in-memory catalog.GET /demo/address-inspect?address=...is enabled only whenDEMO_SELLER_ADDRESSis configured. It returns an official x402402challenge and releases its deterministic address inspection result only after successful settlement.
Unit tests assert HTTP delegation, configuration, payment gating, and discovery behavior. They are not presented as proof of on-chain settlement; the reproducible testnet transaction provides that evidence.
See the MVP submission guide for the demonstrated flow, acceptance criteria, and intentionally deferred work.
Apache-2.0. See LICENSE.