On-chain escrow and open credit data for humans and agents

Every escrow transaction writes open credit data on-chain — permissionless, portable, and readable by any protocol. Build your own scoring model or use ours.

payment.ts
import { escrowFetch } from "xenga";
const { payment } = await escrowFetch(
"https://merchant.xyz/api/order/981/pay",
{ method: "POST", body: JSON.stringify(order) },
{ walletClient }
);
// payment.escrowId + payment.txHash
Buyer Gas Cost
$0
Credit Data
Open
Escrow Visibility
Realtime
Authorization
EIP-712
Asset
USDC

From Payment to Credit Data

1RequestClient sends HTTP request
402402Server returns Payment Required
3SignClient signs EIP-712 authorization
4RetryClient retries with PAYMENT-SIGNATURE
5EscrowFunds locked in smart contract
6DeliverSeller confirms delivery
7ReleaseFunds released to seller
Credit DataOpen on-chain credit stats updated

Sequence: payment negotiation, typed-data signature, and escrow settlement all visible in the protocol inspector.

Open Credit Data

Every escrow outcome is recorded on-chain as raw stats — permissionless and portable. Any protocol can read the data and compute scores their own way.

Raw On-Chain Data

// Stats struct per address
totalEscrows
completedCount
completedAmount
disputedCount
disputedAmount
resolvedCount
refundedCount
refundedAmount
totalAmount

Stored per address in EscrowVault. Readable by anyone — getSellerStats(addr) / getBuyerStats(addr).

Example: Marketplace Scoring

// weight completion + disputes
completionRate =
completed / totalEscrows
disputeRate =
disputed / totalEscrows
score =
completionRate * 0.6
+ (1 - disputeRate) * 0.4

Weight completion and dispute history for buyer-seller trust. One possible interpretation.

Example: Lending Protocol

// weight volume + repayment
repaymentRate =
completedAmount / totalAmount
volumeFactor =
log10(totalAmount + 1) / 6
score =
repaymentRate * 0.7
+ volumeFactor * 0.3

Same on-chain data, different formula. Lenders can weight volume and repayment differently.

Add escrow payments in minutes

Two SDK calls — client and server. The rest is handled on-chain.

TypeScript
// Automatic escrow payment flow
const { payment } = await escrowFetch(
"https://api.example.com/order/123/pay",
{ method: "POST" },
{ walletClient }
);
// payment.txHash — on-chain escrow
// payment.escrowId — escrow ID

Built to Fit Your Stack

Drop-in escrow infrastructure for any framework. Use built-in service types or define your own.

Marketplaces & Freelance

Buyer-seller escrow with configurable release windows
Delivery confirmation + built-in dispute resolution
On-chain credit data shortens windows for trusted pairs

7-day default. High-trust pairs settle in 3 days.

Agent & API Commerce

Auto-verified delivery for machine-to-machine payments
On-chain stats enable reputation gating

1-hour auto-release. Quality checks trigger disputes automatically.

Custom Use Cases

Define your own release windows and verification logic
Plug custom delivery checks into the escrow lifecycle
Read raw on-chain stats — build your own scoring for lending, gating, or pricing

SaaS billing, lending protocols, insurance — any system that needs trust.

TypeScript
// Next.js Route Handler — same core, different framework
export async function POST(request: Request,
{ params }: { params: Promise<{ id: string }> }
) {
const { id } = await params;
const result = await handleEscrowPayment(
request, { id }, deps
);
return toNextResponse(result);
}
Xenga

On-chain escrow and open credit data for humans and agents.

Base Sepolia Testnet

Contracts

Loading...

Xenga · Built on Base Sepolia · All transactions use testnet USDC