Reference
Builders
An MCP server, a TypeScript SDK, x402 endpoints and an HTTP API, all live and all tested.
MCP server
Remote, 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.
Claude Code:
claude mcp add --transport http bond https://pbond.app/mcp
Cursor, 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
Exact scheme, USDG on
eip155:4663, settled by PBI with EIP-3009 before the answer is served; the receipt is in X-PAYMENT-RESPONSE.
| Endpoint | Price | Returns |
|---|---|---|
| GET /api/v1/records/:service?from&to | $0.001 | raw records with Merkle proofs, up to six hours |
| POST /api/v1/watch | $0.10 | adds any public endpoint to the probes for 30 days |
| GET /api/canary | $0.001 | the latest block and the time (a house bond) |
| GET /api/feeds/quotes | $0.002 | stock-token prices with the Chainlink answer at the same block (a house bond) |
HTTP API
| GET /api/v1/services | the board: every service, bond, stats and the last 60 probes |
| GET /api/v1/services/:id | one record with its last settled epochs |
| GET /api/v1/epochs/:bond/:epoch | a settled epoch with its compensation |
| POST /api/v1/tx/:action | unsigned transactions: back, issue, exit, withdraw, claim-premium, claim-compensation, approve |
| POST /api/claims | asks the registrar to check a bond.json |
| GET /probes/:root.json | the records of one posted window |
| GET /api/live | live 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.