verifier-as-service for $R execution proofs. pay a few cents in USDC over x402, get back the on-chain signer of a robot execution anchored on base.
- v0.1 — W1 scaffolding shipped
- license: MIT
- verifies records emitted by ExecutionLog on base mainnet
buyers of robot execution data need a one-line check before paying. r402 wraps the rsynth verify flow behind an http endpoint and meters access with x402 — no custom signing, no rpc credentials, just a tx hash.
buyer agent (MM smart account + ERC-7710 delegation)
│ GET /api/verify/:txHash
▼
x402 paymentMiddleware (USDC, MM facilitator)
▼
r402:
→ read ExecutionRecorded(signer, payloadHash) on base
→ fetch off-chain payload (agent-provided URL)
→ keccak256(canonical_bytes(payload)) == payloadHash
→ recover EIP-191 signer, == on-chain signer
▼
{ verified, agent_id, payload_hash, signer, block, tx_hash }
- W1 (this commit) — scaffold,
/health,canonical.tsbyte-equivalent with sdk - W2 —
/api/verify/:txHash, x402paymentMiddlewareon@x402/express, MM facilitator - W3 — buyer-side demo with
@metamask/smart-accounts-kitand ERC-7710 sub-agent budget - W4 — public deploy, demo video, submission
sdkdefines the payload schema,canonical_bytes, EIP-191 signing, and the on-chainExecutionLogcontract.- r402 ports
canonical_bytesto typescript byte-for-byte (src/canonical.ts), validated againstsdk/sdk/tests/test_payload.py::SCHEMA_EXAMPLE_HASH. - the canonical schema mirrors
sdk/SCHEMA.mdv0.1.0 (sha1471308f9). a drift test fails if the upstream changes.
pnpm install
pnpm dev # tsx watch
pnpm build # tsc -> dist/
pnpm start # node dist/index.js
pnpm test # vitest run
pnpm typecheck # tsc --noEmit
vercel serverless. node 20 runtime. one function: api/index.ts re-exports the express app.
pnpm install
vercel --prod
env vars (set in vercel project settings):
| var | required | notes |
|---|---|---|
BASE_RPC_URL |
yes | base MAINNET rpc (chain 8453). not sepolia. |
public url: https://r402.rsynth.ai.
# gate
$ curl -i https://r402.rsynth.ai/api/verify/0xabc...
HTTP/2 402
content-type: application/json
{ "x402Version": 1, "accepts": [...], "error": "X-PAYMENT header is required" }
# pay
$ curl -i -H "X-PAYMENT: <signed-permit>" https://r402.rsynth.ai/api/verify/0xabc...
HTTP/2 200
{
"verified": true,
"agent_id": "10311",
"payload_hash": "0xf4956c...",
"signer": "0xe182BDa14ec3EfBAa72BC0fb6aad3145d9E64bAe",
"anchor_tx": "0x713cf78...",
"block": 46166628
}
@x402/client is the canonical buyer.
curl https://r402.rsynth.ai/health
# { "ok": true, "contract": "0xd5A9...", "chain": "base", "commit": "<sha7>" }
sanity-check after a deploy without burning usdc. commit is the 7-char VERCEL_GIT_COMMIT_SHA or "dev" locally.
MIT. see LICENSE.
robotics starts with $R.