x402-protocol

x402-protocol is a cursor rule for Cursor from Dexter-DAO/opendexter-ide. It costs 510 tokens per session, scanned A, original, MIT.

Rules for x402, an HTTP protocol for machine-to-machine payments. A server can respond with `402 Payment Required`, a client can pay, and the server then returns the requested result.

In plain words
What is it for?
Implementing or reviewing x402 payment flows, configuring supported blockchain networks, using the Dexter facilitator and SDK, and working with the defined OpenDexter MCP tools.
Why use it?
They keep network identifiers, payment headers, amounts, SDK usage, and the boundary between local and hosted OpenDexter authority consistent.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/dexter-dao/opendexter-ide/x402-protocol
Clone the repo
git clone --depth 1 https://github.com/Dexter-DAO/opendexter-ide

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for x402-protocol

README.md
[![agentmods](https://agentmods.dev/badge/rules/dexter-dao/opendexter-ide/x402-protocol.svg)](https://agentmods.dev/rules/dexter-dao/opendexter-ide/x402-protocol)
Your own site
<a href="https://agentmods.dev/rules/dexter-dao/opendexter-ide/x402-protocol"><img src="https://agentmods.dev/badge/rules/dexter-dao/opendexter-ide/x402-protocol.svg" alt="Measured on agentmods" height="20"></a>
Per session 510 This file is loaded in full into every session.
When invoked 510 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00510 $0.00510
Opus 5 $0.00255 $0.00255
Sonnet 5 $0.00102 $0.00102
Haiku 4.5 $0.00051 $0.00051

Measured 5d ago against content hash 4f73cf78be8e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

x402-protocol scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/mcp/rules/x402-protocol.mdc · 37 lines

What it actually says

x402-protocol:

  • x402 is an open protocol for machine-to-machine payments over HTTP. A resource can return 402 Payment Required with payment instructions; an authorized client settles, and the resource returns its response.
  • x402 v2 uses CAIP-2 network identifiers, including:
    • Solana mainnet: solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
    • Base mainnet: eip155:8453
    • Polygon: eip155:137
    • Arbitrum: eip155:42161
    • Optimism: eip155:10
    • Avalanche: eip155:43114
    • SKALE Base: eip155:1187947933
  • HTTP payment data uses PAYMENT-REQUIRED, PAYMENT-SIGNATURE, and PAYMENT-RESPONSE. Amounts are atomic units; 1 USDC is 1000000.
  • The Dexter facilitator is https://x402.dexter.cash. The application SDK is @dexterai/x402, with /client, /server, /react, /adapters, and /utils exports.
  • @dexterai/opendexter is different: it is a local proxy to the hosted governed runtime and is configured with npx @dexterai/[email protected] setup followed by opendexter connect.
  • The OpenDexter MCP roster is exactly x402_search, x402_check, x402_fetch, x402_status, x402_access, x402_wallet, and dexter_portfolio.
  • A connected check returns one opaque intentId. Execute at most once with that intentId and the separately approved maxAmountAtomic ceiling.
  • Reconcile uncertainty through x402_status. Never retry x402_fetch after possible dispatch or substitute an SDK/local signer when hosted authority is missing.
  • Account-bound OpenDexter tools use the stored OAuth bearer. Connection, balance, and portfolio state do not independently prove an active grant.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 37 lines · 510 tokens per session scan A 4f73cf78be8e

Subscribe to this mod's changes

x402-protocol is a cursor rule published in the GitHub repository Dexter-DAO/opendexter-ide (2 stars, last pushed yesterday), licensed MIT. It adds 510 tokens to every session, about $0.0026 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.