[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DPQF0V6N4PP89H22TYHNF7":3,"skill-same:01M7DPQF0V6N4PP89H22TYHNF7":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":46},"01M7DPQF0V6N4PP89H22TYHNF7","agentic-payments",null,"Agentic and machine-to-machine payments on Stellar. Covers x402 (HTTP 402 paid APIs via OZ Channels facilitator, fee-sponsored clients) and MPP (Machine Payments Protocol) in both Charge mode (per-request SAC) and Channel mode (off-chain commits, high-frequency). Defaults to USDC (SEP-41 SAC) on `stellar:testnet`\u002F`stellar:pubnet` (CAIP-2). Use when selling a paid API to AI agents, building an x402 client, or designing a payment-channel architecture for high-frequency agent traffic.","ozioziel\u002FWorkville","ozioziel","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F201685456?v=4","01M7DPQ6XNF4MK3SRN0ADFTNHT","01M7DPQ6YAMRZ4S2NQPN9VQPH3",3,"MIT","https:\u002F\u002Fgithub.com\u002Fozioziel\u002FWorkville\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fagentic-payments\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: agentic-payments\ndescription: Agentic and machine-to-machine payments on Stellar. Covers x402 (HTTP 402 paid APIs via OZ Channels facilitator, fee-sponsored clients) and MPP (Machine Payments Protocol) in both Charge mode (per-request SAC) and Channel mode (off-chain commits, high-frequency). Defaults to USDC (SEP-41 SAC) on `stellar:testnet`\u002F`stellar:pubnet` (CAIP-2). Use when selling a paid API to AI agents, building an x402 client, or designing a payment-channel architecture for high-frequency agent traffic.\nuser-invocable: true\nargument-hint: \"[payment task]\"\n---\n\n# Agentic Payments: x402 + MPP\n\nTwo complementary protocols for AI-agent and machine-to-machine payments on Stellar. Pick based on who depends on whom and how often the agent pays.\n\n## Quick decision\n\n| | x402 | MPP Charge | MPP Channel |\n|--|------|------------|-------------|\n| Per-request on-chain tx? | Yes (via facilitator) | Yes (SAC) | No (off-chain commits) |\n| Needs facilitator? | Yes (OZ Channels) | No | No |\n| Client needs XLM? | No (fees sponsored) | Optional (`feePayer`) | Yes |\n| Setup complexity | Low | Low | Medium (deploy contract first) |\n| Best for | Quickest setup, fee-free clients | No third-party dep | High-frequency agents |\n\n- Selling an API, want zero-XLM clients → see **x402 Seller** below\n- Calling an x402 API from an agent → see **x402 Buyer** below\n- Selling an API, no facilitator dependency → see **MPP Charge** below\n- Agent making many requests per session → see **MPP Channel** below\n- Unsure → x402 (lowest friction to get started)\n\nAll protocols use USDC (SEP-41 SAC) by default; `stellar:testnet` \u002F `stellar:pubnet` CAIP-2 network IDs.\n\n## Related skills\n- The SACs the protocols call → `..\u002Fsmart-contracts\u002FSKILL.md`\n- USDC and other classic assets → `..\u002Fassets\u002FSKILL.md`\n- Wallets and signing in the buyer client → `..\u002Fdapp\u002FSKILL.md`\n- RPC simulation \u002F submission patterns → `..\u002Fdata\u002FSKILL.md`\n- SEP-41 (token interface) and related standards → `..\u002Fstandards\u002FSKILL.md`\n\n---\n\n# Part 1: x402 — Paid APIs + Agent Buyer Clients\n\n\n## When to use x402\nx402 is the right choice when:\n- You want the fastest path to a paid API — minimal code, no contract deployment\n- You want clients (including AI agents) to pay with **zero XLM** — the OZ Channels facilitator sponsors all network fees\n- You're building on top of an existing x402 ecosystem (Coinbase, other chains)\n\nTrade-off: you depend on OZ Channels (or a self-hosted relayer) for verification and settlement. If you need zero third-party dependency, use MPP Charge (Part 2 below) instead.\n\n## How x402 works on Stellar\n\n```\nClient → GET \u002Fresource                               → Server\nClient ← 402 Payment Required (payment requirements) ← Server\nClient builds SAC USDC transfer\nClient signs auth entries only (not the full tx envelope)\nClient → GET \u002Fresource + X-PAYMENT header           → Server\nServer → OZ Channels \u002Fverify + \u002Fsettle              → Stellar (~5s)\nClient ← 200 OK + resource\n```\n\nThe key Stellar difference: clients sign **auth entries**, not full transaction envelopes. The facilitator assembles the transaction, pays fees, and submits. Clients need zero XLM.\n\n## Seller: monetize an Express API\n\n```bash\nnpm install @x402\u002Fexpress @x402\u002Fcore @x402\u002Fstellar express dotenv\nnpm pkg set type=module\n```\n\n```js\n\u002F\u002F server.js\nimport \"dotenv\u002Fconfig\";\nimport express from \"express\";\nimport { paymentMiddleware, x402ResourceServer } from \"@x402\u002Fexpress\";\nimport { HTTPFacilitatorClient } from \"@x402\u002Fcore\u002Fserver\";\nimport { ExactStellarScheme } from \"@x402\u002Fstellar\u002Fexact\u002Fserver\";\n\n\u002F\u002F Drive the CAIP-2 network ID from one place. Switching to mainnet means\n\u002F\u002F flipping STELLAR_NETWORK and FACILITATOR_URL in .env, nothing in code.\nconst NETWORK = process.env.STELLAR_NETWORK || \"stellar:testnet\";\n\nif (!process.env.OZ_API_KEY) {\n  throw new Error(\n    \"OZ_API_KEY is required. Generate one at https:\u002F\u002Fchannels.openzeppelin.com\u002Ftestnet\u002Fgen (testnet) or https:\u002F\u002Fchannels.openzeppelin.com\u002Fgen (mainnet).\"\n  );\n}\n\nconst facilitator = new HTTPFacilitatorClient({\n  url: process.env.FACILITATOR_URL ?? \"https:\u002F\u002Fchannels.openzeppelin.com\u002Fx402\u002Ftestnet\",\n  \u002F\u002F OZ Channels requires Bearer auth on both testnet and mainnet\n  createAuthHeaders: async () => {\n    const h = { Authorization: `Bearer ${process.env.OZ_API_KEY}` };\n    return { verify: h, settle: h, supported: h };\n  },\n});\n\nconst resourceServer = new x402ResourceServer(facilitator)\n  .register(NETWORK, new ExactStellarScheme());\n\nconst app = express();\n\napp.use(\n  paymentMiddleware(\n    {\n      \"GET \u002Fweather\": {\n        accepts: {\n          scheme: \"exact\",\n          price: \"$0.001\", \u002F\u002F human-readable, auto-converts to 7-decimal USDC units\n          network: NETWORK,\n          payTo: process.env.STELLAR_RECIPIENT, \u002F\u002F recipient G... account\n        },\n        description: \"Current weather data\",\n      },\n    },\n    resourceServer\n  )\n);\n\napp.get(\"\u002Fweather\", (_req, res) => {\n  res.json({ city: \"San Francisco\", temp: 18, conditions: \"Foggy\" });\n});\n\napp.listen(3001, () => console.log(`x402 server on http:\u002F\u002Flocalhost:3001 (${NETWORK})`));\n```\n\n**Env vars:**\n- `STELLAR_NETWORK` — CAIP-2 network ID; defaults to `stellar:testnet`. Set to `stellar:pubnet` for mainnet.\n- `STELLAR_RECIPIENT` — your G... address (receives USDC, needs a USDC trustline)\n- `OZ_API_KEY` — OZ Channels API key (**required on both testnet and mainnet**; generate at the link in the runbook below)\n- `FACILITATOR_URL` — defaults to testnet URL above; set to `https:\u002F\u002Fchannels.openzeppelin.com\u002Fx402` for mainnet\n\n**Price format options:**\n- `\"$0.001\"` — human-readable, auto-converts to 7-decimal USDC units\n- `{ amount: \"1000\", asset: \"ASSET_SAC_CONTRACT_ID\" }` — explicit base units for non-USDC assets\n\n**`payTo` is the recipient's classic Stellar account (`G...`), not the USDC SAC contract address.** Sending USDC lands in the classic balance of the `payTo` account, which is why that account also needs a USDC trustline. The SAC contract address is what the protocol invokes `transfer` on; see \"Two USDC addresses\" below.\n\n## Buyer: agent client\n\n```bash\nnpm install @x402\u002Ffetch @x402\u002Fstellar dotenv\nnpm pkg set type=module\n```\n\n```js\n\u002F\u002F client.js\nimport \"dotenv\u002Fconfig\";\nimport { wrapFetchWithPaymentFromConfig } from \"@x402\u002Ffetch\";\nimport { createEd25519Signer } from \"@x402\u002Fstellar\";\nimport { ExactStellarScheme } from \"@x402\u002Fstellar\u002Fexact\u002Fclient\";\n\nconst NETWORK = process.env.STELLAR_NETWORK || \"stellar:testnet\";\n\n\u002F\u002F createEd25519Signer takes the raw S... secret string and the CAIP-2 network ID.\n\u002F\u002F Do NOT pre-wrap with Keypair.fromSecret or call getNetworkPassphrase yourself —\n\u002F\u002F the signer does both internally.\nconst signer = createEd25519Signer(process.env.STELLAR_SECRET_KEY, NETWORK);\n\n\u002F\u002F wrapFetchWithPaymentFromConfig returns a fetch that handles 402 negotiation\n\u002F\u002F and auth-entry signing transparently.\nconst fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, {\n  schemes: [{ network: NETWORK, client: new ExactStellarScheme(signer) }],\n});\n\nconst res = await fetchWithPayment(\"http:\u002F\u002Flocalhost:3001\u002Fweather\");\nconsole.log(await res.json());\n\u002F\u002F Paid automatically: 402 negotiation + auth-entry signing under the hood\n```\n\n**Env vars:**\n- `STELLAR_NETWORK` — CAIP-2 network ID; defaults to `stellar:testnet`. Must match the server's network.\n- `STELLAR_SECRET_KEY` — your S... secret key (needs USDC trustline + balance)\n\n**Browser frontends:** this client uses Node `fetch` and `createEd25519Signer`, both of which run in Node. A vanilla browser cannot sign contract auth entries through a typical wallet extension without additional glue. For a browser payer, run the x402 client server-side and expose a thin proxy endpoint to the page, or wire up Wallets-Kit \u002F Freighter with custom auth-entry signing.\n\n## Testnet runbook\n\nYou need two Stellar testnet accounts: a **client\u002Fpayer** (signs and pays from a USDC balance) and a **server\u002Frecipient** (the `payTo` in your route config). Both need a USDC trustline.\n\nTwo steps are web-only (Captcha or auth form) and cannot be scripted: the Circle USDC faucet and the OZ Channels key generator. Everything else can be automated. A complete `setup.js` sketch lives at the end of this section.\n\n1. **Generate two keypairs**\n   ```bash\n   node -e \"const { Keypair } = require('@stellar\u002Fstellar-sdk'); for (const n of ['RECIPIENT','PAYER']) { const k = Keypair.random(); console.log(n, k.publicKey(), k.secret()); }\"\n   ```\n\n2. **Fund both with testnet XLM (friendbot)**\n   ```bash\n   curl \"https:\u002F\u002Ffriendbot.stellar.org?addr=RECIPIENT_G...\"\n   curl \"https:\u002F\u002Ffriendbot.stellar.org?addr=PAYER_G...\"\n   ```\n\n3. **Add a USDC trustline to BOTH accounts** — open [Stellar Lab](https:\u002F\u002Flab.stellar.org\u002Faccount\u002Ffund?network=test) and add a USDC trustline to each `G...`, or run via SDK for each keypair:\n   ```js\n   import * as StellarSdk from \"@stellar\u002Fstellar-sdk\";\n\n   const horizon = new StellarSdk.Horizon.Server(\"https:\u002F\u002Fhorizon-testnet.stellar.org\");\n   \u002F\u002F Circle's classic USDC issuer on Stellar testnet\n   const USDC_ISSUER = \"GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5\";\n\n   async function addTrustline(secret) {\n     const kp = StellarSdk.Keypair.fromSecret(secret);\n     const acc = await horizon.loadAccount(kp.publicKey());\n     const tx = new StellarSdk.TransactionBuilder(acc, {\n       fee: StellarSdk.BASE_FEE,\n       networkPassphrase: StellarSdk.Networks.TESTNET,\n     })\n       .addOperation(StellarSdk.Operation.changeTrust({\n         asset: new StellarSdk.Asset(\"USDC\", USDC_ISSUER),\n       }))\n       .setTimeout(60)\n       .build();\n     tx.sign(kp);\n     return horizon.submitTransaction(tx);\n   }\n\n   \u002F\u002F Repeat for both the recipient secret and the payer secret.\n   await addTrustline(process.env.RECIPIENT_SECRET);\n   await addTrustline(process.env.PAYER_SECRET);\n   ```\n\n   Without a trustline on the recipient, the SAC `transfer` settles into nothing and the request fails with `op_no_trust`.\n\n4. **Fund the PAYER with testnet USDC** — open the [Circle testnet faucet](https:\u002F\u002Ffaucet.circle.com\u002F), select **Stellar testnet**, paste the payer's `G...`. Web Captcha; no API.\n\n5. **Generate an OZ Channels testnet API key** ([channels.openzeppelin.com\u002Ftestnet\u002Fgen](https:\u002F\u002Fchannels.openzeppelin.com\u002Ftestnet\u002Fgen)). **Required, not optional.** Without it the server crashes at startup with `Failed to initialize: no supported payment kinds loaded from any facilitator`.\n\n6. **Fill in `.env`**\n   ```\n   STELLAR_NETWORK=stellar:testnet\n   STELLAR_RECIPIENT=G... (recipient public key)\n   STELLAR_SECRET_KEY=S... (payer secret key)\n   OZ_API_KEY=...\n   ```\n\n7. **Run it**\n   ```bash\n   node server.js\n   # in another terminal\n   node client.js\n   ```\n\n### Optional: setup.js to automate steps 1–3\n\nDrop this in your project and run once. It generates keys, friendbots, and adds USDC trustlines, then writes a starter `.env` so you only need to do the two manual web steps afterward.\n\n```js\n\u002F\u002F setup.js\nimport fs from \"fs\u002Fpromises\";\nimport {\n  Keypair, Horizon, Networks, TransactionBuilder, Operation, Asset, BASE_FEE,\n} from \"@stellar\u002Fstellar-sdk\";\n\nconst USDC_ISSUER = \"GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5\";\nconst horizon = new Horizon.Server(\"https:\u002F\u002Fhorizon-testnet.stellar.org\");\n\nconst friendbot = (addr) => fetch(`https:\u002F\u002Ffriendbot.stellar.org?addr=${addr}`);\n\nasync function addTrustline(kp) {\n  const acc = await horizon.loadAccount(kp.publicKey());\n  const tx = new TransactionBuilder(acc, { fee: BASE_FEE, networkPassphrase: Networks.TESTNET })\n    .addOperation(Operation.changeTrust({ asset: new Asset(\"USDC\", USDC_ISSUER) }))\n    .setTimeout(60).build();\n  tx.sign(kp);\n  return horizon.submitTransaction(tx);\n}\n\nconst recipient = Keypair.random();\nconst payer = Keypair.random();\nawait Promise.all([friendbot(recipient.publicKey()), friendbot(payer.publicKey())]);\nawait new Promise(r => setTimeout(r, 2000));\nawait Promise.all([addTrustline(recipient), addTrustline(payer)]);\n\nawait fs.writeFile(\".env\", `STELLAR_RECIPIENT=${recipient.publicKey()}\nSTELLAR_SECRET_KEY=${payer.secret()}\nOZ_API_KEY=\n`);\n\nconsole.log(`Fund payer with USDC: https:\u002F\u002Ffaucet.circle.com  →  ${payer.publicKey()}`);\nconsole.log(`Get OZ key:          https:\u002F\u002Fchannels.openzeppelin.com\u002Ftestnet\u002Fgen  →  paste into OZ_API_KEY`);\n```\n\n## Two USDC addresses (don't confuse them)\n\nUSDC on Stellar has two addresses, used in different places. Mixing them up is a common stumble.\n\n| Address | Format | Used for |\n|---------|--------|----------|\n| Classic asset issuer | `G...` (32-byte ed25519 public key) | The `issuer` of the classic USDC asset; used when adding a trustline (`new Asset(\"USDC\", G...)`) |\n| SAC (Stellar Asset Contract) | `C...` (32-byte contract address) | The contract the protocol invokes `transfer` on; used in payment requirements |\n\nUse the exported constants instead of hard-coding when possible:\n\n```js\nimport { USDC_TESTNET_ADDRESS, USDC_PUBNET_ADDRESS } from \"@x402\u002Fstellar\";\n\u002F\u002F USDC_TESTNET_ADDRESS = \"CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA\"\n\u002F\u002F USDC_PUBNET_ADDRESS  = \"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75\"\n```\n\n`payTo` in your route config is always a classic recipient account (`G...`). The SAC address only appears if you set a custom `asset` in the price config for a non-USDC token.\n\n## Mainnet checklist\n\n| Config | Value |\n|--------|-------|\n| Network ID | `stellar:pubnet` |\n| RPC URL | Provider-specific endpoint (see [Stellar RPC providers directory](https:\u002F\u002Fdevelopers.stellar.org\u002Fdocs\u002Fdata\u002Fapis\u002Frpc\u002Fproviders)) |\n| Facilitator URL | `https:\u002F\u002Fchannels.openzeppelin.com\u002Fx402` |\n| USDC SAC | `USDC_PUBNET_ADDRESS` from `@x402\u002Fstellar` (currently `CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75`) |\n| OZ Channels API key | Required ([channels.openzeppelin.com\u002Fgen](https:\u002F\u002Fchannels.openzeppelin.com\u002Fgen)) |\n| Funding | Real USDC on mainnet (CEX, DEX, or bridge) |\n\nAlways test on testnet first. To switch a working setup to mainnet, change only the `.env` (`STELLAR_NETWORK=stellar:pubnet`, `FACILITATOR_URL=https:\u002F\u002Fchannels.openzeppelin.com\u002Fx402`, mainnet `OZ_API_KEY`, and a mainnet `STELLAR_RECIPIENT`); the samples derive their network from `STELLAR_NETWORK`, so no code changes are needed. Both networks require an OZ Channels API key in the `Authorization: Bearer` header.\n\n## Key concepts\n\n**Auth entry signing** — On Stellar, x402 clients sign contract authorization entries, not full transaction envelopes. The facilitator assembles the complete transaction. This is lighter than EVM\u002FSolana signing, and means clients never need to manage sequence numbers or pay fees.\n\n**Fee sponsorship** — OZ Channels pays all Stellar network fees (~$0.00001\u002Ftx). Clients need a funded wallet with USDC but zero XLM.\n\n**`exact-v2` scheme** — The Stellar x402 scheme version. Server advertises `scheme: \"exact\"` + `x402Version: 2`. Don't mix v1 and v2 packages.\n\n**SAC (Stellar Asset Contract)** — USDC on Stellar is a classic asset wrapped in a smart contract. x402 payments invoke `transfer` on the SAC. Any SEP-41 token works; USDC is the default.\n\n**Ledger expiration** — Auth entries include a `max_ledger` bound. Use `latestLedger + 12` (~1 minute at 5s\u002Fledger). Expired entries fail at settlement.\n\n**CAIP-2 network IDs** — `stellar:testnet` and `stellar:pubnet`. These are the exact strings the protocol expects.\n\n## Common pitfalls\n\n**Auth entry expired on settle**\n- Symptom: facilitator returns `isValid: false`, error mentions ledger expiration\n- Fix: ensure client uses `latestLedger + 12` (or higher) as expiration; don't cache auth entries across requests\n\n**Wrong USDC decimal precision**\n- Symptom: payment amount off by 10x or 100x\n- Fix: Stellar USDC uses **7 decimal places** (not 6 like EVM USDC). `$0.001` = `10000` in base units.\n\n**V1\u002FV2 package mismatch**\n- Symptom: TypeScript errors or silent payment failures\n- Fix: use all `@x402\u002F*` packages at the same major version. V2 is multi-chain; don't import V1 `@x402\u002Fcore` alongside V2 `@x402\u002Fstellar`.\n\n**Missing USDC trustline**\n- Symptom: `op_no_trust` error during settlement\n- Fix: add a USDC `changeTrust` operation before attempting any x402 payment (see testnet runbook above)\n\n**OZ Channels 401 on testnet or mainnet**\n- Symptom: facilitator rejects with 401, server logs `Failed to initialize: no supported payment kinds loaded from any facilitator`\n- Fix: an API key is required on **both** networks. Generate one at [channels.openzeppelin.com\u002Ftestnet\u002Fgen](https:\u002F\u002Fchannels.openzeppelin.com\u002Ftestnet\u002Fgen) (testnet) or [channels.openzeppelin.com\u002Fgen](https:\u002F\u002Fchannels.openzeppelin.com\u002Fgen) (mainnet), then set `OZ_API_KEY` and pass it via `createAuthHeaders` (see the Seller example).\n\n**Trustline missing on the recipient**\n- Symptom: `op_no_trust` during settlement, even though the client has USDC\n- Fix: the `payTo` account needs a USDC trustline too. The SAC `transfer` settles the underlying classic asset, which the recipient cannot hold without a trustline. Add `changeTrust` to both accounts during setup.\n\n**Trying to sign auth entries from a browser**\n- Symptom: bundling errors, or a browser wallet that has no API to sign contract auth entries\n- Fix: run the x402 client server-side (e.g. an Express route the browser calls), or use Wallets-Kit \u002F Freighter with custom auth-entry signing. `@x402\u002Ffetch` + `createEd25519Signer` target Node and assume a raw secret key.\n\n**Passing a `Keypair` (or a network passphrase) to `createEd25519Signer`**\n- Symptom: `TypeError: encoded argument must be of type String`, or `Error: Unknown Stellar network: Test SDF Network ; September 2015`\n- Fix: the signer takes the raw `S...` secret string and a CAIP-2 network ID. Do **not** wrap with `Keypair.fromSecret` first, and do **not** pre-convert with `getNetworkPassphrase` — both are done internally.\n  ```js\n  \u002F\u002F wrong\n  const signer = createEd25519Signer(Keypair.fromSecret(s), getNetworkPassphrase(\"stellar:testnet\"));\n  \u002F\u002F right\n  const signer = createEd25519Signer(s, \"stellar:testnet\");\n  ```\n\n---\n\n# Part 2: MPP — Machine Payments Protocol (Charge + Channel)\n\n\n## When to use MPP\nMPP is the right choice when:\n- You want **no facilitator dependency** — payments settle directly on Stellar via SAC transfers\n- Your AI agent makes **many requests per session** — use channel mode to pay off-chain and settle once\n- You're building a Stellar-native payment stack without relying on third-party infrastructure\n\nTwo modes:\n\n| Mode | On-chain txs | Best for |\n|------|-------------|----------|\n| **Charge** | One per request | Per-request payments, no pre-funding required |\n| **Channel** | One deposit + one close | High-frequency agents (100s of requests\u002Fsession) |\n\nIf you need zero-XLM clients or the simplest possible setup, use x402 (Part 1 above) instead.\n\n## Charge mode: per-request payments\n\nEach request triggers a SAC token transfer settled on-chain. No facilitator. Server can optionally sponsor fees so clients don't need XLM.\n\n```bash\nnpm install express @stellar\u002Fmpp mppx @stellar\u002Fstellar-sdk dotenv\nnpm pkg set type=module\n```\n\n**Server:**\n\n```js\n\u002F\u002F charge-server.js\nimport express from \"express\";\nimport { Mppx } from \"mppx\";\nimport * as stellar from \"@stellar\u002Fmpp\u002Fcharge\u002Fserver\";\nimport * as StellarSdk from \"@stellar\u002Fstellar-sdk\";\n\nconst USDC_SAC_TESTNET = \"CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA\";\nconst RECIPIENT = process.env.STELLAR_RECIPIENT; \u002F\u002F G... address\n\nconst mppx = Mppx.create({\n  secretKey: process.env.MPP_SECRET_KEY, \u002F\u002F shared secret for credential verification\n  methods: [\n    stellar.charge({\n      recipient: RECIPIENT,\n      currency: USDC_SAC_TESTNET,\n      network: \"stellar:testnet\",\n      \u002F\u002F optional: server pays network fees so clients don't need XLM\n      feePayer: process.env.FEE_PAYER_SECRET\n        ? { envelopeSigner: StellarSdk.Keypair.fromSecret(process.env.FEE_PAYER_SECRET) }\n        : undefined,\n    }),\n  ],\n});\n\nconst app = express();\napp.use(express.json());\n\n\u002F\u002F mppx middleware: returns 402 with challenge, then validates payment on retry\napp.use(mppx.middleware());\n\napp.get(\"\u002Fdata\", (req, res) => {\n  res.json({ result: \"paid content\", price: \"$0.001 USDC\" });\n});\n\napp.listen(3002, () => console.log(\"MPP charge server on http:\u002F\u002Flocalhost:3002\"));\n```\n\n**Client:**\n\n```js\n\u002F\u002F charge-client.js\nimport { Mppx } from \"mppx\";\nimport * as stellar from \"@stellar\u002Fmpp\u002Fcharge\u002Fclient\";\nimport * as StellarSdk from \"@stellar\u002Fstellar-sdk\";\n\nconst keypair = StellarSdk.Keypair.fromSecret(process.env.STELLAR_SECRET_KEY);\n\nconst mppx = Mppx.create({\n  methods: [\n    stellar.charge({\n      keypair,\n      mode: \"pull\", \u002F\u002F server assembles and broadcasts the transaction\n      onProgress(event) {\n        \u002F\u002F event.type: \"challenge\" | \"signed\" | \"settled\"\n        if (event.type === \"settled\") console.log(\"Settled:\", event.txHash);\n      },\n    }),\n  ],\n});\n\n\u002F\u002F mppx wraps fetch — 402 handling is transparent\nconst res = await mppx.fetch(\"http:\u002F\u002Flocalhost:3002\u002Fdata\");\nconsole.log(await res.json());\n```\n\n**Env vars (server):** `STELLAR_RECIPIENT`, `MPP_SECRET_KEY`, `FEE_PAYER_SECRET` (optional)\n**Env vars (client):** `STELLAR_SECRET_KEY`\n\n**`mode: \"pull\"` vs `\"push\"`:**\n- `\"pull\"` — client signs auth entries, server assembles + broadcasts (default; use with `feePayer`)\n- `\"push\"` — client builds and broadcasts the transaction directly (client must have XLM for fees)\n\n## Channel mode: high-frequency off-chain payments\n\nThe client deploys a one-way payment channel contract, deposits USDC once, then signs **cumulative commitments** off-chain for each request. No transaction per request — only two on-chain txs total (deposit + close). Ideal for AI agents making hundreds of calls in a session.\n\n### Channel lifecycle\n\n```\n1. Deploy channel contract (one-time)   → C... contract address\n2. Client deposits USDC into channel    → on-chain tx\n3. Per request: client signs commitment → off-chain (just a signature)\n   Amount is cumulative: each sig covers all previous payments + this one\n4. Server closes channel when done      → on-chain tx, settles total\n```\n\n### Prerequisites\n\n- Deploy a one-way-channel smart contract to get a `C...` contract address\n- Generate an ed25519 keypair for commitment signing (see [stellar-mpp SDK](https:\u002F\u002Fgithub.com\u002Fstellar\u002Fstellar-mpp-sdk))\n- Fund the channel with USDC before making requests\n\n### Server:\n\n```js\n\u002F\u002F channel-server.js\nimport express from \"express\";\nimport { Mppx, Store } from \"mppx\";\nimport * as stellar from \"@stellar\u002Fmpp\u002Fchannel\u002Fserver\";\n\nconst mppx = Mppx.create({\n  secretKey: process.env.MPP_SECRET_KEY,\n  methods: [\n    stellar.channel({\n      channel: process.env.CHANNEL_CONTRACT,       \u002F\u002F C... contract address\n      commitmentKey: process.env.COMMITMENT_PUBKEY, \u002F\u002F 64-char hex ed25519 public key\n      store: Store.memory(), \u002F\u002F dev only — use persistent store in production\n      network: \"stellar:testnet\",\n    }),\n  ],\n});\n\nconst app = express();\napp.use(express.json());\napp.use(mppx.middleware());\n\napp.get(\"\u002Fdata\", (req, res) => {\n  res.json({ result: \"paid content\" });\n});\n\napp.listen(3003);\n```\n\n### Client:\n\n```js\n\u002F\u002F channel-client.js\nimport { Mppx } from \"mppx\";\nimport * as stellar from \"@stellar\u002Fmpp\u002Fchannel\u002Fclient\";\nimport * as StellarSdk from \"@stellar\u002Fstellar-sdk\";\n\n\u002F\u002F commitment key must be a raw ed25519 seed — NOT a standard Stellar secret key\nconst commitmentKey = StellarSdk.Keypair.fromRawEd25519Seed(\n  Buffer.from(process.env.COMMITMENT_SECRET, \"hex\") \u002F\u002F 64-char hex secret\n);\n\nconst mppx = Mppx.create({\n  methods: [\n    stellar.channel({\n      commitmentKey,\n      onProgress(event) {\n        \u002F\u002F event.type: \"challenge\" | \"signed\"\n      },\n    }),\n  ],\n});\n\n\u002F\u002F Make many requests — each signs a cumulative off-chain commitment\nfor (let i = 0; i \u003C 100; i++) {\n  const res = await mppx.fetch(\"http:\u002F\u002Flocalhost:3003\u002Fdata\");\n  console.log(i, await res.json());\n}\n```\n\n### Closing the channel (server-initiated):\n\n```js\nimport { close } from \"@stellar\u002Fmpp\u002Fchannel\u002Fserver\";\nimport * as StellarSdk from \"@stellar\u002Fstellar-sdk\";\n\nconst txHash = await close({\n  channel: process.env.CHANNEL_CONTRACT,\n  amount: lastCumulativeAmount, \u002F\u002F bigint, total USDC owed in base units\n  signature: lastCommitmentSignature, \u002F\u002F hex string from final commitment\n  feePayer: { envelopeSigner: StellarSdk.Keypair.fromSecret(process.env.FEE_PAYER_SECRET) },\n  network: \"stellar:testnet\",\n});\n\u002F\u002F Single on-chain transaction settles the full session\nconsole.log(\"Channel closed:\", txHash);\n```\n\n**Env vars (server):** `CHANNEL_CONTRACT`, `COMMITMENT_PUBKEY`, `MPP_SECRET_KEY`, `FEE_PAYER_SECRET`\n**Env vars (client):** `COMMITMENT_SECRET`\n\n## Packages and subpath imports\n\n```bash\nnpm install @stellar\u002Fmpp mppx @stellar\u002Fstellar-sdk\n```\n\n| Import path | Recommended import pattern |\n|-------------|----------------------------|\n| `@stellar\u002Fmpp\u002Fcharge\u002Fserver` | `import * as stellar from \"@stellar\u002Fmpp\u002Fcharge\u002Fserver\"` — use `stellar.charge(...)` |\n| `@stellar\u002Fmpp\u002Fcharge\u002Fclient` | `import * as stellar from \"@stellar\u002Fmpp\u002Fcharge\u002Fclient\"` — use `stellar.charge(...)` |\n| `@stellar\u002Fmpp\u002Fchannel\u002Fserver` | `import * as stellar from \"@stellar\u002Fmpp\u002Fchannel\u002Fserver\"` — use `stellar.channel(...)`, `stellar.close(...)`, `stellar.getChannelState(...)`, `stellar.watchChannel(...)` |\n| `@stellar\u002Fmpp\u002Fchannel\u002Fclient` | `import * as stellar from \"@stellar\u002Fmpp\u002Fchannel\u002Fclient\"` — use `stellar.channel(...)` |\n| `@stellar\u002Fmpp\u002Fchannel` | Zod schema definitions for channel types |\n| `mppx` | `import { Mppx, Store } from \"mppx\"` |\n\n## Testnet runbook\n\n**Steps shared with all protocols:**\n1. Generate keypair + fund with Friendbot (see x402 testnet runbook in Part 1 above)\n2. Add USDC trustline\n3. Get testnet USDC from [Circle faucet](https:\u002F\u002Ffaucet.circle.com\u002F)\n\n**Channel mode only:**\n4. Deploy the one-way-channel contract (see [stellar-mpp-sdk](https:\u002F\u002Fgithub.com\u002Fstellar\u002Fstellar-mpp-sdk) for deploy script)\n5. Generate a 64-char hex ed25519 seed for the commitment key:\n   ```bash\n   node -e \"console.log(require('crypto').randomBytes(32).toString('hex'))\"\n   ```\n6. Derive the public key and fund the channel with USDC before making requests\n\n## Common pitfalls\n\n**Channel: wrong commitment key format**\n- Symptom: `Keypair.fromRawEd25519Seed` throws or signatures fail to verify\n- Fix: the commitment key is a raw ed25519 seed as a 64-char hex string — not a Stellar `S...` secret key. Generate with `crypto.randomBytes(32).toString('hex')`.\n\n**Channel: non-cumulative amounts**\n- Symptom: server rejects commitments after the first request\n- Fix: each commitment's `amount` must be the **running total** of all payments so far, not just the price of the current request. The server tracks the highest-seen commitment.\n\n**Channel: deposit TTL expired**\n- Symptom: `close()` fails or channel appears drained\n- Fix: Contract storage has a TTL. Close the channel before it expires, or extend storage TTL via `bumpContractInstance`. Don't leave channels open indefinitely.\n\n**Charge: client has no XLM for fees**\n- Symptom: `op_insufficient_balance` or fee errors on client-submitted transactions\n- Fix: set `mode: \"pull\"` on the client and configure `feePayer` on the server so the server pays fees. The client only signs auth entries.\n\n**`Store.memory()` in production**\n- Symptom: server loses track of channel state on restart, enables double-spend\n- Fix: replace `Store.memory()` with a persistent store (database-backed) before going to production.\n","# Agentic Payments: x402 + MPP\n\nTwo complementary protocols for AI-agent and machine-to-machine payments on Stellar. Pick based on who depends on whom and how often the agent pays.\n\n## Quick decision\n\n| | x402 | MPP Charge | MPP Channel |\n|--|------|------------|-------------|\n| Per-request on-chain tx? | Yes (via facilitator) | Yes (SAC) | No (off-chain commits) |\n| Needs facilitator? | Yes (OZ Channels) | No | No |\n| Client needs XLM? | No (fees sponsored) | Optional (`feePayer`) | Yes |\n| Setup complexity | Low | Low | Medium (deploy contract first) |\n| Best for | Quickest setup, fee-free clients | No third-party dep | High-frequency agents |\n\n- Selling an API, want zero-XLM clients → see **x402 Seller** below\n- Calling an x402 API from an agent → see **x402 Buyer** below\n- Selling an API, no facilitator dependency → see **MPP Charge** below\n- Agent making many requests per session → see **MPP Channel** below\n- Unsure → x402 (lowest friction to get started)\n\nAll protocols use USDC (SEP-41 SAC) by default; `stellar:testnet` \u002F `stellar:pubnet` CAIP-2 network IDs.\n\n## Related skills\n- The SACs the protocols call → `..\u002Fsmart-contracts\u002FSKILL.md`\n- USDC and other classic assets → `..\u002Fassets\u002FSKILL.md`\n- Wallets and signing in the buyer client → `..\u002Fdapp\u002FSKILL.md`\n- RPC simulation \u002F submission patterns → `..\u002Fdata\u002FSKILL.md`\n- SEP-41 (token interface) and related standards → `..\u002Fstandards\u002FSKILL.md`\n\n---\n\n# Part 1: x402 — Paid APIs + Agent Buyer Clients\n\n\n## When to use x402\nx402 is the right choice when:\n- You want the fastest path to a paid API — minimal code, no contract deployment\n- You want clients (including AI agents) to pay with **zero XLM** — the OZ Channels facilitator sponsors all network fees\n- You're building on top of an existing x402 ecosystem (Coinbase, other chains)\n\nTrade-off: you depend on OZ Channels (or a self-hosted relayer) for verification and settlement. If you need zero third-party dependency, use MPP Charge (Part 2 below) instead.\n\n## How x402 works on Stellar\n\n```\nClient → GET \u002Fresource                               → Server\nClient ← 402 Payment Required (payment requirements) ← Server\nClient builds SAC USDC transfer\nClient signs auth entries only (not the full tx envelope)\nClient → GET \u002Fresource + X-PAYMENT header           → Server\nServer → OZ Channels \u002Fverify + \u002Fsettle              → Stellar (~5s)\nClient ← 200 OK + resource\n```\n\nThe key Stellar difference: clients sign **auth entries**, not full transaction envelopes. The facilitator assembles the transaction, pays fees, and submits. Clients need zero XLM.\n\n## Seller: monetize an Express API\n\n```bash\nnpm install @x402\u002Fexpress @x402\u002Fcore @x402\u002Fstellar express dotenv\nnpm pkg set type=module\n```\n\n```js\n\u002F\u002F server.js\nimport \"dotenv\u002Fconfig\";\nimport express from \"express\";\nimport { paymentMiddleware, x402ResourceServer } from \"@x402\u002Fexpress\";\nimport { HTTPFacilitatorClient } from \"@x402\u002Fcore\u002Fserver\";\nimport { ExactStellarScheme } from \"@x402\u002Fstellar\u002Fexact\u002Fserver\";\n\n\u002F\u002F Drive the CAIP-2 network ID from one place. Switching to mainnet means\n\u002F\u002F flipping STELLAR_NETWORK and FACILITATOR_URL in .env, nothing in code.\nconst NETWORK = process.env.STELLAR_NETWORK || \"stellar:testnet\";\n\nif (!process.env.OZ_API_KEY) {\n  throw new Error(\n    \"OZ_API_KEY is required. Generate one at https:\u002F\u002Fchannels.openzeppelin.com\u002Ftestnet\u002Fgen (testnet) or https:\u002F\u002Fchannels.openzeppelin.com\u002Fgen (mainnet).\"\n  );\n}\n\nconst facilitator = new HTTPFacilitatorClient({\n  url: process.env.FACILITATOR_URL ?? \"https:\u002F\u002Fchannels.openzeppelin.com\u002Fx402\u002Ftestnet\",\n  \u002F\u002F OZ Channels requires Bearer auth on both testnet and mainnet\n  createAuthHeaders: async () => {\n    const h = { Authorization: `Bearer ${process.env.OZ_API_KEY}` };\n    return { verify: h, settle: h, supported: h };\n  },\n});\n\nconst resourceServer = new x402ResourceServer(facilitator)\n  .register(NETWORK, new ExactStellarScheme());\n\nconst app = express();\n\napp.use(\n  paymentMiddleware(\n    {\n      \"GET \u002Fweather\": {\n        accepts: {\n          scheme: \"exact\",\n          price: \"$0.001\", \u002F\u002F human-readable, auto-converts to 7-decimal USDC units\n          network: NETWORK,\n          payTo: process.env.STELLAR_RECIPIENT, \u002F\u002F recipient G... account\n        },\n        description: \"Current weather data\",\n      },\n    },\n    resourceServer\n  )\n);\n\napp.get(\"\u002Fweather\", (_req, res) => {\n  res.json({ city: \"San Francisco\", temp: 18, conditions: \"Foggy\" });\n});\n\napp.listen(3001, () => console.log(`x402 server on http:\u002F\u002Flocalhost:3001 (${NETWORK})`));\n```\n\n**Env vars:**\n- `STELLAR_NETWORK` — CAIP-2 network ID; defaults to `stellar:testnet`. Set to `stellar:pubnet` for mainnet.\n- `STELLAR_RECIPIENT` — your G... address (receives USDC, needs a USDC trustline)\n- `OZ_API_KEY` — OZ Channels API key (**required on both testnet and mainnet**; generate at the link in the runbook below)\n- `FACILITATOR_URL` — defaults to testnet URL above; set to `https:\u002F\u002Fchannels.openzeppelin.com\u002Fx402` for mainnet\n\n**Price format options:**\n- `\"$0.001\"` — human-readable, auto-converts to 7-decimal USDC units\n- `{ amount: \"1000\", asset: \"ASSET_SAC_CONTRACT_ID\" }` — explicit base units for non-USDC assets\n\n**`payTo` is the recipient's classic Stellar account (`G...`), not the USDC SAC contract address.** Sending USDC lands in the classic balance of the `payTo` account, which is why that account also needs a USDC trustline. The SAC contract address is what the protocol invokes `transfer` on; see \"Two USDC addresses\" below.\n\n## Buyer: agent client\n\n```bash\nnpm install @x402\u002Ffetch @x402\u002Fstellar dotenv\nnpm pkg set type=module\n```\n\n```js\n\u002F\u002F client.js\nimport \"dotenv\u002Fconfig\";\nimport { wrapFetchWithPaymentFromConfig } from \"@x402\u002Ffetch\";\nimport { createEd25519Signer } from \"@x402\u002Fstellar\";\nimport { ExactStellarScheme } from \"@x402\u002Fstellar\u002Fexact\u002Fclient\";\n\nconst NETWORK = process.env.STELLAR_NETWORK || \"stellar:testnet\";\n\n\u002F\u002F createEd25519Signer takes the raw S... secret string and the CAIP-2 network ID.\n\u002F\u002F Do NOT pre-wrap with Keypair.fromSecret or call getNetworkPassphrase yourself —\n\u002F\u002F the signer does both internally.\nconst signer = createEd25519Signer(process.env.STELLAR_SECRET_KEY, NETWORK);\n\n\u002F\u002F wrapFetchWithPaymentFromConfig returns a fetch that handles 402 negotiation\n\u002F\u002F and auth-entry signing transparently.\nconst fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, {\n  schemes: [{ network: NETWORK, client: new ExactStellarScheme(signer) }],\n});\n\nconst res = await fetchWithPayment(\"http:\u002F\u002Flocalhost:3001\u002Fweather\");\nconsole.log(await res.json());\n\u002F\u002F Paid automatically: 402 negotiation + auth-entry signing under the hood\n```\n\n**Env vars:**\n- `STELLAR_NETWORK` — CAIP-2 network ID; defaults to `stellar:testnet`. Must match the server's network.\n- `STELLAR_SECRET_KEY` — your S... secret key (needs USDC trustline + balance)\n\n**Browser frontends:** this client uses Node `fetch` and `createEd25519Signer`, both of which run in Node. A vanilla browser cannot sign contract auth entries through a typical wallet extension without additional glue. For a browser payer, run the x402 client server-side and expose a thin proxy endpoint to the page, or wire up Wallets-Kit \u002F Freighter with custom auth-entry signing.\n\n## Testnet runbook\n\nYou need two Stellar testnet accounts: a **client\u002Fpayer** (signs and pays from a USDC balance) and a **server\u002Frecipient** (the `payTo` in your route config). Both need a USDC trustline.\n\nTwo steps are web-only (Captcha or auth form) and cannot be scripted: the Circle USDC faucet and the OZ Channels key generator. Everything else can be automated. A complete `setup.js` sketch lives at the end of this section.\n\n1. **Generate two keypairs**\n   ```bash\n   node -e \"const { Keypair } = require('@stellar\u002Fstellar-sdk'); for (const n of ['RECIPIENT','PAYER']) { const k = Keypair.random(); console.log(n, k.publicKey(), k.secret()); }\"\n   ```\n\n2. **Fund both with testnet XLM (friendbot)**\n   ```bash\n   curl \"https:\u002F\u002Ffriendbot.stellar.org?addr=RECIPIENT_G...\"\n   curl \"https:\u002F\u002Ffriendbot.stellar.org?addr=PAYER_G...\"\n   ```\n\n3. **Add a USDC trustline to BOTH accounts** — open [Stellar Lab](https:\u002F\u002Flab.stellar.org\u002Faccount\u002Ffund?network=test) and add a USDC trustline to each `G...`, or run via SDK for each keypair:\n   ```js\n   import * as StellarSdk from \"@stellar\u002Fstellar-sdk\";\n\n   const horizon = new StellarSdk.Horizon.Server(\"https:\u002F\u002Fhorizon-testnet.stellar.org\");\n   \u002F\u002F Circle's classic USDC issuer on Stellar testnet\n   const USDC_ISSUER = \"GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5\";\n\n   async function addTrustline(secret) {\n     const kp = StellarSdk.Keypair.fromSecret(secret);\n     const acc = await horizon.loadAccount(kp.publicKey());\n     const tx = new StellarSdk.TransactionBuilder(acc, {\n       fee: StellarSdk.BASE_FEE,\n       networkPassphrase: StellarSdk.Networks.TESTNET,\n     })\n       .addOperation(StellarSdk.Operation.changeTrust({\n         asset: new StellarSdk.Asset(\"USDC\", USDC_ISSUER),\n       }))\n       .setTimeout(60)\n       .build();\n     tx.sign(kp);\n     return horizon.submitTransaction(tx);\n   }\n\n   \u002F\u002F Repeat for both the recipient secret and the payer secret.\n   await addTrustline(process.env.RECIPIENT_SECRET);\n   await addTrustline(process.env.PAYER_SECRET);\n   ```\n\n   Without a trustline on the recipient, the SAC `transfer` settles into nothing and the request fails with `op_no_trust`.\n\n4. **Fund the PAYER with testnet USDC** — open the [Circle testnet faucet](https:\u002F\u002Ffaucet.circle.com\u002F), select **Stellar testnet**, paste the payer's `G...`. Web Captcha; no API.\n\n5. **Generate an OZ Channels testnet API key** ([channels.openzeppelin.com\u002Ftestnet\u002Fgen](https:\u002F\u002Fchannels.openzeppelin.com\u002Ftestnet\u002Fgen)). **Required, not optional.** Without it the server crashes at startup with `Failed to initialize: no supported payment kinds loaded from any facilitator`.\n\n6. **Fill in `.env`**\n   ```\n   STELLAR_NETWORK=stellar:testnet\n   STELLAR_RECIPIENT=G... (recipient public key)\n   STELLAR_SECRET_KEY=S... (payer secret key)\n   OZ_API_KEY=...\n   ```\n\n7. **Run it**\n   ```bash\n   node server.js\n   # in another terminal\n   node client.js\n   ```\n\n### Optional: setup.js to automate steps 1–3\n\nDrop this in your project and run once. It generates keys, friendbots, and adds USDC trustlines, then writes a starter `.env` so you only need to do the two manual web steps afterward.\n\n```js\n\u002F\u002F setup.js\nimport fs from \"fs\u002Fpromises\";\nimport {\n  Keypair, Horizon, Networks, TransactionBuilder, Operation, Asset, BASE_FEE,\n} from \"@stellar\u002Fstellar-sdk\";\n\nconst USDC_ISSUER = \"GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5\";\nconst horizon = new Horizon.Server(\"https:\u002F\u002Fhorizon-testnet.stellar.org\");\n\nconst friendbot = (addr) => fetch(`https:\u002F\u002Ffriendbot.stellar.org?addr=${addr}`);\n\nasync function addTrustline(kp) {\n  const acc = await horizon.loadAccount(kp.publicKey());\n  const tx = new TransactionBuilder(acc, { fee: BASE_FEE, networkPassphrase: Networks.TESTNET })\n    .addOperation(Operation.changeTrust({ asset: new Asset(\"USDC\", USDC_ISSUER) }))\n    .setTimeout(60).build();\n  tx.sign(kp);\n  return horizon.submitTransaction(tx);\n}\n\nconst recipient = Keypair.random();\nconst payer = Keypair.random();\nawait Promise.all([friendbot(recipient.publicKey()), friendbot(payer.publicKey())]);\nawait new Promise(r => setTimeout(r, 2000));\nawait Promise.all([addTrustline(recipient), addTrustline(payer)]);\n\nawait fs.writeFile(\".env\", `STELLAR_RECIPIENT=${recipient.publicKey()}\nSTELLAR_SECRET_KEY=${payer.secret()}\nOZ_API_KEY=\n`);\n\nconsole.log(`Fund payer with USDC: https:\u002F\u002Ffaucet.circle.com  →  ${payer.publicKey()}`);\nconsole.log(`Get OZ key:          https:\u002F\u002Fchannels.openzeppelin.com\u002Ftestnet\u002Fgen  →  paste into OZ_API_KEY`);\n```\n\n## Two USDC addresses (don't confuse them)\n\nUSDC on Stellar has two addresses, used in different places. Mixing them up is a common stumble.\n\n| Address | Format | Used for |\n|---------|--------|----------|\n| Classic asset issuer | `G...` (32-byte ed25519 public key) | The `issuer` of the classic USDC asset; used when adding a trustline (`new Asset(\"USDC\", G...)`) |\n| SAC (Stellar Asset Contract) | `C...` (32-byte contract address) | The contract the protocol invokes `transfer` on; used in payment requirements |\n\nUse the exported constants instead of hard-coding when possible:\n\n```js\nimport { USDC_TESTNET_ADDRESS, USDC_PUBNET_ADDRESS } from \"@x402\u002Fstellar\";\n\u002F\u002F USDC_TESTNET_ADDRESS = \"CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA\"\n\u002F\u002F USDC_PUBNET_ADDRESS  = \"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75\"\n```\n\n`payTo` in your route config is always a classic recipient account (`G...`). The SAC address only appears if you set a custom `asset` in the price config for a non-USDC token.\n\n## Mainnet checklist\n\n| Config | Value |\n|--------|-------|\n| Network ID | `stellar:pubnet` |\n| RPC URL | Provider-specific endpoint (see [Stellar RPC providers directory](https:\u002F\u002Fdevelopers.stellar.org\u002Fdocs\u002Fdata\u002Fapis\u002Frpc\u002Fproviders)) |\n| Facilitator URL | `https:\u002F\u002Fchannels.openzeppelin.com\u002Fx402` |\n| USDC SAC | `USDC_PUBNET_ADDRESS` from `@x402\u002Fstellar` (currently `CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75`) |\n| OZ Channels API key | Required ([channels.openzeppelin.com\u002Fgen](https:\u002F\u002Fchannels.openzeppelin.com\u002Fgen)) |\n| Funding | Real USDC on mainnet (CEX, DEX, or bridge) |\n\nAlways test on testnet first. To switch a working setup to mainnet, change only the `.env` (`STELLAR_NETWORK=stellar:pubnet`, `FACILITATOR_URL=https:\u002F\u002Fchannels.openzeppelin.com\u002Fx402`, mainnet `OZ_API_KEY`, and a mainnet `STELLAR_RECIPIENT`); the samples derive their network from `STELLAR_NETWORK`, so no code changes are needed. Both networks require an OZ Channels API key in the `Authorization: Bearer` header.\n\n## Key concepts\n\n**Auth entry signing** — On Stellar, x402 clients sign contract authorization entries, not full transaction envelopes. The facilitator assembles the complete transaction. This is lighter than EVM\u002FSolana signing, and means clients never need to manage sequence numbers or pay fees.\n\n**Fee sponsorship** — OZ Channels pays all Stellar network fees (~$0.00001\u002Ftx). Clients need a funded wallet with USDC but zero XLM.\n\n**`exact-v2` scheme** — The Stellar x402 scheme version. Server advertises `scheme: \"exact\"` + `x402Version: 2`. Don't mix v1 and v2 packages.\n\n**SAC (Stellar Asset Contract)** — USDC on Stellar is a classic asset wrapped in a smart contract. x402 payments invoke `transfer` on the SAC. Any SEP-41 token works; USDC is the default.\n\n**Ledger expiration** — Auth entries include a `max_ledger` bound. Use `latestLedger + 12` (~1 minute at 5s\u002Fledger). Expired entries fail at settlement.\n\n**CAIP-2 network IDs** — `stellar:testnet` and `stellar:pubnet`. These are the exact strings the protocol expects.\n\n## Common pitfalls\n\n**Auth entry expired on settle**\n- Symptom: facilitator returns `isValid: false`, error mentions ledger expiration\n- Fix: ensure client uses `latestLedger + 12` (or higher) as expiration; don't cache auth entries across requests\n\n**Wrong USDC decimal precision**\n- Symptom: payment amount off by 10x or 100x\n- Fix: Stellar USDC uses **7 decimal places** (not 6 like EVM USDC). `$0.001` = `10000` in base units.\n\n**V1\u002FV2 package mismatch**\n- Symptom: TypeScript errors or silent payment failures\n- Fix: use all `@x402\u002F*` packages at the same major version. V2 is multi-chain; don't import V1 `@x402\u002Fcore` alongside V2 `@x402\u002Fstellar`.\n\n**Missing USDC trustline**\n- Symptom: `op_no_trust` error during settlement\n- Fix: add a USDC `changeTrust` operation before attempting any x402 payment (see testnet runbook above)\n\n**OZ Channels 401 on testnet or mainnet**\n- Symptom: facilitator rejects with 401, server logs `Failed to initialize: no supported payment kinds loaded from any facilitator`\n- Fix: an API key is required on **both** networks. Generate one at [channels.openzeppelin.com\u002Ftestnet\u002Fgen](https:\u002F\u002Fchannels.openzeppelin.com\u002Ftestnet\u002Fgen) (testnet) or [channels.openzeppelin.com\u002Fgen](https:\u002F\u002Fchannels.openzeppelin.com\u002Fgen) (mainnet), then set `OZ_API_KEY` and pass it via `createAuthHeaders` (see the Seller example).\n\n**Trustline missing on the recipient**\n- Symptom: `op_no_trust` during settlement, even though the client has USDC\n- Fix: the `payTo` account needs a USDC trustline too. The SAC `transfer` settles the underlying classic asset, which the recipient cannot hold without a trustline. Add `changeTrust` to both accounts during setup.\n\n**Trying to sign auth entries from a browser**\n- Symptom: bundling errors, or a browser wallet that has no API to sign contract auth entries\n- Fix: run the x402 client server-side (e.g. an Express route the browser calls), or use Wallets-Kit \u002F Freighter with custom auth-entry signing. `@x402\u002Ffetch` + `createEd25519Signer` target Node and assume a raw secret key.\n\n**Passing a `Keypair` (or a network passphrase) to `createEd25519Signer`**\n- Symptom: `TypeError: encoded argument must be of type String`, or `Error: Unknown Stellar network: Test SDF Network ; September 2015`\n- Fix: the signer takes the raw `S...` secret string and a CAIP-2 network ID. Do **not** wrap with `Keypair.fromSecret` first, and do **not** pre-convert with `getNetworkPassphrase` — both are done internally.\n  ```js\n  \u002F\u002F wrong\n  const signer = createEd25519Signer(Keypair.fromSecret(s), getNetworkPassphrase(\"stellar:testnet\"));\n  \u002F\u002F right\n  const signer = createEd25519Signer(s, \"stellar:testnet\");\n  ```\n\n---\n\n# Part 2: MPP — Machine Payments Protocol (Charge + Channel)\n\n\n## When to use MPP\nMPP is the right choice when:\n- You want **no facilitator dependency** — payments settle directly on Stellar via SAC transfers\n- Your AI agent makes **many requests per session** — use channel mode to pay off-chain and settle once\n- You're building a Stellar-native payment stack without relying on third-party infrastructure\n\nTwo modes:\n\n| Mode | On-chain txs | Best for |\n|------|-------------|----------|\n| **Charge** | One per request | Per-request payments, no pre-funding required |\n| **Channel** | One deposit + one close | High-frequency agents (100s of requests\u002Fsession) |\n\nIf you need zero-XLM clients or the simplest possible setup, use x402 (Part 1 above) instead.\n\n## Charge mode: per-request payments\n\nEach request triggers a SAC token transfer settled on-chain. No facilitator. Server can optionally sponsor fees so clients don't need XLM.\n\n```bash\nnpm install express @stellar\u002Fmpp mppx @stellar\u002Fstellar-sdk dotenv\nnpm pkg set type=module\n```\n\n**Server:**\n\n```js\n\u002F\u002F charge-server.js\nimport express from \"express\";\nimport { Mppx } from \"mppx\";\nimport * as stellar from \"@stellar\u002Fmpp\u002Fcharge\u002Fserver\";\nimport * as StellarSdk from \"@stellar\u002Fstellar-sdk\";\n\nconst USDC_SAC_TESTNET = \"CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA\";\nconst RECIPIENT = process.env.STELLAR_RECIPIENT; \u002F\u002F G... address\n\nconst mppx = Mppx.create({\n  secretKey: process.env.MPP_SECRET_KEY, \u002F\u002F shared secret for credential verification\n  methods: [\n    stellar.charge({\n      recipient: RECIPIENT,\n      currency: USDC_SAC_TESTNET,\n      network: \"stellar:testnet\",\n      \u002F\u002F optional: server pays network fees so clients don't need XLM\n      feePayer: process.env.FEE_PAYER_SECRET\n        ? { envelopeSigner: StellarSdk.Keypair.fromSecret(process.env.FEE_PAYER_SECRET) }\n        : undefined,\n    }),\n  ],\n});\n\nconst app = express();\napp.use(express.json());\n\n\u002F\u002F mppx middleware: returns 402 with challenge, then validates payment on retry\napp.use(mppx.middleware());\n\napp.get(\"\u002Fdata\", (req, res) => {\n  res.json({ result: \"paid content\", price: \"$0.001 USDC\" });\n});\n\napp.listen(3002, () => console.log(\"MPP charge server on http:\u002F\u002Flocalhost:3002\"));\n```\n\n**Client:**\n\n```js\n\u002F\u002F charge-client.js\nimport { Mppx } from \"mppx\";\nimport * as stellar from \"@stellar\u002Fmpp\u002Fcharge\u002Fclient\";\nimport * as StellarSdk from \"@stellar\u002Fstellar-sdk\";\n\nconst keypair = StellarSdk.Keypair.fromSecret(process.env.STELLAR_SECRET_KEY);\n\nconst mppx = Mppx.create({\n  methods: [\n    stellar.charge({\n      keypair,\n      mode: \"pull\", \u002F\u002F server assembles and broadcasts the transaction\n      onProgress(event) {\n        \u002F\u002F event.type: \"challenge\" | \"signed\" | \"settled\"\n        if (event.type === \"settled\") console.log(\"Settled:\", event.txHash);\n      },\n    }),\n  ],\n});\n\n\u002F\u002F mppx wraps fetch — 402 handling is transparent\nconst res = await mppx.fetch(\"http:\u002F\u002Flocalhost:3002\u002Fdata\");\nconsole.log(await res.json());\n```\n\n**Env vars (server):** `STELLAR_RECIPIENT`, `MPP_SECRET_KEY`, `FEE_PAYER_SECRET` (optional)\n**Env vars (client):** `STELLAR_SECRET_KEY`\n\n**`mode: \"pull\"` vs `\"push\"`:**\n- `\"pull\"` — client signs auth entries, server assembles + broadcasts (default; use with `feePayer`)\n- `\"push\"` — client builds and broadcasts the transaction directly (client must have XLM for fees)\n\n## Channel mode: high-frequency off-chain payments\n\nThe client deploys a one-way payment channel contract, deposits USDC once, then signs **cumulative commitments** off-chain for each request. No transaction per request — only two on-chain txs total (deposit + close). Ideal for AI agents making hundreds of calls in a session.\n\n### Channel lifecycle\n\n```\n1. Deploy channel contract (one-time)   → C... contract address\n2. Client deposits USDC into channel    → on-chain tx\n3. Per request: client signs commitment → off-chain (just a signature)\n   Amount is cumulative: each sig covers all previous payments + this one\n4. Server closes channel when done      → on-chain tx, settles total\n```\n\n### Prerequisites\n\n- Deploy a one-way-channel smart contract to get a `C...` contract address\n- Generate an ed25519 keypair for commitment signing (see [stellar-mpp SDK](https:\u002F\u002Fgithub.com\u002Fstellar\u002Fstellar-mpp-sdk))\n- Fund the channel with USDC before making requests\n\n### Server:\n\n```js\n\u002F\u002F channel-server.js\nimport express from \"express\";\nimport { Mppx, Store } from \"mppx\";\nimport * as stellar from \"@stellar\u002Fmpp\u002Fchannel\u002Fserver\";\n\nconst mppx = Mppx.create({\n  secretKey: process.env.MPP_SECRET_KEY,\n  methods: [\n    stellar.channel({\n      channel: process.env.CHANNEL_CONTRACT,       \u002F\u002F C... contract address\n      commitmentKey: process.env.COMMITMENT_PUBKEY, \u002F\u002F 64-char hex ed25519 public key\n      store: Store.memory(), \u002F\u002F dev only — use persistent store in production\n      network: \"stellar:testnet\",\n    }),\n  ],\n});\n\nconst app = express();\napp.use(express.json());\napp.use(mppx.middleware());\n\napp.get(\"\u002Fdata\", (req, res) => {\n  res.json({ result: \"paid content\" });\n});\n\napp.listen(3003);\n```\n\n### Client:\n\n```js\n\u002F\u002F channel-client.js\nimport { Mppx } from \"mppx\";\nimport * as stellar from \"@stellar\u002Fmpp\u002Fchannel\u002Fclient\";\nimport * as StellarSdk from \"@stellar\u002Fstellar-sdk\";\n\n\u002F\u002F commitment key must be a raw ed25519 seed — NOT a standard Stellar secret key\nconst commitmentKey = StellarSdk.Keypair.fromRawEd25519Seed(\n  Buffer.from(process.env.COMMITMENT_SECRET, \"hex\") \u002F\u002F 64-char hex secret\n);\n\nconst mppx = Mppx.create({\n  methods: [\n    stellar.channel({\n      commitmentKey,\n      onProgress(event) {\n        \u002F\u002F event.type: \"challenge\" | \"signed\"\n      },\n    }),\n  ],\n});\n\n\u002F\u002F Make many requests — each signs a cumulative off-chain commitment\nfor (let i = 0; i \u003C 100; i++) {\n  const res = await mppx.fetch(\"http:\u002F\u002Flocalhost:3003\u002Fdata\");\n  console.log(i, await res.json());\n}\n```\n\n### Closing the channel (server-initiated):\n\n```js\nimport { close } from \"@stellar\u002Fmpp\u002Fchannel\u002Fserver\";\nimport * as StellarSdk from \"@stellar\u002Fstellar-sdk\";\n\nconst txHash = await close({\n  channel: process.env.CHANNEL_CONTRACT,\n  amount: lastCumulativeAmount, \u002F\u002F bigint, total USDC owed in base units\n  signature: lastCommitmentSignature, \u002F\u002F hex string from final commitment\n  feePayer: { envelopeSigner: StellarSdk.Keypair.fromSecret(process.env.FEE_PAYER_SECRET) },\n  network: \"stellar:testnet\",\n});\n\u002F\u002F Single on-chain transaction settles the full session\nconsole.log(\"Channel closed:\", txHash);\n```\n\n**Env vars (server):** `CHANNEL_CONTRACT`, `COMMITMENT_PUBKEY`, `MPP_SECRET_KEY`, `FEE_PAYER_SECRET`\n**Env vars (client):** `COMMITMENT_SECRET`\n\n## Packages and subpath imports\n\n```bash\nnpm install @stellar\u002Fmpp mppx @stellar\u002Fstellar-sdk\n```\n\n| Import path | Recommended import pattern |\n|-------------|----------------------------|\n| `@stellar\u002Fmpp\u002Fcharge\u002Fserver` | `import * as stellar from \"@stellar\u002Fmpp\u002Fcharge\u002Fserver\"` — use `stellar.charge(...)` |\n| `@stellar\u002Fmpp\u002Fcharge\u002Fclient` | `import * as stellar from \"@stellar\u002Fmpp\u002Fcharge\u002Fclient\"` — use `stellar.charge(...)` |\n| `@stellar\u002Fmpp\u002Fchannel\u002Fserver` | `import * as stellar from \"@stellar\u002Fmpp\u002Fchannel\u002Fserver\"` — use `stellar.channel(...)`, `stellar.close(...)`, `stellar.getChannelState(...)`, `stellar.watchChannel(...)` |\n| `@stellar\u002Fmpp\u002Fchannel\u002Fclient` | `import * as stellar from \"@stellar\u002Fmpp\u002Fchannel\u002Fclient\"` — use `stellar.channel(...)` |\n| `@stellar\u002Fmpp\u002Fchannel` | Zod schema definitions for channel types |\n| `mppx` | `import { Mppx, Store } from \"mppx\"` |\n\n## Testnet runbook\n\n**Steps shared with all protocols:**\n1. Generate keypair + fund with Friendbot (see x402 testnet runbook in Part 1 above)\n2. Add USDC trustline\n3. Get testnet USDC from [Circle faucet](https:\u002F\u002Ffaucet.circle.com\u002F)\n\n**Channel mode only:**\n4. Deploy the one-way-channel contract (see [stellar-mpp-sdk](https:\u002F\u002Fgithub.com\u002Fstellar\u002Fstellar-mpp-sdk) for deploy script)\n5. Generate a 64-char hex ed25519 seed for the commitment key:\n   ```bash\n   node -e \"console.log(require('crypto').randomBytes(32).toString('hex'))\"\n   ```\n6. Derive the public key and fund the channel with USDC before making requests\n\n## Common pitfalls\n\n**Channel: wrong commitment key format**\n- Symptom: `Keypair.fromRawEd25519Seed` throws or signatures fail to verify\n- Fix: the commitment key is a raw ed25519 seed as a 64-char hex string — not a Stellar `S...` secret key. Generate with `crypto.randomBytes(32).toString('hex')`.\n\n**Channel: non-cumulative amounts**\n- Symptom: server rejects commitments after the first request\n- Fix: each commitment's `amount` must be the **running total** of all payments so far, not just the price of the current request. The server tracks the highest-seen commitment.\n\n**Channel: deposit TTL expired**\n- Symptom: `close()` fails or channel appears drained\n- Fix: Contract storage has a TTL. Close the channel before it expires, or extend storage TTL via `bumpContractInstance`. Don't leave channels open indefinitely.\n\n**Charge: client has no XLM for fees**\n- Symptom: `op_insufficient_balance` or fee errors on client-submitted transactions\n- Fix: set `mode: \"pull\"` on the client and configure `feePayer` on the server so the server pays fees. The client only signs auth entries.\n\n**`Store.memory()` in production**\n- Symptom: server loses track of channel state on restart, enables double-spend\n- Fix: replace `Store.memory()` with a persistent store (database-backed) before going to production.\n",{"name":5,"description":7,"argument-hint":23,"user-invocable":24},"[payment task]",true,"main","217c58ef684b467a1122bd3bac74141a90f974cd",".claude\u002Fskills\u002Fagentic-payments",0,"https:\u002F\u002Fgithub.com\u002Fozioziel\u002FWorkville","https:\u002F\u002Fmyworkville.com","https:\u002F\u002Fgithub.com\u002Fozioziel","Full Stack Developer | React · NestJS · Flutter · Python | AI & Cloud | Penguins 🐧\r\n","2026-11-11 03:39:50",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":24},[36,39,42],{"tool":37,"command":38},"npx","npx skills add ozioziel\u002FWorkville --skill agentic-payments",{"tool":40,"command":41},"bunx","bunx skills add ozioziel\u002FWorkville --skill agentic-payments",{"tool":43,"command":44},"pnpm","pnpm dlx skills add ozioziel\u002FWorkville --skill agentic-payments","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fozioziel\u002FWorkville\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fagentic-payments\u002FSKILL.md",[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":18},"01M7DQ1A5WKJHC1DSAAK9SJ5W8","zk-proofs","Zero-knowledge proofs and privacy patterns on Stellar. Covers Groth16 verification in smart contracts via BLS12-381 host functions (CAP-0059, available), the BN254 + Poseidon proposals (CAP-0074\u002F0075, status-sensitive), and concrete toolchain walkthroughs for Circom (on-chain verifiable today), Noir, and RISC Zero (attestation pattern until BN254 lands). Use when building privacy-preserving applications, ZK-verifier contracts, or wiring a proving toolchain to Stellar.","https:\u002F\u002Fgithub.com\u002Fozioziel\u002FWorkville\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fzk-proofs\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":18},"01M7DQ171146QGP8BTPA4AQZX7","tyler-architect","System architect and technical design leader. Use when the user asks to talk to Tyler or requests the architect.","https:\u002F\u002Fgithub.com\u002Fozioziel\u002FWorkville\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Ftyler-architect\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":18},"01M7DQ120EG4KCSXJ8SBH7P7A8","stellar-help","Analyzes current state and user query to answer BMad questions or recommend the next skill(s) to use. Use when user asks for help, bmad help, what to do next, or what to start with in BMad.","https:\u002F\u002Fgithub.com\u002Fozioziel\u002FWorkville\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fstellar-help\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":18},"01M7DQ0P859R7J75ZC9G93YHF2","stellar-competitive-landscape","Map the competitive landscape for a Stellar project idea. Use when a user says \"who are my competitors on Stellar\", \"competitive analysis Stellar\", \"what already exists in this space on Stellar\", \"show me similar Stellar projects\", \"is anyone else building this on Stellar\", \"map the Stellar landscape for X\" — or the Spanish\u002Fmixed-language equivalents, e.g. \"cual es la competencia de X\", \"que tan saturado está este espacio\", \"que aspectos están menos explorados y la SDF\u002FSCF están dispuestos a fondear\", or \"analiza la competencia de estos bounties\". Also fires when a user (directly, or via a BMAD persona like justin-analyst) names a specific protocol\u002Fidea inline and asks about its competition, viability, or market whitespace — including \"should we integrate [external protocol]\" or \"does anything like this already exist on Stellar\" research, where the deliverable is the same landscape map applied to a build-vs-integrate decision. Queries the 728-project LumenLoop ecosystem database and Electric Capital developer activity to rank competitors by SCF funding history and repo activity.","https:\u002F\u002Fgithub.com\u002Fozioziel\u002FWorkville\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fstellar-competitive-landscape\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":18},"01M7DQ0DJ62TJJV7Z6N3149ZWJ","standards","Stellar standards, ecosystem, and reference. Covers SEPs (Stellar Ecosystem Proposals), CAPs (Core Advancement Proposals), and a quick map for picking the right standard for wallets, anchors, payments, deposits\u002Fwithdrawals, federation, deep links, and KYC. Also bundles ecosystem references (DeFi protocols, dev tools, wallets, infra, community projects), curated documentation links, and MCP servers (live tools such as Raven). Use when you need to know which SEP applies, or want a starting point for ecosystem integrations, official docs, or live MCP tooling.","https:\u002F\u002Fgithub.com\u002Fozioziel\u002FWorkville\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fstandards\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":18},"01M7DQ0697WA5NA7C4XHCVK193","smart-contracts","Stellar smart contract development (Rust, soroban-sdk). Entry point with project setup, contract anatomy, and build\u002Fdeploy workflow, routing to three companion files in this directory — development.md (storage\u002FTTL, authorization, cross-contract calls, tokens, events, errors, upgrades, fees, troubleshooting), testing.md (unit, fuzz, property, fork, mutation, integration), and security.md (vulnerability classes, checklists, tooling, audits). Use when writing, testing, reviewing, securing, debugging, or shipping Stellar smart contracts, including anything the user calls \"Soroban\" — Soroban contracts, soroban-sdk, Soroban auth\u002Fstorage\u002FTTL errors, SEP-41 tokens, or SAC integration from contract code.","https:\u002F\u002Fgithub.com\u002Fozioziel\u002FWorkville\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fsmart-contracts\u002FSKILL.md",[],[]]