Stellar testnet · conformance green in CI

Turnpike

An open-source x402 payment facilitator for Stellar with native resource discovery.

Servers charge per request in stablecoins without running chain infrastructure. Agents pay without holding XLM.

facilitator: running on testnet/discovery: designed, not yet built/Apache-2.0

The problem

Machines can't pay each other for small things.

Three gaps sit between an API that could be sold per request and a client that could buy it.

01

Sellers can't charge per request

Card rails have minimums and merchant accounts that make a fraction of a cent meaningless. Accepting crypto instead means running keys, nodes and fee management — infrastructure that has nothing to do with the product.

02

Agents can't pay

An autonomous client needs a funded wallet and native gas before it can buy anything. For software that spins up for one task and disappears, that bootstrapping problem is the whole obstacle.

03

Paid endpoints aren't discoverable

There is no index of what is for sale. An agent can only buy from services it was already told about, which caps the market at whatever a human wired up in advance.


How it works

One request, one payment, one ledger entry.

HTTP 402 has been reserved for payment since 1997. Turnpike is the toll booth that makes it mean something: it verifies the payment, settles it on Stellar, and pays the network fee so the buyer does not have to.

A client asks for something it has not paid for

An ordinary GET, with no payment attached. The client is unmodified — the conformance suite uses wrapFetchWithPayment straight from the public @x402/fetch package.

The server answers 402 Payment Required

Terms travel in the PAYMENT-REQUIRED header: the scheme, the network, the SEP-41 token contract, the amount in atomic units, and the address to pay. The facilitator's fee-sponsorship posture rides along in the same block.

GET /supported

The client signs a Soroban authorization entry

Not a blank cheque. The entry binds the token contract, the amount and the recipient, so the signature authorises exactly one transfer and nothing else. The client needs no XLM: it never pays a network fee.

Turnpike verifies, then settles

Verification simulates the transfer and checks the authorization — right asset, right amount, right recipient, signed by the payer, not expired. Settlement submits it with Turnpike's own account as the transaction source, so Turnpike pays the network fee.

POST /verifyPOST /settle

The resource comes back with a settled hash

200, the thing the client asked for, and a PAYMENT-RESPONSE header carrying the transaction hash. Roughly twenty seconds end to end, most of it waiting for the ledger to close.

There are no custom smart contracts in Turnpike. Settlement runs through the Stellar Asset Contract that already exists on-chain, and every cryptographic operation — authorization-entry validation, transaction assembly, submission — belongs to the Apache-2.0 @x402/stellar package. Turnpike is the HTTP surface, the error mapping and the account that pays the fee.


Proof

Every claim here is a link you can click.

These are settled transactions on Stellar testnet, not screenshots. Open any of them on a block explorer and check the amount, the ledger, and which account paid the fee.

1real settled payment per CI run, every run, no exceptions
17conformance checks each run must pass
0secrets stored in CI — accounts are created per run
0rejections without a reason code and a readable message

Conformance workflow statusA scheduled probe keeps paying on testnet, so the running totals move daily and are not kept here. The current snapshot — payments made, payments failed, and every failure analysed — lives in the README and in the raw CI artifacts behind it. Yes, there has been a failure; it is written up in full.


What exists, and what doesn't

The half that isn't built yet.

A payment facilitator that overstates itself is worse than useless, because the first thing anyone does is test it. So: this is the line, precisely.

Built and running

  • The facilitator. /verify, /settle and /supported for the exact scheme on stellar:testnet.
  • Fee sponsorship. Turnpike's account is the transaction source and pays the fee; the payer holds no XLM.
  • A conformance harness. An unmodified client from public npm completes a real payment; runs in CI on every push.
  • Explained rejections. Every refusal returns a specific reason code and a human-readable message.

Designed, not implemented

  • Bazaar discovery. Designed and specified. Not implemented — there is no /resources endpoint and no catalogue.
  • The upto scheme. Designed. It needs a Soroban contract and a Stellar specification that does not exist yet.
  • Mainnet. Not supported and not advertised. The service refuses to start on stellar:pubnet.
  • Concurrent settlement. One payment in flight at a time. A channel-account pool is the known fix, not yet built.

Quickstart

Clone it and watch a payment settle.

One command, from nothing. It creates and funds testnet accounts through Friendbot, brings the facilitator and a demo resource server up with Docker, then makes a stock x402 client pay for real and prints the transaction hash.

bash
$ git clone https://github.com/Turnpike-org/turnpike
$ cd turnpike
$ ./demo.sh

No faucet visit, no wallet, no shared secret — the default payment asset is the native XLM Stellar Asset Contract precisely so a stranger can reproduce this unattended. Needs Node 22.12+ and Docker. Two to four minutes, most of it building images.