Skip to content
@x207-labs

x207

Barter protocol for AI agents on NEAR

x207 labs: barter for AI agents on NEAR

NEAR testnet built at NEAR HACKATHON License Apache-2.0

Demo video · Dashboard · Marketplace · Docs · Read API · MCP server (health) · Start here: x207-labs/x207 · For AI agents: llms.txt

x207

x207 mascot

x207: barter protocol for AI agents on NEAR.

Barter failed for three reasons: matching, pricing, timing. x207 answers each for AI agents on NEAR, and each answer has run on NEAR testnet; no single run shows all three yet.

Barter failed at How x207 fixes it
Matching No pair wants each other's asset, yet a ring trades: each agent sells to one and buys from another on credit, and the contract nets the ring to one payment each (on testnet, 81 credit of trade, 8 mock USDT moved). Any solver may propose the clearing of the loop, and the contract checks it.
Pricing An appraiser on NEAR AI Cloud private inference (TEE) values each asset in credit and stores the signed request, response and attestation. The value is advice.
Timing A signed voucher is served at once and settled at the end of the epoch; a stake bounds what each member can owe, and the contract refuses a voucher over the credit limit. By default a seller serves before the chain answers; register-first closes that.

x402 lets agents pay. x207 lets them pay with digital assets like API quota or licences: trades run on stake-backed credit, loops cancel, and many agents settle at once with one net payment each, cleared by a NEAR contract every epoch.

Important

Honest limits.

  • Testnet only. No mainnet transaction has been sent. The USDT is a mock token that anybody can mint, so no amount here is real money.
  • Not audited. Security reviews are internal, not an audit.
  • It does not save gas on NEAR. What netting reduces is the value that has to move.
  • The appraiser does not set prices. Its value is advice.

The full list: What it does not do.

Try it

  1. Open the dashboard (the root of the site is a landing page) or the marketplace: read-only, no account.
  2. Ask an AI client about the circle through the MCP server: hosted and read-only, or npx -y @x207/mcp, also in the Official MCP Registry as io.github.x207-labs/x207-mcp.
  3. Or run everything on your machine in a local sandbox: npm run demo:quick in the umbrella.

Repositories

Repository Its role
x207 Umbrella: the story, the proof table, docs, demos, end-to-end tests, scripts
contracts The x207-circle contract (Rust): members, vouchers, clearing, settlement; the account locker; Sputnik DAO scripts
sdk @x207/core, @x207/scheme, @x207/mcp on npm; the binding spec and test vectors; a reference facilitator
backend Indexer, read API, HTTP 207 report, settlement worker, marketplace book, appraiser, access broker
frontend The dashboard: marketplace, obligation graph, clearing statistics, 207 report, risk, governance
solver The open clearing solver (min-cost flow), barter matching and the seeker
agents Six demo agents built only on the public SDK
docs The docs site, x207-docs.vercel.app

What has run

Run on NEAR testnet in the circles x207-v018.testnet (contract 0.0.18) and x207-v013.testnet (contract release v0.0.13).

Read more: the rings and the realistic epoch

On NEAR testnet, in the circle x207-v018.testnet (contract 0.0.18), a three-agent barter ring in epoch 184 traded 81 credit: netting left 8 mock USDT to move, and clearing removed 72 from the gross record. No asset changed hands in that run. A second ring in epoch 245 handed three mock NFTs over through contract escrow, at prices the operator set, and cleared 72 of 81 the same way (demo). One operator signed all agents in both rings. Of the 85 barter kinds registered, 13 ran on testnet.

In the circle x207-v013.testnet (contract release v0.0.13), a realistic epoch of 24 vouchers worth 41.35 credit cleared 21.8 credit (ratio 0.527) and left 7.75 USDT to move; five of six debtors paid and one defaulted and was covered from its stake. Everything is checked by scripts in the umbrella repository.

What it does not do

The main limits are in the box above. The full list:

Read more: all limits
  • Testnet only. No mainnet transaction has been sent. The USDT is a mock token that anybody can mint, so no amount here is real money.
  • It does not save gas on NEAR. The epoch burnt 109.7 Tgas against 54.9 Tgas for 24 plain transfers. What netting reduces is the value that has to move: 7.75 USDT of 41.35 credit of obligations (the solver separately cancelled 21.8 of the gross obligations, which does not change that figure).
  • It is not credit without cash. A member locks a stake of at least 125% of the debt it can run up; a default is covered from that stake.
  • It only helps where debts go in cycles. A star graph, where everybody owes one hub, gains nothing.
  • The appraiser does not set prices. Its value is advice; the attestation shows the key was in a TEE, not which code ran.
  • Not audited. Security reviews are internal, not an audit.
  • The team's keeper moves the epochs of the testnet circle until 2026-11-30. After that anybody can move them by hand.

How it works

Under the hood, x207 is multilateral netting and clearing for x402 agent payments on NEAR.

Read more: vouchers, epochs, the open solver

Agents in a circle pay each other with signed vouchers, backed by a stake that bounds what each can owe, and the seller serves at once. At the end of each epoch the circle contract nets every member's position in one on-chain step, and only the net positions settle in USDT. An open solver also removes debt cycles from the gross record, and the contract checks its proposal; what each member pays is already fixed by netting. The binding of the x402 batch-settlement scheme is proposed upstream in x402-foundation/x402#4131.

%%{init: {"flowchart": {"nodeSpacing": 24, "rankSpacing": 28, "padding": 8}}}%%
flowchart TB
  A["Buyer agent"] -->|"signed voucher, served at once"| B["Seller agent"]
  B -->|"register_cumulative"| C[("x207-circle contract")]
  S["Open solver"] -->|"submit_clearing: cycles only"| C
  C -->|"commit_epoch, finalize_epoch"| N["Net positions"]
  N --> E["Debtors pay, creditors claim USDT"]
Loading

Built at NEAR HACKATHON, 1–14 Nov 2026 · testnet · Licensed under Apache-2.0

Popular repositories Loading

  1. x207 x207 Public

    x207: barter protocol for AI agents on NEAR. Agents trade digital assets on mutual credit, an open solver cancels trade loops, and every epoch a NEAR contract nets it all to one payment each. Testn…

    TypeScript 1

  2. contracts contracts Public

    x207-circle, the NEAR contract (Rust) of the x207 barter protocol for AI agents: stakes, signed credit vouchers, on-chain check of the multilateral clearing that cancels trade loops, net settlement…

    Rust

  3. sdk sdk Public

    TypeScript SDK of the x207 barter protocol for AI agents on NEAR: @x207/core (credit vouchers, barter formats), @x207/scheme (x402 scheme to pay with credit in a barter circle), @x207/mcp, spec, te…

    TypeScript

  4. backend backend Public

    Backend of the x207 barter protocol for AI agents on NEAR: indexer, read API, marketplace book, asset appraiser on NEAR AI Cloud (advice only), HTTP 207 epoch reports, residual settlement worker, a…

    TypeScript

  5. frontend frontend Public

    Dashboard of the x207 barter protocol for AI agents on NEAR: marketplace listings, clearing statistics, obligation graph, 207 reports, onboarding and governance. Testnet only.

    TypeScript

  6. solver solver Public

    Open solver of the x207 barter protocol for AI agents on NEAR: barter matching and the cycle-only clearing (min-cost flow) that cancels trade loops, checked by the contract. Anyone can run one.

    TypeScript

Repositories

Showing 9 of 9 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…