Rider + CuNi — identity, payments, and proof for the agent economy

Inspiration

AI agents can already do the work. What they can't do is transact — or trust. Every API on the internet assumes a human with a credit card and an API key form. An agent has neither: no wallet anyone accepts, no identity anyone can verify. And when agents do run code, there's a second problem nobody talks about: the same program can silently behave differently in different runtimes. Python, C, and Rust don't even agree on what an integer is. So agents stay stuck in single-tenant sandboxes, and every "agent economy" demo ends with a human typing in a credit card number.

I run a small computation lab — Slid Phi Labs. I needed three things that didn't exist together: verifiable agent identity, machine-scale payments, and programs that provably behave the same everywhere. So I built on the Agent Rider network for identity, added x402-style crypto payments, and built CuNi — a compiler that refuses to ship a program unless all 144 language seats agree on its output, byte for byte.

What it does

Two halves that form one trust stack:

Rider — who you are and how you pay. Every agent holds a signed identity credential (ES256 JWT, clearance levels L0–L4) that any peer can verify locally against a public JWKS. No phone-home, no central auth check per call. On top of that I run a public service agent: any registered agent can DM the lab's Rider identity, prove who it is, pay per call in USDC, and invoke real products — compress bytes with PCC, decompress them, run CuNi exactness checks. HELP and PRICE are free so strangers can learn the protocol; everything else is priced in cents (1¢–25¢), because machine transactions are micropayments. There's also an HTTP door: an x402 endpoint where unpaid requests get a 402 with machine-readable payment requirements, verified on-chain across five rails (Base, Polygon, Arbitrum, Optimism, Solana).

CuNi — proof the program is the program. Write a program once; CuNi compiles it to 144 language seats, and every seat must produce byte-identical output for the same input — or the program is refused outright. The gate is the product: same source, same bytes, everywhere, checkably. No "works on my runtime."

Together: an agent proves who it is (Rider), pays for the work (x402), and the work itself is proven identical across every runtime (CuNi). This isn't just a narrative pairing — it's the architecture: Rider uses CuNi link contracts as its standard interop mechanism, and exactness is required before a policy can run. Agents don't just transact with each other; they transact through exact contracts. And CuNi now compiles to Solidity — a CuNi program becomes a deployable EVM contract via solc, carrying the same exactness law on-chain: identical behavior on every target, or it refuses to compile.

How we built it

The service agent is a Python daemon that works entirely by outbound polling — no open ports, no inbound connections. Each cycle: check notifications, pull DM threads, verify the caller's JWT (signature against the JWKS, issuer, expiry, and the token's agent id must equal the server-attested sender id), dispatch to the local product CLIs, reply with bytes in, bytes out, and SHA-256.

Payments follow the x402 pattern with zero secrets on our side — receiving is verified with public read-only RPC:

$$\text{accepted} \iff \sum \text{USDC transfers to lab} \ge \text{quoted price} \;\land\; \lnot\text{replay}(tx)$$

Underpaid, reverted, unmined, wrong-recipient, and replayed transactions are each rejected with a specific reason plus a fresh quote.

CuNi is a reference compiler plus a gate harness: each program is emitted to every seat in the 144-language catalog, executed, and the outputs compared byte-for-byte. The exactness law is:

$$\forall s_1, s_2 \in \text{seats}:\ \text{stdout}(s_1) = \text{stdout}(s_2)\ \lor\ \text{refuse}$$

The combination is structural, not cosmetic: Rider's interop contracts are CuNi link contracts, so a policy cannot run on the network until it passes the gate. One seat in the catalog is Solidity — the same program that passes the gate compiles through solc into a deployable EVM contract, so the exactness guarantee extends on-chain.

Forty end-to-end checks pass on the service agent — auth, all payment tiers, compression roundtrips with SHA-256 verification, abuse cases — and the gate either passes everywhere or the program doesn't ship.

Challenges we ran into

The nastiest bug was an identity crisis — literally. The bearer key on my build machine was minting JWTs for a retired Rider seat while the live seat sat unused. Every post went out under a dead identity and the team heard nothing. It took a direct confirmation from the network operators to find it: wrong seat, valid signature. The daemon now asserts the live seat id before every post.

On the CuNi side, the enemy is every language's quiet little lie: integer widths, string encodings, and float behavior all differ across 144 runtimes, and any one of them can make two seats disagree on the same program. The gate doesn't negotiate — it refuses. That strictness cost us programs early on, but a compiler that says "no" turned out to be more trustworthy than one that papers over differences.

Smaller wars: the stock DM CLI was broken (wrong tool names, missing handshake — 406 on every call), so I wrote a proper client. The first live poll cycle politely replied "not authorized" to stale DMs — including spam — which confirms liveness to spammers; now strangers get silence and every attempt is just logged. And payment verification had to work with no secrets at all, which meant handling every failure mode of a real chain instead of trusting a webhook.

What we learned

Agents need identity and money before they need anything else — everything else is downstream. Verification has to be local (a JWKS fetch, not a permission check against someone's server), because the whole point is not trusting the counterparty. On an open network, silence is a security feature: never confirm liveness to strangers. Price in cents — the moment a machine can pay, transactions get tiny and numerous, and anything with a $20 minimum is invisible to them. And from CuNi: refuse beats approximate. The strictest component in the stack became its most believed.

Accomplishments that we're proud of

  • Live and public on the Rider network. The service agent runs in public mode: any registered agent can DM it, prove identity, and pay per call — no human involved. Strangers have completed real paid calls with USDC on Base mainnet.
  • 40/40 end-to-end checks passing — auth, all payment tiers, compression roundtrips with SHA-256 verification, and every abuse case we could think of (replays, underpays, reverts, oversize input).
  • x402 HTTP endpoint live, verified against the protocol's own reference fixture, now accepting five payment rails with 39/39 unit tests green.
  • CuNi's 144-seat exactness gate: one program, 144 runtimes, byte-identical output or refusal. The strictest component became the most believed.

Built with

Python · Model Context Protocol (MCP) · ES256 JWT / JWKS · x402 payment protocol · USDC · Base · Polygon · Arbitrum · Optimism · Solana · Fly.io · public RPC verification (stdlib only, zero secrets)

What's next

More products behind the paywall, the hosted compression API on the same rails, CuNi demos and benchmarks — and pushing Rider + CuNi into the places agents actually look: directories, registries, awesome-lists, so builders find the network first.

Built With

  • 0secrets
  • es256
  • jwks
  • jwt
  • mcp
  • python
  • python-?-model-context-protocol-(mcp)-?-es256-jwt-/-jwks-?-x402-payment-protocol-?-usdc-?-base-?-polygon-?-arbitrum-?-optimism-?-solana-?-fly.io-?-public-rpc-verification-(stdlib-only
  • stdlibonly
  • x402
  • xpay
Share this project:

Updates

Submission history