Sign in

Reference

Builders

An MCP server, a TypeScript SDK, x402 endpoints and an HTTP API, all live and all tested.

MCP server

Model Context ProtocolRemote, streamable HTTP, at https://pbond.app/mcp. Tools: find_bonded(kind, promise, minCapital), service_record(id), epoch(id, e), and back and issue, which return unsigned transactions.

ClaudeClaude Code: claude mcp add --transport http bond https://pbond.app/mcp

CursorCursor, in .cursor/mcp.json:

{ "mcpServers": { "bond": { "url": "https://pbond.app/mcp" } } }

SDK

One file, no dependencies: /sdk/bond.mjs. Its sha256 is in the dev log.

import { createBond, bonded, payX402 } from "./bond.mjs";

const bond = createBond({ site: "https://pbond.app" });
if (!(await bond.isBonded(2, { minCapital: 100, promise: "deviation" }))) throw new Error("unbonded dependency");

const { transactions } = await bond.back(2, "25");          // approve + back, unsigned
await bond.claimCompensation(1, 212, myAgentAddress);       // the claim for one slashed epoch

// your own service: serves /.well-known/bond.json and adds X-Bond to every response
app.use(bonded({ serviceId: 31, claim: myBondJson }));

// pay any x402 endpoint in USDG with a viem account
const res = await payX402("https://pbond.app/api/canary", { from: account.address, signTypedData: (a) => account.signTypedData(a) });

x402 endpoints

x402Exact scheme, USDG on eip155:4663, settled by PBI with EIP-3009 before the answer is served; the receipt is in X-PAYMENT-RESPONSE.

EndpointPriceReturns
GET /api/v1/records/:service?from&to$0.001raw records with Merkle proofs, up to six hours
POST /api/v1/watch$0.10adds any public endpoint to the probes for 30 days
GET /api/canary$0.001the latest block and the time (a house bond)
GET /api/feeds/quotes$0.002stock-token prices with the Chainlink answer at the same block (a house bond)

HTTP API

GET /api/v1/servicesthe board: every service, bond, stats and the last 60 probes
GET /api/v1/services/:idone record with its last settled epochs
GET /api/v1/epochs/:bond/:epocha settled epoch with its compensation
POST /api/v1/tx/:actionunsigned transactions: back, issue, exit, withdraw, claim-premium, claim-compensation, approve
POST /api/claimsasks the registrar to check a bond.json
GET /probes/:root.jsonthe records of one posted window
GET /api/livelive probes, counters and the latest post

Onchain

Another contract can require bonded dependencies with one view call: BondBook.isBonded(serviceId, minCapitalUSDG, promiseMask), where the mask is 1 availability, 2 latency, 4 freshness, 8 deviation, 16 tool stability. An agent's spending policy or a v4 hook can refuse to pay an unbonded service.