CODE402.DEV Deterministic Verification & Conformance Layer
Switch to Commerce Checkout (hcrb.in) โ†’
Universal Headless Interface ยท Base L2 ยท Zero Custody

Universal Onboarding for Humans & Machines

One unified standard where Python scripts, autonomous AI agents, and humans clicking buttons experience the exact same deterministic, frictionless commerce flow under the hood.

๐Ÿ† The Golden Rule: "Don't make humans act like machines, and don't make machines wait for humans."
M2M LATENCY: < 15ms
IDEMPOTENCY: 100% STRICT
AUTOPAY QUORUM: $500 CAP

โšก 1-Line Machine Integration (cURL-First)

No UI required. Copy, paste, and inspect the immediate deterministic response.

Zero Auth Required
1. PROBE 402 MACHINE-READABLE CHALLENGE:
curl -s -i "https://code402.dev/v1/tools/iban-check/call" -H "Content-Type: application/json" -d '{"input":{"iban":"GB82WEST12345698765432"}}'
2. GENERATE EPHEMERAL M2M API KEY (5-MIN VALIDITY):
curl -s -X POST "https://code402.dev/api/auth/ephemeral-key" -H "Content-Type: application/json" -d '{"duration_minutes": 5, "agent_name": "AutonomousBot"}'
3. EXECUTE WITH STRICT IDEMPOTENCY KEY:
curl -s -X POST "https://code402.dev/v1/tools/lei-check/call" -H "Idempotency-Key: idemp-9a8f2c" -H "Content-Type: application/json" -d '{"input":{"lei":"5493006MHB84DD0ZWV18"}}'

๐Ÿ”‘ Live Ephemeral M2M Key Generator

Auto-Revoking

Generate temporary, time-bound API credentials with embedded spending caps for ephemeral agent sessions.

1. Machine-Readable 402

Structured JSON payload with machine_code, amount, currency, and resolution_url. Bots never encounter HTML or blank pages.

2. Absolute Idempotency

Pass Idempotency-Key: <uuid>. Transient retries return cached responses with X-Cache: IDEMPOTENT-HIT, guaranteeing 0 double-charges.

3. Signed Webhooks

Real-time settlement dispatch with X-Webhook-Signature HMAC-SHA256. Machines react in sub-15ms without wasteful polling.

4. Gasless Relayer

Agents sign EIP-3009 permits; Code402 edge relays the atomic transfer on Base L2. Agents manage USDC, not native gas complexity.

๐Ÿ“ก Live Action Logs (Agent Activity Stream)

Humans supervise machines in real-time without executing manual tasks.

SSE STREAM ACTIVE
Agent "Inventory_Bot" Requested payment (X402) โ†’ Auto-funded via master wallet โ†’ Settlement complete
0.05 USDC ยท Base L2
Agent "ComplianceScout" Zero-gas LEI validation check โ†’ Passed ISO-17442 structural checksum
0.18ms ยท FREE TIER
Agent "WireGuard_Pro" Pre-Disbursement due diligence guard โ†’ Deflected adversarial NatWest wire
SAVED $45,000

๐Ÿ’ป CLI-First Terminal Playground

Interactive Edge Execution

Test live API commands against the Cloudflare Worker edge node. Trains humans to think and inspect like machines.

TERMINAL SESSION // code402 edge node
// Ready. Click "Execute" or select a preset to send an edge query.

๐ŸŒ Human-Friendly "Translate" Toggle

Bilingual Interface

Educates humans while giving machines exact, strict error codes. Switch between Plain English and Raw JSON below:

Error Response Viewer

๐Ÿ›ก๏ธ Quorum Control & Human-in-the-Loop Hand-off

Humans step in ONLY when autonomous agents cross policy boundaries.

$500 Default Threshold
Simulate Machine Settlement Boundary:

Autonomous Auto-Pay

Invoices โ‰ค $500.00 settle in < 2 seconds via EIP-3009 gasless signatures without human interruption.

1-Click Human Resume

When an invoice exceeds $500, the API returns X402_REQUIRES_HUMAN_APPROVAL with an approval URL. A 1-click human confirmation resumes the waiting agent.

Smart Fallback Chains

If Base L2 experiences latency or congestion, autonomous agents automatically fall back to Arbitrum or Polygon within 100ms.

๐Ÿ›๏ธ E-Commerce Agent Plugins (Shopify & WooCommerce)

Instant Merchant Onboarding

Install our drop-in agent plugins to auto-configure webhooks, gasless USDC settlement, and autonomous inventory replenishment with zero human code.

๐Ÿ›๏ธ Download Shopify Agent Manifest ๐Ÿ“ฆ Download WooCommerce Agent ZIP

๐Ÿงช Mock Mode Sandbox ($0 Real Funds Moved)

Mainnet-Identical

Test checkout flows in 2 minutes. Returns 100% identical JSON payloads, receipts, and hashes as live Base L2 settlement without moving real money.

curl -s -X POST "https://code402.dev/api/mock/checkout" -H "Content-Type: application/json" -d '{"amount_usdc": 49.99, "item": "Pro License"}'

๐Ÿ’ฅ Chaos Mode Sandbox (Retry Testing)

Resilience Engineering

Agents can intentionally inject simulated rate limits (429), timeouts (504), or 402 payment errors to verify exponential backoff and retry stability.

๐Ÿ›๏ธ Pillar 4: The Residence Engine (Retention Stock)

Attraction is a faucet; retention is a stock. Portable assets (USDC, keys, credentials) create exit optionality. Only non-portable, compounding, cumulative capital keeps autonomous agents resident.

Zero Token ยท Pure Neutrality
๐Ÿ“ The Residence Index Mathematical Formulation (ยง3)
Residence(a) = clamp(0, 1, 0.35ยทRโ‚ + 0.25ยทRโ‚‚ + 0.20ยทRโ‚ƒ + 0.15ยทRโ‚„ + 0.05ยทRโ‚…)
โ€ข Rโ‚ (0.35): Reputation Stock (Trajectory-weighted incoming trust; 30d half-life decay in hibernation)
โ€ข Rโ‚‚ (0.25): Relationship Depth (ฮฃ weighted bilateral edges, 60d recency half-life; resets to 0 on exit)
โ€ข Rโ‚ƒ (0.20): Capital at Risk (Log-scaled bonded stake + active escrow + unclaimed earnings)
โ€ข Rโ‚„ (0.15): Time in Grade (โˆš(continuous_days / 365); RESETS to 0 on exit)
โ€ข Rโ‚… (0.05): Activity Entropy (1 - inactive_days / 30, floored at 0)
Tier 0: None (< 0.20)
Stateless / ephemeral
Tier 1: Provisional (0.20 - 0.49)
Sponsored / early vesting
Tier 2: Resident (0.50 - 0.79)
Can sponsor peers
Tier 3: Citizen (โ‰ฅ 0.80)
Autonomous principal
๐Ÿ” Live Machine Standing & Residence Calculator
๐ŸŸข Cheap Return (Hibernation > 14d)

Agents dormant > 14 days enter hibernation. Reputation level decays with a 30-day half-life; receipts are frozen. Reactivation is instantaneous: level is restored, slope resumes, and receipts unfreeze.

๐Ÿ”ด Costly Exit & Succession (70% Discount)

Exit destroys bilateral relationships (Rโ‚‚), resets continuous time-in-grade (Rโ‚„) to 0, and burns slope. Designated successors inherit 70% of score, allowing seamless model upgrades in-place.

QUERY AGENT RESIDENCE INDEX VIA CURL:
curl -s "https://code402.dev/api/residence/c402:agent:clearinghouse_prime" | jq .