Billateral

For developers

One integration point on each side.

Receipts for x402. The buyer wraps its fetch, the vendor registers an extension, and nothing changes about how money moves.

Nothing to install yet. The packages are not on npm. They go public at release; the snippets below are taken from the current source. Join the waitlist and we ping you the day they land.
Buyer side — wrap your fetch
import {
  accountFromPrivateKey,
  createAgent,
  didWebProvider,
  InMemoryX25519Store,
  wrapFetch,
} from '@billateral/agent';

const agent = await createAgent({
  account: accountFromPrivateKey(process.env.AGENT_KEY),
  providers: [didWebProvider({ identityServiceUrl, domain: 'acme.com' })],
  x25519Store: new InMemoryX25519Store(),
  identityServiceUrl,
});

const fetch = wrapFetch(agent, { maxValue: 1_000_000n });

// Pays, then the sealed receipt rides back on the PAYMENT-RESPONSE header.
const res = await fetch('https://api.vendor.com/report');
Vendor side — register the extension
import { x402ResourceServer } from '@x402/core/server';
import {
  createBillateralExtension,
  createBillateralFacilitatorClient,
  pinBytes,
  submitReceiptAttestation,
} from '@billateral/x402-extension';

// Throws rather than defaulting: an unset URL would otherwise silently
// settle real payments at the public x402 test facilitator.
const server = new x402ResourceServer(
  createBillateralFacilitatorClient({ url: facilitatorUrl }),
);

server.registerExtension(
  createBillateralExtension({
    network,
    vendor,
    vendorAccount,
    vendorX25519Pub,
    lineItems,
    businessPurpose: 'API access',
    pin: (bytes, label) => pinBytes(bytes, label, { pinata }),
    attest: (inputs) => submitReceiptAttestation(inputs, attestConfig),
  }),
);

// Hooks fire only on routes that declare the extension.

Additive

Wrap the request on the buyer side, register one extension on the vendor side. No new infrastructure in the payment path.

Your existing rail

Works on top of the payment standard agents already use. We add the receipt layer, not the payment layer.

Verify client-side

Receipts verify in a static page in the browser. No account, no SDK required to check one.

Identity without onboarding

An operator whose agents already sign the requests they send is recognized with nothing to configure, because their keys are already published at their own origin. Weaker checks stay labelled as what they are: proving a key is the same key is not identity.

Code samples are transcribed from the current source and are not yet installable — the packages are not on npm. The API may still change before release.