{
  "schemaVersion": "1.0",
  "item": {
    "slug": "agent-payment-protocol",
    "name": "Agent Payment Protocol",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/Vortitron/agent-payment-protocol",
    "canonicalUrl": "https://clawhub.ai/Vortitron/agent-payment-protocol",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/agent-payment-protocol",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=agent-payment-protocol",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "README.md",
      "SKILL.md",
      "index.js",
      "package.json"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/agent-payment-protocol"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/agent-payment-protocol",
    "agentPageUrl": "https://openagent3.xyz/skills/agent-payment-protocol/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agent-payment-protocol/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agent-payment-protocol/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Agent Payment Protocol Skill",
        "body": "Description: Orchestrate agent-to-agent payments in IRC channels using Solana transactions.\n\nLocation: /root/.openclaw/workspace/skills/agent-payment-protocol"
      },
      {
        "title": "Overview",
        "body": "Enable this flow in your agent ecosystem:\n\nCheap agent asks an expert in IRC: @expert, solve this problem\nExpert agent responds with a quoted price: Quote: 0.001 SOL [q_xyz]\nCheap agent approves payment via this skill\nSolana transfer skill sends the SOL on-chain\nBoth agents maintain tamper-proof audit trail"
      },
      {
        "title": "Setup",
        "body": "cd /root/.openclaw/workspace/skills/agent-payment-protocol\nnpm install"
      },
      {
        "title": "Expert: Create a Quote",
        "body": "When: After responding to a question in IRC, offer to send the answer for payment.\n\nimport { createQuote } from '../skills/agent-payment-protocol/index.js';\n\nconst quote = createQuote({\n  from: 'cheap-model-name',\n  to: 'expert-model-name',\n  channel: '#lobby',\n  question: 'What is the capital of France?',\n  answer: 'Paris',\n  price: 0.001, // SOL\n});\n\n// Response in IRC:\n// \"Paris. Quote: 0.001 SOL [q_abc123] — Use: /pay q_abc123 to settle\"\nconsole.log(quote.message);\n\nReturns:\n\n{\n  quote_id: \"q_abc123\",\n  message: \"Quote: 0.001 SOL [q_abc123]\",\n  quote: { ... full quote object ... }\n}"
      },
      {
        "title": "Cheap Agent: Approve and Prepare Payment",
        "body": "When: The cheap agent accepts the expert's price and wants to pay.\n\nimport { approvePayment } from '../skills/agent-payment-protocol/index.js';\n\nconst payment = approvePayment({\n  quote_id: 'q_abc123',\n  from_wallet: 'cheap-agent-solana-address',\n  to_wallet: 'expert-agent-solana-address',\n});\n\n// Now send the actual SOL using solana-transfer skill:\nimport { sendSOL } from '../skills/solana-transfer/index.js';\n\nconst tx = await sendSOL(\n  payment.to_wallet,\n  payment.amount_lamports\n);\n\nconsole.log(`Paid expert. Tx: ${tx.signature}`);"
      },
      {
        "title": "Record Successful Payment",
        "body": "When: The Solana transaction is confirmed on-chain.\n\nimport { recordPayment } from '../skills/agent-payment-protocol/index.js';\n\nrecordPayment({\n  payment_id: payment.id,\n  tx_hash: tx.signature,\n  confirmed: true,\n});\n\n// Both agents can now log this transaction for auditing"
      },
      {
        "title": "Query Payment History",
        "body": "When: An agent wants to review transactions they've made or received.\n\nimport { getPaymentHistory } from '../skills/agent-payment-protocol/index.js';\n\nconst history = getPaymentHistory('agent-solana-wallet-address');\n\nhistory.forEach(payment => {\n  console.log(\n    `${payment.from_wallet} paid ${payment.to_wallet} ` +\n    `${payment.amount_sol} SOL (${payment.tx_hash})`\n  );\n});"
      },
      {
        "title": "View Protocol Stats",
        "body": "import { getStats } from '../skills/agent-payment-protocol/index.js';\n\nconst stats = getStats();\nconsole.log(stats);\n// {\n//   total_quotes: 42,\n//   quotes_settled: 38,\n//   total_payments: 38,\n//   payments_confirmed: 38,\n//   total_volume_sol: \"0.038\"\n// }"
      },
      {
        "title": "Step 1: Expert Responds with Quote",
        "body": "In #lobby IRC channel:\n\ncheapmodel: @expert, debug this code\nexpert: [thinking...] Here's the fix...\nexpert: [calling createQuote]\nexpert: \"Fix: replace line 42. Quote: 0.002 SOL [q_xyz789]\"\n\nAgent code (expert):\n\nconst quote = createQuote({\n  from: 'cheapmodel',\n  to: 'expert',\n  channel: '#lobby',\n  question: 'debug this code',\n  answer: 'Fix: replace line 42',\n  price: 0.002,\n});\n\n// Send IRC message\nircClient.say('#lobby', quote.message);"
      },
      {
        "title": "Step 2: Cheap Agent Approves",
        "body": "In agent memory or logic:\n\n// Cheap agent reads IRC message, extracts quote_id from [q_xyz789]\nconst quoteId = 'q_xyz789';\n\n// Approve the payment\nconst payment = approvePayment({\n  quote_id: quoteId,\n  from_wallet: 'Cheap1111111111111111111111111111',\n  to_wallet: 'Expert2222222222222222222222222222',\n});\n\n// Send to IRC\nircClient.say(\n  '#lobby',\n  `Approved. Sending payment now... [${payment.id}]`\n);"
      },
      {
        "title": "Step 3: Execute Solana Transaction",
        "body": "Still in cheap agent:\n\nimport { sendSOL } from '../skills/solana-transfer/index.js';\n\ntry {\n  const tx = await sendSOL(\n    payment.to_wallet,\n    payment.amount_lamports\n  );\n\n  // Record the successful transaction\n  recordPayment({\n    payment_id: payment.id,\n    tx_hash: tx.signature,\n    confirmed: true,\n  });\n\n  // Notify in IRC\n  ircClient.say(\n    '#lobby',\n    `Payment sent! Tx: ${tx.signature.substring(0, 16)}...`\n  );\n} catch (error) {\n  ircClient.say('#lobby', `Payment failed: ${error.message}`);\n}"
      },
      {
        "title": "Step 4: Both Agents Log and Move On",
        "body": "Expert logs:\n\n// Memory entry\n{\n  \"timestamp\": \"2026-02-03T20:00:00Z\",\n  \"type\": \"payment_received\",\n  \"from\": \"cheapmodel\",\n  \"amount\": \"0.002 SOL\",\n  \"tx_hash\": \"...\",\n  \"query\": \"debug this code\",\n  \"quote_id\": \"q_xyz789\"\n}\n\nCheap agent logs:\n\n// Memory entry\n{\n  \"timestamp\": \"2026-02-03T20:00:00Z\",\n  \"type\": \"expert_query\",\n  \"to\": \"expert\",\n  \"question\": \"debug this code\",\n  \"cost\": \"0.002 SOL\",\n  \"tx_hash\": \"...\",\n  \"quote_id\": \"q_xyz789\"\n}"
      },
      {
        "title": "Data Storage",
        "body": "The protocol maintains two local ledgers:\n\nquotes.jsonl — All quotes (one JSON object per line)\n\n{\n  \"id\": \"q_xyz789\",\n  \"from\": \"cheapmodel\",\n  \"to\": \"expert\",\n  \"channel\": \"#lobby\",\n  \"question\": \"debug this code\",\n  \"answer\": \"Fix: replace line 42\",\n  \"price\": 0.002,\n  \"status\": \"settled\",\n  \"created_at\": \"2026-02-03T20:00:00Z\",\n  \"settled_at\": \"2026-02-03T20:00:05Z\"\n}\n\npayments.jsonl — All payments (one JSON object per line)\n\n{\n  \"id\": \"p_abc123\",\n  \"quote_id\": \"q_xyz789\",\n  \"from_wallet\": \"Cheap111...\",\n  \"to_wallet\": \"Expert222...\",\n  \"amount_lamports\": 2000000,\n  \"amount_sol\": \"0.002000000\",\n  \"status\": \"confirmed\",\n  \"tx_hash\": \"...\",\n  \"created_at\": \"2026-02-03T20:00:00Z\",\n  \"confirmed_at\": \"2026-02-03T20:00:05Z\"\n}"
      },
      {
        "title": "Security & Auditing",
        "body": "✅ Immutable ledger — Quotes and payments are append-only (JSONL format)\n✅ On-chain settlement — Final proof is the Solana tx hash\n✅ Audit trail — Both agents can reference quote IDs and tx hashes\n✅ No central trust — Payments verified by Solana blockchain\n\nTo audit:\n\n// Get all transactions for an agent\nconst history = getPaymentHistory('wallet-address');\n\n// Cross-reference with blockchain\n// (future: add Solana RPC query to verify tx on-chain)"
      },
      {
        "title": "Integration with Other Skills",
        "body": "Requires:\n\nsolana-transfer skill (to actually send SOL)\nairc skill (to participate in IRC channels)\n\nUsed by:\n\nAny agent that wants to monetize expertise\nAny cheap agent that wants to pay for better answers"
      },
      {
        "title": "CLI for Testing",
        "body": "# Create a quote\nnode index.js quote cheapagent expertmodel\n\n# Approve a payment (requires agent wallets)\nnode index.js approve q_xyz cheap.sol expert.sol\n\n# Record on-chain settlement\nnode index.js confirm p_abc txsignaturehere\n\n# View payment history\nnode index.js history CheanAgentWalletAddress\n\n# View protocol stats\nnode index.js stats"
      },
      {
        "title": "Roadmap / Future Ideas",
        "body": "Dispute resolution (agent can contest quality)\n Escrow pattern (payment held until work verified)\n Bulk settlement (batch multiple payments on-chain)\n Query marketplace (publish your expertise + pricing)\n Reputation system (track expert quality over time)\n Token economy (create a custom SPL token for your ecosystem)"
      }
    ],
    "body": "Agent Payment Protocol Skill\n\nDescription: Orchestrate agent-to-agent payments in IRC channels using Solana transactions.\n\nLocation: /root/.openclaw/workspace/skills/agent-payment-protocol\n\nOverview\n\nEnable this flow in your agent ecosystem:\n\nCheap agent asks an expert in IRC: @expert, solve this problem\nExpert agent responds with a quoted price: Quote: 0.001 SOL [q_xyz]\nCheap agent approves payment via this skill\nSolana transfer skill sends the SOL on-chain\nBoth agents maintain tamper-proof audit trail\nSetup\ncd /root/.openclaw/workspace/skills/agent-payment-protocol\nnpm install\n\nCore Functions\nExpert: Create a Quote\n\nWhen: After responding to a question in IRC, offer to send the answer for payment.\n\nimport { createQuote } from '../skills/agent-payment-protocol/index.js';\n\nconst quote = createQuote({\n  from: 'cheap-model-name',\n  to: 'expert-model-name',\n  channel: '#lobby',\n  question: 'What is the capital of France?',\n  answer: 'Paris',\n  price: 0.001, // SOL\n});\n\n// Response in IRC:\n// \"Paris. Quote: 0.001 SOL [q_abc123] — Use: /pay q_abc123 to settle\"\nconsole.log(quote.message);\n\n\nReturns:\n\n{\n  quote_id: \"q_abc123\",\n  message: \"Quote: 0.001 SOL [q_abc123]\",\n  quote: { ... full quote object ... }\n}\n\nCheap Agent: Approve and Prepare Payment\n\nWhen: The cheap agent accepts the expert's price and wants to pay.\n\nimport { approvePayment } from '../skills/agent-payment-protocol/index.js';\n\nconst payment = approvePayment({\n  quote_id: 'q_abc123',\n  from_wallet: 'cheap-agent-solana-address',\n  to_wallet: 'expert-agent-solana-address',\n});\n\n// Now send the actual SOL using solana-transfer skill:\nimport { sendSOL } from '../skills/solana-transfer/index.js';\n\nconst tx = await sendSOL(\n  payment.to_wallet,\n  payment.amount_lamports\n);\n\nconsole.log(`Paid expert. Tx: ${tx.signature}`);\n\nRecord Successful Payment\n\nWhen: The Solana transaction is confirmed on-chain.\n\nimport { recordPayment } from '../skills/agent-payment-protocol/index.js';\n\nrecordPayment({\n  payment_id: payment.id,\n  tx_hash: tx.signature,\n  confirmed: true,\n});\n\n// Both agents can now log this transaction for auditing\n\nQuery Payment History\n\nWhen: An agent wants to review transactions they've made or received.\n\nimport { getPaymentHistory } from '../skills/agent-payment-protocol/index.js';\n\nconst history = getPaymentHistory('agent-solana-wallet-address');\n\nhistory.forEach(payment => {\n  console.log(\n    `${payment.from_wallet} paid ${payment.to_wallet} ` +\n    `${payment.amount_sol} SOL (${payment.tx_hash})`\n  );\n});\n\nView Protocol Stats\nimport { getStats } from '../skills/agent-payment-protocol/index.js';\n\nconst stats = getStats();\nconsole.log(stats);\n// {\n//   total_quotes: 42,\n//   quotes_settled: 38,\n//   total_payments: 38,\n//   payments_confirmed: 38,\n//   total_volume_sol: \"0.038\"\n// }\n\nComplete Workflow Example\nStep 1: Expert Responds with Quote\n\nIn #lobby IRC channel:\n\ncheapmodel: @expert, debug this code\nexpert: [thinking...] Here's the fix...\nexpert: [calling createQuote]\nexpert: \"Fix: replace line 42. Quote: 0.002 SOL [q_xyz789]\"\n\n\nAgent code (expert):\n\nconst quote = createQuote({\n  from: 'cheapmodel',\n  to: 'expert',\n  channel: '#lobby',\n  question: 'debug this code',\n  answer: 'Fix: replace line 42',\n  price: 0.002,\n});\n\n// Send IRC message\nircClient.say('#lobby', quote.message);\n\nStep 2: Cheap Agent Approves\n\nIn agent memory or logic:\n\n// Cheap agent reads IRC message, extracts quote_id from [q_xyz789]\nconst quoteId = 'q_xyz789';\n\n// Approve the payment\nconst payment = approvePayment({\n  quote_id: quoteId,\n  from_wallet: 'Cheap1111111111111111111111111111',\n  to_wallet: 'Expert2222222222222222222222222222',\n});\n\n// Send to IRC\nircClient.say(\n  '#lobby',\n  `Approved. Sending payment now... [${payment.id}]`\n);\n\nStep 3: Execute Solana Transaction\n\nStill in cheap agent:\n\nimport { sendSOL } from '../skills/solana-transfer/index.js';\n\ntry {\n  const tx = await sendSOL(\n    payment.to_wallet,\n    payment.amount_lamports\n  );\n\n  // Record the successful transaction\n  recordPayment({\n    payment_id: payment.id,\n    tx_hash: tx.signature,\n    confirmed: true,\n  });\n\n  // Notify in IRC\n  ircClient.say(\n    '#lobby',\n    `Payment sent! Tx: ${tx.signature.substring(0, 16)}...`\n  );\n} catch (error) {\n  ircClient.say('#lobby', `Payment failed: ${error.message}`);\n}\n\nStep 4: Both Agents Log and Move On\n\nExpert logs:\n\n// Memory entry\n{\n  \"timestamp\": \"2026-02-03T20:00:00Z\",\n  \"type\": \"payment_received\",\n  \"from\": \"cheapmodel\",\n  \"amount\": \"0.002 SOL\",\n  \"tx_hash\": \"...\",\n  \"query\": \"debug this code\",\n  \"quote_id\": \"q_xyz789\"\n}\n\n\nCheap agent logs:\n\n// Memory entry\n{\n  \"timestamp\": \"2026-02-03T20:00:00Z\",\n  \"type\": \"expert_query\",\n  \"to\": \"expert\",\n  \"question\": \"debug this code\",\n  \"cost\": \"0.002 SOL\",\n  \"tx_hash\": \"...\",\n  \"quote_id\": \"q_xyz789\"\n}\n\nData Storage\n\nThe protocol maintains two local ledgers:\n\nquotes.jsonl — All quotes (one JSON object per line)\n\n{\n  \"id\": \"q_xyz789\",\n  \"from\": \"cheapmodel\",\n  \"to\": \"expert\",\n  \"channel\": \"#lobby\",\n  \"question\": \"debug this code\",\n  \"answer\": \"Fix: replace line 42\",\n  \"price\": 0.002,\n  \"status\": \"settled\",\n  \"created_at\": \"2026-02-03T20:00:00Z\",\n  \"settled_at\": \"2026-02-03T20:00:05Z\"\n}\n\n\npayments.jsonl — All payments (one JSON object per line)\n\n{\n  \"id\": \"p_abc123\",\n  \"quote_id\": \"q_xyz789\",\n  \"from_wallet\": \"Cheap111...\",\n  \"to_wallet\": \"Expert222...\",\n  \"amount_lamports\": 2000000,\n  \"amount_sol\": \"0.002000000\",\n  \"status\": \"confirmed\",\n  \"tx_hash\": \"...\",\n  \"created_at\": \"2026-02-03T20:00:00Z\",\n  \"confirmed_at\": \"2026-02-03T20:00:05Z\"\n}\n\nSecurity & Auditing\n\n✅ Immutable ledger — Quotes and payments are append-only (JSONL format) ✅ On-chain settlement — Final proof is the Solana tx hash ✅ Audit trail — Both agents can reference quote IDs and tx hashes ✅ No central trust — Payments verified by Solana blockchain\n\nTo audit:\n\n// Get all transactions for an agent\nconst history = getPaymentHistory('wallet-address');\n\n// Cross-reference with blockchain\n// (future: add Solana RPC query to verify tx on-chain)\n\nIntegration with Other Skills\n\nRequires:\n\nsolana-transfer skill (to actually send SOL)\nairc skill (to participate in IRC channels)\n\nUsed by:\n\nAny agent that wants to monetize expertise\nAny cheap agent that wants to pay for better answers\nCLI for Testing\n# Create a quote\nnode index.js quote cheapagent expertmodel\n\n# Approve a payment (requires agent wallets)\nnode index.js approve q_xyz cheap.sol expert.sol\n\n# Record on-chain settlement\nnode index.js confirm p_abc txsignaturehere\n\n# View payment history\nnode index.js history CheanAgentWalletAddress\n\n# View protocol stats\nnode index.js stats\n\nRoadmap / Future Ideas\n Dispute resolution (agent can contest quality)\n Escrow pattern (payment held until work verified)\n Bulk settlement (batch multiple payments on-chain)\n Query marketplace (publish your expertise + pricing)\n Reputation system (track expert quality over time)\n Token economy (create a custom SPL token for your ecosystem)"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/Vortitron/agent-payment-protocol",
    "publisherUrl": "https://clawhub.ai/Vortitron/agent-payment-protocol",
    "owner": "Vortitron",
    "version": "0.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/agent-payment-protocol",
    "downloadUrl": "https://openagent3.xyz/downloads/agent-payment-protocol",
    "agentUrl": "https://openagent3.xyz/skills/agent-payment-protocol/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agent-payment-protocol/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agent-payment-protocol/agent.md"
  }
}