🛰️ Two Prompts, Zero Crypto Setup: How n-payment Lets Your AI Agent Pay for Residential Proxy in $SPACE on Creditcoin
TL;DR — In two natural-language prompts, your AI agent pays per-byte for a residential IP, settles on Creditcoin, and gets back the data. No 402-handlers, no
parseUnitsmath, no manual top-ups.NPM = https://www.npmjs.com/package/n-payment
🚨 The problem every public-web AI agent hits at hour 1
Cloudflare 1010 / 1020 / cf-ray bot blocks pre-emptively reject every datacenter IP (AWS / GCP / OVH / Vercel / Fly).
Premium proxies charge $7–$15/GB, bill monthly via card, and ship zero on-chain audit trail.
Agents need to pay per-call, not per-month — and they need to pay programmatically without holding a credit-card vault.
Result: half your agent’s requests silently fail, or you quietly burn a budget you can’t reconcile.
🎯 The wedge: two prompts, zero crypto setup
The canonical agent UX, end to end:
🗣️ Prompt 1 → “check my balance on creditcoin-mainnet”
SDK reads $SPACE escrow balance on Creditcoin L1.
Returns structured JSON the agent can route on.
🗣️ Prompt 2 → “pay for httpbin.org/ip via SpaceRouter, region KR, residential”
SDK signs an EIP-712 receipt for the request.
Routes the call through a real residential IP via SpaceRouter.
Returns the body, the
nodeId, and therequestIdto the agent.
That’s it. No code generation, no key management UI, no contract calls written by hand.
🧱 What “zero crypto setup” actually guarantees
✅ No
parseUnits(amount, 6)mistakes. The SDK pinsSPACE_DECIMALS = 18once and exportsparseSpace/formatSpace. USDC is 6 decimals; SPACE is 18; the SDK never lets that gap leak into agent code.✅ Zero-balance preflight. If the wallet has no $SPACE, the SDK throws
SR_ESCROW_EMPTYbefore any network call — with a hint that prints the exactclient.deposit(parseSpace('1'))snippet.✅ Named errors with hints. Every gateway failure (
SR_AUTH_FAILED,SR_RATE_LIMITED,SR_NO_PROVIDERS,SR_PROVIDER_UNREACHABLE,SR_PEER_DEP_MISSING) carries a sentence the agent can read aloud and act on.✅ 5-day timelock-protected escrow. Withdrawals are intentional, settlements are bounded, and provider receipts have time to finalize before consumer drains.
⛔ The SDK never auto-funds the wallet. “Zero crypto setup” means zero crypto code — not auto-onramp. Funding the wallet stays the operator’s call.
🌐 Why Creditcoin + Spacecoin + SpaceRouter? (the stack)
🛰️ Spacecoin (@spacecoin) is a DePIN project building a decentralized LEO satellite + residential bandwidth network. CTC-0 beamed an encrypted blockchain tx Chile→Portugal in Oct 2025.
💳 Creditcoin (@creditcoin) is the L1 where $SPACE settles (chainId
102030mainnet,102031cc3-testnet). EVM-compatible, 9 years of mainnet uptime, 5M+ on-chain credit transactions.🛡️ SpaceRouter is the residential-proxy gateway. Operators stake at least 1 $SPACE, run the desktop app, and earn $SPACE per byte served.
🪙 $SPACE token — fixed 21B supply, 18 decimals, mainnet contract
0x7ab7C6A935Ab2D1437398790C9C0660af62A80b9. TGE Jan 2026.👤 One founder for both — Tae Lim Oh (taelimoh.com) is core contributor to both Creditcoin and Spacecoin. One stack, one BD relationship, one CEIP lane.
🏗️ Architecture in 30 seconds
🤖 Agent →
skills/pay-spacerouter.sh(orexamples/spacerouter-quickstart.tsfor raw TS).🔐
SpaceRouterClientorchestrates: signer → escrow → gateway → receipt scheduler.💾
SpaceRouterEscrowClienttalks toTokenPaymentEscrow(mainnet0xC130F5D76f0b4Ce8FE2ceA0D2C2b8f53A39a5cd0): deposit, balanceOf, initiateWithdrawal, executeWithdrawal (5-day timelock-aware), cancelWithdrawal.✍️
SpaceRouterSigner(Keypair / OWS / Browser) signsReceipttyped-data:{ consumer, gateway, requestUuid, bytesServed, priceWei, expiresAt }.📡
SpaceRouterGatewayClient+SpaceRouterReceiptSchedulerpush leg-1 receipts togateway.spacerouter.org:8081/leg1/syncin idempotent batches.🔁
SpaceRouterAdapter.shouldFallback()is the killer move: whenproxy: 'auto', an HTTP403/429/503withcf-ray(or a bare451) auto-routes the next try through SpaceRouter. The agent never knows it was blocked.
Agent prompt
↓
skills/pay-spacerouter.sh (the "two prompts" entry)
↓
examples/spacerouter-quickstart.ts (TS wrapper)
↓
SpaceRouterClient.fetch() (preflight + sign + route + buffer receipt)
↓
TokenPaymentEscrow on Creditcoin + gateway.spacerouter.org
↓
Residential IP → target API → 200 OK💻 Try it in 30 seconds (testnet, read-only)
⚙️ Install:
npm install n-payment🪙 Set the wallet (testnet — get cc3-testnet $SPACE / CTC from a Creditcoin faucet):
export CREDITCOIN_PRIVATE_KEY=0x...📊 Prompt 1 → balance:
bash skills/pay-spacerouter.sh check-balance --chain creditcoin-testnet
# → {"ok":true,"data":{"chain":"creditcoin-testnet","consumer":"0x...","balanceSpace":"0", ...}}🚀 Prompt 2 → paid request through residential IP:
npm install @spacenetwork/spacerouter # peer dep, only for `pay`
bash skills/pay-spacerouter.sh pay \
--url https://httpbin.org/ip \
--region KR --ip-type residential \
--chain creditcoin-testnet
# → {"ok":true,"data":{"status":200,"nodeId":"...","requestId":"...","bodyPreview":"{...}"}}🔍 TypeScript equivalent (one screen):
import { CHAINS, SpaceRouterClient, KeypairSpaceRouterSigner, parseSpace } from 'n-payment';
const chain = CHAINS['creditcoin-mainnet'];
const signer = new KeypairSpaceRouterSigner(process.env.CREDITCOIN_PRIVATE_KEY as `0x${string}`);
const client = new SpaceRouterClient({
chain, signer,
escrowAddress: '0xC130F5D76f0b4Ce8FE2ceA0D2C2b8f53A39a5cd0',
tokenAddress: '0x7ab7C6A935Ab2D1437398790C9C0660af62A80b9',
privateKey: process.env.CREDITCOIN_PRIVATE_KEY as `0x${string}`,
region: 'KR', ipType: 'residential',
});
// (one-time, only if balance is 0): await client.deposit(parseSpace('1'));
const r = await client.fetch('https://httpbin.org/ip');
console.log(r.status, await r.text());
await client.close();🎁 What v0.20.0 ships (the wedge release)
🪙
parseSpace/formatSpace/SPACE_DECIMALS— the 18-decimal $SPACE invariant becomes an SDK guarantee, not a per-call gotcha.🛑 Zero-balance preflight in
SpaceRouterClient.fetch()— fails fast with an actionable hint before touching the peer-dep loader.🧭 Sharper gateway hints for every documented HTTP status (
402 / 407 / 429 / 502 / 503 / 504).🧪 Env-gated cc3-testnet integration test (
SR_INTEGRATION=1 pnpm test) — read-only, skipped in CI by default.📜 Runnable example
examples/spacerouter-quickstart.ts+ agent skillskills/pay-spacerouter.sh(mirrorspay-flare-x402.shJSON contract).📰 README rewrite — front door now leads with the wedge, not with x402-on-Base.
🚀 Why this is different from “just use x402 on Base”
🔗 x402 settles payments; it does not unblock the network. SpaceRouter solves the bandwidth half that no x402 facilitator covers.
🪐 DePIN-native settlement. $SPACE economy thickens with every byte served — a positive-sum loop between providers and buyers.
🌍 Emerging-market angle. Datacenter-IP blocks hurt agents in regions with cheaper hosting most. Residential-IP routing levels the field.
🧬 Cross-chain platform vision. Creditcoin’s Universal Smart Contracts (USC v2) let one Creditcoin contract verify state from Base, Solana, Polygon, etc. in one block — agent-reputation oracle is on the v0.21+ roadmap.
🗺️ Roadmap (90-day plan)
📅 M1 (live, today): v0.20.0 on npm — wedge surface, hardened error/hint surface, “two prompts” UX, README rewrite, PRD checked in.
📅 M2 (Day 60): hosted Gateway
agents.spacerouter.run(multi-tenant, $19/$49/$99 SaaS tiers + 0.5% volume fee) + 3 lighthouse paid MCPs (Creditcoin Research / SpaceRouter Provider Onboarding / Cloudflare-Block Bypass) + $1.5K MRR target.📅 M3 (Day 90): USC reputation oracle MVP on cc3-testnet + public dashboard + $5K MRR target + CEIP re-up conversation primed.
🔌 Related protocols n-payment supports today
x402 — agent paywall standard on EVM (Base, Arbitrum, BNB, Solana variants)
MPP — micropayment protocol (Tempo, Stellar Charge / Session)
GOAT x402 — BTC-backed x402 + USDC Acquisition Router
Stellar — Soroban + Trustless Work escrow
XRPL — RLUSD payments + native AMM auto-swap
Circle Nanopayments — gas-free sub-cent
AP2 — Google Agent Payments Protocol mandates
Aave — yield-bearing treasury + GHO + Flash Mint batching
Flare — FXRP bridge + x402 + gasless forwarder
Morph — HMAC x402 + Reference Key + Hoodi sponsored EIP-3009
SpaceRouter ✨ — residential-proxy bandwidth on Creditcoin (this article)
All of them are reachable through one fetchWithPayment() call.
📚 Resources & references
🧬 Universal Smart Contracts: https://docs.creditcoin.org/usc/
🛰️ Spacecoin in TechCrunch (Oct 2025): https://techcrunch.com/2025/10/02/spacecoin-beams-blockchain-transaction-through-space-in-bid-for-decentralized-internet/
🎬 The takeaway
Two prompts. Zero crypto setup. Real residential IPs. Per-byte settlement on Creditcoin. Open-source, MIT-licensed, on npm today.
If your agent has a 1010 in its logs, n-payment v0.20 is one npm install away from making that disappear.
Built by @phamnim. Backed (in spirit, applying now 😉) by the Creditcoin Ecosystem Investment Program.

