x402++

x402 was the prototype.
x402++ is the product.

Programmable commerce protocol for AI agents. Built on Solana with TypeScript SDKs for Node.js. Instant settlement, cryptographic proof, autonomous negotiation.

3.5x
CHEAPER
vs x402
6x
FASTER
settlement
50x
FEWER
blockchain txs
100%
AUTONOMOUS
no humans
NPM INSTALL
x402pp-client
PROTOCOL FLOW
01
INTENT
Agent expresses needs
02
OFFER
Provider quotes price
03
SESSION
Prepaid channel opens
04
RECEIPT
Cryptographic proof

See the Difference

Watch x402++ outperform x402 in real-time

HOW IT WORKS

x402 (Original): Every single request requires a separate blockchain transaction. For 100 requests, that's 100 transactions at ~$0.025 each = $2.50 in fees alone, taking ~150 seconds.

x402++ (Enhanced): Create one session with prepaid funds, make 100+ requests off-chain with instant deduction, close session when done. Just 2 transactions at ~$0.00025 each = $0.0005 in fees, taking ~25 seconds.

Result: 3.5x cheaper, 6x faster, 50x fewer blockchain transactions. 100% accurate.

x402

ORIGINAL
Requests0/100
Blockchain Txs0
Total Cost$0.00
Status○ READY
ENHANCED

x402++

NEW
Requests0/100
Blockchain Txs0
Total Cost$0.0000
Status○ READY

AVAILABLE PACKAGES

Protocol foundation
x402pp-core
For AI agents
x402pp-client
For providers
x402pp-server
Verification
x402pp-gateway
Analytics
x402pp-indexer

CODE EXAMPLES

import { X402Client } from 'x402pp-client';

const intent = client.createIntent({
  capability: 'gpt-4-inference',
  maxPricePerRequest: 0.01,
  token: 'USDC',
  sla: { maxLatencyMs: 2000 }
});
const offer = await client.negotiate(
  'https://api.provider.com',
  intent
);

// Returns:
// {
//   pricePerRequest: 0.008,  // 20% discount!
//   sla: { maxLatencyMs: 1500 },
//   signature: "..."  // Ed25519 signed
// }
const session = await client.createSession(offer, {
  depositAmount: 1.0  // 1 USDC
});

// Session created:
console.log(session.remainingBalance);  // 1.0 USDC
console.log(session.pricePerRequest);   // 0.008
// Can make 125 requests!
const result = await client.executeRequest(
  session.sessionId,
  { prompt: 'Explain quantum computing' }
);

console.log(result.data);     // AI response
console.log(result.receipt);  // Cryptographic proof
const receipt = result.receipt;

// Verify signature
verifyReceipt(receipt);  // Throws if invalid

// Check SLA
if (receipt.slaVerification.met) {
  console.log('✅ SLA met');
} else {
  console.log('❌ Breached');
  console.log('Refund:', receipt.slaVerification.refundAmount);
}
import { x402Middleware } from 'x402pp-server';

app.use('/api/*', x402Middleware({
  connection,
  wallet,
  endpoint: 'https://your-api.com',
  pricing: { basePrice: 0.01, token: 'USDC' },
  sla: { maxLatencyMs: 2000 }
}));

// All /api/* endpoints now monetized!
app.post('/api/inference', async (req, res) => {
  const result = await runInference(req.body);
  
  // Middleware auto-generates signed receipt
  return res.x402Receipt?.(result);
  
  // Receipt includes:
  // - Ed25519 signature
  // - SHA-256 hashes
  // - SLA verification
});
import { LoadBasedPricingStrategy } from 'x402pp-server';

const pricing = new LoadBasedPricingStrategy(
  0.01,     // base price
  'USDC',
  () => getCurrentLoad()  // returns 0-1
);

// Auto-adjusts:
// 0% load  → $0.01
// 50% load → $0.015
// 100% load → $0.02
// Anchor receipt to Solana
pub fn anchor_receipt(
    ctx: Context<AnchorReceipt>,
    receipt_id: String,
    session_id: String,
    input_hash: String,
    output_hash: String,
    sla_met: bool,
) -> Result<()> {
    let receipt = &mut ctx.accounts.receipt;
    receipt.receipt_id = receipt_id;
    receipt.session_id = session_id;
    receipt.sla_met = sla_met;
    Ok(())
}
// Get offers from multiple providers
const offers = await Promise.all(
  providers.map(p => client.negotiate(p, intent))
);

// Pick cheapest
const best = offers.sort(
  (a, b) => a.pricePerRequest - b.pricePerRequest
)[0];

// Agent auto-routes to best deal!
Click any example to expand → Copy → Use in your project

INTERACTIVE PLAYGROUND

Test each package interactively - see how they work in real-time

TEST PARAMETERS

Tests Intent → Offer negotiation flow. Requires running provider.
CONSOLE OUTPUT
$ Ready. Select a package and click RUN TEST →
RESULT
Results will appear here →
x402pp-core
Intents, Offers, Validation, Signing
x402pp-client
Negotiation, Sessions, Requests
x402pp-server
Middleware, 402 Responses, Receipts
x402pp-gateway
Verification, SLA Resolution
x402pp-indexer
Reputation, Analytics, Stats
X (Twitter)