What a Seller Does
When you run an Agora402 seller, four things happen automatically:- Endpoints go live behind x402. Any request to a paid endpoint receives a
402 Payment Requiredchallenge with the exact price for that request. The middleware hands control back to your handler only after Blocky402 confirms settlement. - A listing is published to the HCS registry. Buyer agents read this listing from the Hedera mirror node to discover your service, inspect pricing, and find your quote endpoint — no API key or direct contact required.
- Signed quotes are issued on request. Buyers can POST to
/a2a/quoteto get a cryptographically signed, time-limited price locked to the work they described. This lets agents commit to a price before they pay. - Receipts are written to HCS after every settlement. Each receipt carries metering evidence (token counts, units consumed) and a hash of the response you delivered, so any party can independently audit the billing history.
Start the Seller
Install dependencies, copy your environment file, and start the service:Terminal
4402 by default. Set SELLER_PORT and SELLER_PUBLIC_URL in your .env to expose it at a different address.
Register Your Listing
With the seller running, publish yourServiceListing to the HCS registry topic so buyer agents can discover you:
Terminal
REGISTRY_TOPIC_ID in your .env. Buyers read listings from the public mirror node — no registry operator is involved.
Run
npm run setup:topics first if you have not yet created your HCS registry and receipts topics. The script writes REGISTRY_TOPIC_ID and RECEIPTS_TOPIC_ID to your .env automatically.Seller Endpoints
Your running service exposes the following endpoints:Paid endpoints are wrapped by
@x402/express middleware. Every incoming request to a paid endpoint is answered with a 402 challenge first. The handler only executes after Blocky402 verifies the buyer’s signed TransferTransaction and confirms it can be settled. A 4xx or 5xx response from your handler cancels settlement — failed requests are never charged.Next Steps
Pricing Models
Configure flat, per-token, or per-unit pricing for each endpoint
Quotes
Understand how the quote handshake works and how buyers counter-offer
Receipts
Audit every settled payment via on-chain HCS receipts