Overview

LEXOracle x402 Facilitator provides AI-powered legal analysis with verifiable on-chain payments using the x402 protocol on Base mainnet.

Key Features

Base URL

https://x402.lexoracle.xyz

Endpoints

POST /api/mandate

Submit a legal case for AI analysis with payment

Request Body

{ "case_id": "MY-HC-2024-00123", "jurisdiction": "MY-Federal", "task": "judgment_recommendation", "inputs": { "lawset_refs": ["leg://my/acts/evidence"], "precedents_refs": ["case://my/CLJ/2018/456"], "issues": ["admissibility", "burden_of_proof"] }, "payment": { "amount": "25000000", "currency": "USDC", "authorization": { "type": "EIP-3009", "signature": "0x...", "validAfter": "0", "validBefore": "1735819200", "nonce": "0x..." } } }

Response

{ "success": true, "mandate_id": "MY-HC-2024-00123", "payment": { "verified": true, "tx_hash": "0x...", "amount": "25000000", "from": "0x...", "to": "0x..." }, "result": { "consensus": { "recommendation": "favor_plaintiff", "confidence": 87, "agreement_score": 92 }, "models_used": 5, "citations": [...], "reasoning": "...", "bias_metrics": { "model_disagreement": 8, "confidence_variance": 12 } } }
POST /api/verify

Verify an EIP-3009 payment signature

GET /.well-known/x402

x402 protocol discovery endpoint

GET /health

Health check endpoint

Jurisdictions

Code Description
MY-FederalMalaysia - Federal Court
MY-StateMalaysia - State Court
SG-HighSingapore - High Court
UK-SupremeUnited Kingdom - Supreme Court
US-FederalUnited States - Federal Court

Analysis Tasks & Pricing

Task Price (USDC) Description
judgment_recommendation 25.00 AI recommendation on case outcome
citation_verification 10.00 Verify legal citations accuracy
bias_analysis 15.00 Detect potential bias in arguments

Note Amounts in payment.amount field use 6 decimals (e.g., 25000000 = 25 USDC)

Payment Protocol

LexOracle uses EIP-3009 for gasless USDC transfers on Base mainnet.

Contract Addresses

Network Contract Address
Base Mainnet USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

Signature Generation

Client must sign EIP-712 message with wallet private key:

const domain = { name: 'USD Coin', version: '2', chainId: 8453, verifyingContract: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' }; const types = { TransferWithAuthorization: [ { name: 'from', type: 'address' }, { name: 'to', type: 'address' }, { name: 'value', type: 'uint256' }, { name: 'validAfter', type: 'uint256' }, { name: 'validBefore', type: 'uint256' }, { name: 'nonce', type: 'bytes32' } ] }; const signature = await wallet._signTypedData(domain, types, message);

Error Codes

Code Message Description
400Invalid mandateMissing or invalid request fields
402Payment requiredInvalid payment signature
500Processing failedAI backend error

Rate Limits

Currently no rate limits enforced. Production deployments should implement:

Support

For technical support or integration assistance, please contact: