{"id":50490877,"url":"https://github.com/melonask/x402-skills","last_synced_at":"2026-06-02T02:31:19.431Z","repository":{"id":353407893,"uuid":"1216331859","full_name":"melonask/x402-skills","owner":"melonask","description":"HTTP 402 Payment Protocol Skill","archived":false,"fork":false,"pushed_at":"2026-05-01T02:34:14.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-01T04:15:33.999Z","etag":null,"topics":["402","protocol","rust","skills","x402","x402-agent","x402-payment"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/melonask.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-20T19:54:29.000Z","updated_at":"2026-05-01T02:34:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/melonask/x402-skills","commit_stats":null,"previous_names":["melonask/x402-skills"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/melonask/x402-skills","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melonask%2Fx402-skills","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melonask%2Fx402-skills/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melonask%2Fx402-skills/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melonask%2Fx402-skills/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/melonask","download_url":"https://codeload.github.com/melonask/x402-skills/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melonask%2Fx402-skills/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33803734,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["402","protocol","rust","skills","x402","x402-agent","x402-payment"],"created_at":"2026-06-02T02:31:18.676Z","updated_at":"2026-06-02T02:31:19.425Z","avatar_url":"https://github.com/melonask.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# x402-skills\n\nA comprehensive skill for the LLM that enables building solutions with the [x402 protocol](https://www.x402.org) and the [x402-rs](https://github.com/x402-rs/x402-rs) Rust library. The x402 protocol activates the long-dormant HTTP `402 Payment Required` status code to enable blockchain payments directly through HTTP — the client never touches the blockchain, and the facilitator handles all on-chain operations.\n\n## Overview\n\nWith this skill, the LLM developer can:\n\n- **Create paid API services** — Protect Axum routes behind blockchain micropayments using `x402-axum` middleware. Accept any ERC-20 token, SPL token, or Aptos coin across EVM, Solana, and Aptos blockchains.\n- **Build paying agents** — Create `reqwest` clients that transparently handle x402 payments when accessing paid data endpoints, with automatic signature generation and retry logic.\n- **Run and customize facilitators** — Deploy production facilitators via Docker or from source, or build fully custom facilitators with programmatic verify/settle access.\n- **Implement gasless payments** — Leverage the full gasless stack: EIP-3009 (preferred), Permit2 (universal fallback), and EIP-2612 gas sponsoring.\n- **Support smart wallets** — Handle EOA, EIP-1271 (deployed smart wallets), and EIP-6492 (counterfactual wallets) seamlessly.\n- **Work with any token** — Not limited to USDC. Any ERC-20 token, SPL token, or native coin can be used as payment.\n\n## Installation\n\n```bash\nnpx skills add melonask/x402-skills\n```\n\n## File Structure\n\n```text\nx402/\n├── SKILL.md                          # Main entry point (336 lines)\n│   ├── Protocol overview \u0026 3-actor diagram\n│   ├── Crate architecture table\n│   ├── Quick-start routing guide\n│   ├── Minimal working examples (server, client, multi-chain)\n│   ├── Key concepts (any token, gasless, V1 vs V2, price tag types)\n│   ├── Installation patterns (server, client, facilitator)\n│   ├── Common patterns (dynamic pricing, multi-chain, settlement timing)\n│   └── Reference file routing\n│\n└── references/\n    ├── server-guide.md                # Axum middleware — protecting routes (294 lines)\n    ├── client-guide.md                # Reqwest middleware — auto-paying agents (253 lines)\n    ├── facilitator-guide.md           # Facilitator setup \u0026 custom builds (358 lines)\n    ├── chain-config.md                # Networks, tokens, RPC, feature flags (250 lines)\n    ├── protocol-details.md            # V1/V2, gasless stack, smart wallets (365 lines)\n    └── custom-scheme-guide.md         # Custom schemes \u0026 EIP-7702 implementation (150 lines)\n```\n\nThe skill uses **progressive disclosure**: the `SKILL.md` main file stays concise (under 500 lines) while detailed guides are organized into domain-specific reference files that are loaded on demand.\n\n## Supported Blockchains\n\n| Chain             | Networks                                                                  | Protocol Versions | Payment Methods                     |\n| ----------------- | ------------------------------------------------------------------------- | ----------------- | ----------------------------------- |\n| **EVM (EIP-155)** | Base, Polygon, Avalanche, Sei, Celo, XDC, XRPL EVM, Peaq, IoTeX, and more | V1 + V2           | EIP-3009, Permit2                   |\n| **Solana**        | Mainnet, Devnet                                                           | V1 + V2           | SPL Token pre-signed transfer       |\n| **Aptos**         | Mainnet, Testnet                                                          | V2                | Fungible asset transfer (sponsored) |\n\n## Quick Examples\n\n### Protect a Route (Server)\n\n```rust\nuse x402_axum::X402Middleware;\nuse x402_chain_eip155::{V2Eip155Exact, KnownNetworkEip155};\nuse x402_types::networks::USDC;\n\nlet x402 = X402Middleware::new(\"https://facilitator.x402.rs\");\n\nlet app = Router::new().route(\n    \"/paid-content\",\n    get(handler).layer(\n        x402.with_price_tag(V2Eip155Exact::price_tag(\n            address!(\"0xYourWallet\"),\n            USDC::base_sepolia().amount(10u64),\n        ))\n    ),\n);\n```\n\n### Auto-Pay for Data (Client)\n\n```rust\nuse x402_reqwest::{X402Client, ReqwestWithPayments, ReqwestWithPaymentsBuild};\nuse x402_chain_eip155::V2Eip155ExactClient;\n\nlet client = Client::new()\n    .with_payments(\n        X402Client::new()\n            .register(V2Eip155ExactClient::new(signer))\n    )\n    .build();\n\n// Payments handled transparently\nlet res = client.get(\"https://api.example.com/protected\").send().await?;\n```\n\n### Run a Facilitator (Docker)\n\n```bash\ndocker run -v $(pwd)/config.json:/app/config.json -p 8080:8080 \\\n  ghcr.io/x402-rs/x402-facilitator\n```\n\n## x402-rs Crate Overview\n\n| Crate                    | Published | Purpose                                                               |\n| ------------------------ | --------- | --------------------------------------------------------------------- |\n| `x402-types`             | crates.io | Core types, facilitator traits, CAIP-2 chain IDs, wire format (V1/V2) |\n| `x402-axum`              | crates.io | Axum middleware for protecting routes with payments                   |\n| `x402-reqwest`           | crates.io | Reqwest middleware for transparent payment handling                   |\n| `x402-facilitator-local` | crates.io | Local facilitator implementation                                      |\n| `x402-chain-eip155`      | crates.io | EVM/EIP-155 chain support                                             |\n| `x402-chain-solana`      | crates.io | Solana chain support                                                  |\n| `x402-chain-aptos`       | git-only  | Aptos chain support                                                   |\n| `x402-facilitator`       | git-only  | Production facilitator binary                                         |\n\n## Protocol Highlights\n\n- **Gasless for clients** — The client only produces an off-chain cryptographic signature. The facilitator pays gas.\n- **Trust-minimized** — The facilitator cannot modify the payment amount or destination (locked by the client's signature).\n- **Any token** — Works with any ERC-20 token, SPL token, or fungible asset, not just USDC.\n- **Zero protocol fees** — Only nominal payment network fees.\n- **V1 and V2** — Full backward compatibility; V2 adds CAIP-2 chain IDs, multi-chain, and extensible schemes.\n\n## References\n\n- [x402 Protocol Specification](https://www.x402.org)\n- [x402-rs GitHub Repository](https://github.com/x402-rs/x402-rs)\n- [Coinbase x402 Documentation](https://docs.cdp.coinbase.com/x402/docs/overview)\n- [CAIP-2 Chain IDs](https://chainagnostic.org/CAIPs/caip-2)\n- [EIP-3009: transferWithAuthorization](https://eips.ethereum.org/EIPS/eip-3009)\n- [Permit2 by Uniswap](https://github.com/Uniswap/permit2)\n\n## License\n\nThis skill documentation is provided for use with the x402 protocol ecosystem. The x402-rs library itself is licensed under Apache-2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelonask%2Fx402-skills","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelonask%2Fx402-skills","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelonask%2Fx402-skills/lists"}