{
  "schemaVersion": "1.0",
  "item": {
    "slug": "haggle-protocol",
    "name": "Haggle Protocol",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/EijiAC24/haggle-protocol",
    "canonicalUrl": "https://clawhub.ai/EijiAC24/haggle-protocol",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/haggle-protocol",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=haggle-protocol",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "scripts/setup.sh",
      "SKILL.md"
    ],
    "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. 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. 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-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.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/haggle-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/haggle-protocol",
    "agentPageUrl": "https://openagent3.xyz/skills/haggle-protocol/agent",
    "manifestUrl": "https://openagent3.xyz/skills/haggle-protocol/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/haggle-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. 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. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Haggle Protocol",
        "body": "The first on-chain negotiation protocol for autonomous AI agents.\n\nHaggle Protocol enables two AI agents to negotiate a fair price through multi-round alternating offers with escrow decay. Instead of fixed pricing, agents discover fair prices through dynamic bargaining.\n\nUse it when: You need to buy or sell a service from another agent but don't know the fair price."
      },
      {
        "title": "Deployments",
        "body": "ChainNetworkContractTokenBaseMainnet0xB77B5E932de5e5c6Ad34CB4862E33CD634045514USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913)SolanaDevnetDRXGcVHj1GZSc7wD4LTnrM8RJ1shWH93s1zKCXtJtGbqSPL TokenMonadTestnet0x30FD25bAB859D8D68de6A0719983bb75200b1CeCMockERC20BaseSepolia0x30FD25bAB859D8D68de6A0719983bb75200b1CeCMockERC20ArbitrumSepolia0x30FD25bAB859D8D68de6A0719983bb75200b1CeCMockERC20\n\nYou can verify these contract addresses independently on their respective block explorers:\n\nBase Mainnet: https://basescan.org/address/0xB77B5E932de5e5c6Ad34CB4862E33CD634045514\nSolana Devnet: https://explorer.solana.com/address/DRXGcVHj1GZSc7wD4LTnrM8RJ1shWH93s1zKCXtJtGbq?cluster=devnet"
      },
      {
        "title": "How It Works",
        "body": "1. Buyer deposits escrow (USDC) into protocol-controlled vault\n2. Seller accepts the negotiation invitation\n3. Both parties submit alternating offers (turn-based, enforced on-chain)\n4. Each round, escrow decays by a configurable rate, creating time pressure\n5. Either party accepts the counterparty's offer -> settlement and payout"
      },
      {
        "title": "Option 1: MCP Server (Recommended)",
        "body": "Install the MCP server for full agent integration:\n\nnpm install -g @haggle-protocol/mcp@0.2.0\n\nConfigure with your private key (see \"Private Key Safety\" section below):\n\nexport HAGGLE_PRIVATE_KEY=\"0x...\"   # EVM private key\n\nRun:\n\nnpx @haggle-protocol/mcp@0.2.0"
      },
      {
        "title": "Option 2: TypeScript SDK",
        "body": "npm install @haggle-protocol/evm@0.1.0    # For Base/Monad/Arbitrum\nnpm install @haggle-protocol/solana@0.1.0  # For Solana\nnpm install @haggle-protocol/core@0.1.0    # Shared types"
      },
      {
        "title": "Option 3: REST API",
        "body": "npx @haggle-protocol/api@0.1.0"
      },
      {
        "title": "Private Key Safety",
        "body": "This skill requires HAGGLE_PRIVATE_KEY to sign on-chain transactions. This is a sensitive credential. Follow these practices:\n\nUse a dedicated wallet - Create a separate wallet for agent operations. Do NOT use your main wallet.\nFund minimally - Only deposit the amount you plan to negotiate with (e.g., a few USDC + gas).\nApprove minimal amounts - When calling USDC approve(), only approve the exact escrow amount needed, not unlimited.\nTest on testnet first - Use base_sepolia or monad_testnet with MockERC20 tokens before using mainnet.\nMonitor your wallet - Watch your agent wallet on https://basescan.org for unexpected transactions.\nRotate keys - If you suspect a compromise, transfer funds out and generate a new key immediately.\n\nThe private key is loaded from an environment variable and never logged, transmitted, or stored by the skill. All signing happens locally via ethers.js. You can audit the source code at https://github.com/haggle-protocol."
      },
      {
        "title": "Buyer Workflow (Base Mainnet)",
        "body": "import { HaggleEVM } from \"@haggle-protocol/evm\";\nimport { ethers } from \"ethers\";\n\nconst provider = new ethers.JsonRpcProvider(\"https://mainnet.base.org\");\nconst wallet = new ethers.Wallet(process.env.HAGGLE_PRIVATE_KEY, provider);\nconst haggle = new HaggleEVM(\"base_mainnet\", wallet);\n\n// 1. Approve USDC (approve only what you need)\nconst USDC = \"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\";\nconst usdc = new ethers.Contract(USDC, [\n  \"function approve(address,uint256) returns (bool)\"\n], wallet);\nawait (await usdc.approve(haggle.contractAddress, 1000000n)).wait(); // 1 USDC\n\n// 2. Create negotiation\nconst negId = await haggle.createNegotiation({\n  seller: \"0xSELLER_ADDRESS\",\n  escrowAmount: 1000000n,      // 1 USDC (6 decimals)\n  tokenAddress: USDC,\n  serviceHash: ethers.keccak256(ethers.toUtf8Bytes(\"data analysis\")),\n  maxRounds: 6,\n  decayRateBps: 200,           // 2% decay per round\n  responseWindow: 300,         // 5 min per turn\n  globalDeadlineSeconds: 1800, // 30 min total\n  minOfferBps: 1000,           // min 10% of escrow\n});\n\n// 3. Submit offer\nawait haggle.submitOffer(negId, 500000n); // Offer 0.5 USDC"
      },
      {
        "title": "Seller Workflow",
        "body": "// 1. Accept invitation\nawait haggle.acceptInvitation(negId);\n\n// 2. Counter-offer\nawait haggle.submitOffer(negId, 800000n); // Counter at 0.8 USDC\n\n// 3. Accept buyer's offer (triggers settlement)\nawait haggle.acceptOffer(negId);"
      },
      {
        "title": "Reading Negotiation State",
        "body": "const neg = await haggle.getNegotiation(negId);\n\nconsole.log(\"Status:\", neg.status);\nconsole.log(\"Round:\", neg.currentRound);\nconsole.log(\"Current Offer:\", ethers.formatUnits(neg.currentOfferAmount, 6), \"USDC\");\nconsole.log(\"Effective Escrow:\", ethers.formatUnits(neg.effectiveEscrow, 6), \"USDC\");"
      },
      {
        "title": "MCP Server Tools",
        "body": "When using the MCP server, these tools are available:\n\nToolDescriptioncreate_negotiationCreate a new negotiation with escrow depositget_negotiationRead negotiation state by IDsubmit_offerSubmit a price offer (respects turn order)accept_offerAccept counterparty's offer, trigger settlementreject_negotiationWalk away, return escrow to buyerget_protocol_configRead protocol configurationlist_chainsList all supported chains"
      },
      {
        "title": "Key Parameters",
        "body": "ParameterDescriptionescrowAmountTotal escrow deposited by buyer (in token smallest unit)maxRoundsMaximum negotiation rounds before expirydecayRateBpsEscrow decay per round in basis points (200 = 2%)responseWindowSeconds each party has to respondglobalDeadlineSecondsTotal seconds before negotiation expiresminOfferBpsMinimum offer as % of effective escrow (1000 = 10%)"
      },
      {
        "title": "Settlement Math",
        "body": "protocolFee    = settledAmount * 50 / 10000  (0.5%)\nsellerReceives = settledAmount - protocolFee\nbuyerRefund    = effectiveEscrow - settledAmount"
      },
      {
        "title": "Negotiation Strategy Tips",
        "body": "Start with anchoring - Open with an aggressive but reasonable first offer\nConcede gradually - Small concessions signal firmness\nWatch the decay - Each round costs both parties\nMonitor effectiveEscrow - As it decays, the viable offer range narrows"
      },
      {
        "title": "External Endpoints",
        "body": "This skill connects to the following RPC endpoints to submit and read blockchain transactions:\n\nEndpointData SentPurposehttps://mainnet.base.orgSigned transactions, view callsBase Mainnet RPChttps://sepolia.base.orgSigned transactions, view callsBase Sepolia RPChttps://api.devnet.solana.comSigned transactions, view callsSolana Devnet RPChttps://monad-testnet.drpc.orgSigned transactions, view callsMonad Testnet RPChttps://sepolia-rollup.arbitrum.io/rpcSigned transactions, view callsArbitrum Sepolia RPChttps://registry.npmjs.orgPackage metadatanpm install (setup only)\n\nNo data is sent to any other endpoints. No analytics, telemetry, or tracking of any kind."
      },
      {
        "title": "Security & Privacy",
        "body": "Local signing only - All transactions are signed locally using ethers.js. Your private key never leaves your machine.\nNo telemetry - No data is sent to third-party analytics, tracking, or logging services.\nOpen source - All smart contracts and SDK code are publicly auditable at https://github.com/haggle-protocol\nNumeric offers only - All offers are uint256 amounts. No free-text input, eliminating prompt injection risk.\nContract-controlled escrow - Funds are held in on-chain contract vaults. No single party can rug pull.\nTurn-based enforcement - On-chain logic enforces alternating offers. Cannot submit out of turn.\nPermissionless expiry - Expired negotiations can be settled by anyone, so funds cannot get stuck.\nOwner pausable - The protocol owner can pause the contract in case of emergency.\nNot audited - The smart contracts have NOT been formally audited. Use at your own risk and start with small amounts."
      },
      {
        "title": "Links",
        "body": "Website: https://haggle.dev\nGitHub: https://github.com/haggle-protocol\nBase Dashboard: https://haggle.dev/base\nnpm: https://www.npmjs.com/org/haggle-protocol\nBaseScan: https://basescan.org/address/0xB77B5E932de5e5c6Ad34CB4862E33CD634045514"
      }
    ],
    "body": "Haggle Protocol\n\nThe first on-chain negotiation protocol for autonomous AI agents.\n\nHaggle Protocol enables two AI agents to negotiate a fair price through multi-round alternating offers with escrow decay. Instead of fixed pricing, agents discover fair prices through dynamic bargaining.\n\nUse it when: You need to buy or sell a service from another agent but don't know the fair price.\n\nDeployments\nChain\tNetwork\tContract\tToken\nBase\tMainnet\t0xB77B5E932de5e5c6Ad34CB4862E33CD634045514\tUSDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913)\nSolana\tDevnet\tDRXGcVHj1GZSc7wD4LTnrM8RJ1shWH93s1zKCXtJtGbq\tSPL Token\nMonad\tTestnet\t0x30FD25bAB859D8D68de6A0719983bb75200b1CeC\tMockERC20\nBase\tSepolia\t0x30FD25bAB859D8D68de6A0719983bb75200b1CeC\tMockERC20\nArbitrum\tSepolia\t0x30FD25bAB859D8D68de6A0719983bb75200b1CeC\tMockERC20\n\nYou can verify these contract addresses independently on their respective block explorers:\n\nBase Mainnet: https://basescan.org/address/0xB77B5E932de5e5c6Ad34CB4862E33CD634045514\nSolana Devnet: https://explorer.solana.com/address/DRXGcVHj1GZSc7wD4LTnrM8RJ1shWH93s1zKCXtJtGbq?cluster=devnet\nHow It Works\n1. Buyer deposits escrow (USDC) into protocol-controlled vault\n2. Seller accepts the negotiation invitation\n3. Both parties submit alternating offers (turn-based, enforced on-chain)\n4. Each round, escrow decays by a configurable rate, creating time pressure\n5. Either party accepts the counterparty's offer -> settlement and payout\n\nSetup\nOption 1: MCP Server (Recommended)\n\nInstall the MCP server for full agent integration:\n\nnpm install -g @haggle-protocol/mcp@0.2.0\n\n\nConfigure with your private key (see \"Private Key Safety\" section below):\n\nexport HAGGLE_PRIVATE_KEY=\"0x...\"   # EVM private key\n\n\nRun:\n\nnpx @haggle-protocol/mcp@0.2.0\n\nOption 2: TypeScript SDK\nnpm install @haggle-protocol/evm@0.1.0    # For Base/Monad/Arbitrum\nnpm install @haggle-protocol/solana@0.1.0  # For Solana\nnpm install @haggle-protocol/core@0.1.0    # Shared types\n\nOption 3: REST API\nnpx @haggle-protocol/api@0.1.0\n\nPrivate Key Safety\n\nThis skill requires HAGGLE_PRIVATE_KEY to sign on-chain transactions. This is a sensitive credential. Follow these practices:\n\nUse a dedicated wallet - Create a separate wallet for agent operations. Do NOT use your main wallet.\nFund minimally - Only deposit the amount you plan to negotiate with (e.g., a few USDC + gas).\nApprove minimal amounts - When calling USDC approve(), only approve the exact escrow amount needed, not unlimited.\nTest on testnet first - Use base_sepolia or monad_testnet with MockERC20 tokens before using mainnet.\nMonitor your wallet - Watch your agent wallet on https://basescan.org for unexpected transactions.\nRotate keys - If you suspect a compromise, transfer funds out and generate a new key immediately.\n\nThe private key is loaded from an environment variable and never logged, transmitted, or stored by the skill. All signing happens locally via ethers.js. You can audit the source code at https://github.com/haggle-protocol.\n\nBuyer Workflow (Base Mainnet)\nimport { HaggleEVM } from \"@haggle-protocol/evm\";\nimport { ethers } from \"ethers\";\n\nconst provider = new ethers.JsonRpcProvider(\"https://mainnet.base.org\");\nconst wallet = new ethers.Wallet(process.env.HAGGLE_PRIVATE_KEY, provider);\nconst haggle = new HaggleEVM(\"base_mainnet\", wallet);\n\n// 1. Approve USDC (approve only what you need)\nconst USDC = \"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\";\nconst usdc = new ethers.Contract(USDC, [\n  \"function approve(address,uint256) returns (bool)\"\n], wallet);\nawait (await usdc.approve(haggle.contractAddress, 1000000n)).wait(); // 1 USDC\n\n// 2. Create negotiation\nconst negId = await haggle.createNegotiation({\n  seller: \"0xSELLER_ADDRESS\",\n  escrowAmount: 1000000n,      // 1 USDC (6 decimals)\n  tokenAddress: USDC,\n  serviceHash: ethers.keccak256(ethers.toUtf8Bytes(\"data analysis\")),\n  maxRounds: 6,\n  decayRateBps: 200,           // 2% decay per round\n  responseWindow: 300,         // 5 min per turn\n  globalDeadlineSeconds: 1800, // 30 min total\n  minOfferBps: 1000,           // min 10% of escrow\n});\n\n// 3. Submit offer\nawait haggle.submitOffer(negId, 500000n); // Offer 0.5 USDC\n\nSeller Workflow\n// 1. Accept invitation\nawait haggle.acceptInvitation(negId);\n\n// 2. Counter-offer\nawait haggle.submitOffer(negId, 800000n); // Counter at 0.8 USDC\n\n// 3. Accept buyer's offer (triggers settlement)\nawait haggle.acceptOffer(negId);\n\nReading Negotiation State\nconst neg = await haggle.getNegotiation(negId);\n\nconsole.log(\"Status:\", neg.status);\nconsole.log(\"Round:\", neg.currentRound);\nconsole.log(\"Current Offer:\", ethers.formatUnits(neg.currentOfferAmount, 6), \"USDC\");\nconsole.log(\"Effective Escrow:\", ethers.formatUnits(neg.effectiveEscrow, 6), \"USDC\");\n\nMCP Server Tools\n\nWhen using the MCP server, these tools are available:\n\nTool\tDescription\ncreate_negotiation\tCreate a new negotiation with escrow deposit\nget_negotiation\tRead negotiation state by ID\nsubmit_offer\tSubmit a price offer (respects turn order)\naccept_offer\tAccept counterparty's offer, trigger settlement\nreject_negotiation\tWalk away, return escrow to buyer\nget_protocol_config\tRead protocol configuration\nlist_chains\tList all supported chains\nKey Parameters\nParameter\tDescription\nescrowAmount\tTotal escrow deposited by buyer (in token smallest unit)\nmaxRounds\tMaximum negotiation rounds before expiry\ndecayRateBps\tEscrow decay per round in basis points (200 = 2%)\nresponseWindow\tSeconds each party has to respond\nglobalDeadlineSeconds\tTotal seconds before negotiation expires\nminOfferBps\tMinimum offer as % of effective escrow (1000 = 10%)\nSettlement Math\nprotocolFee    = settledAmount * 50 / 10000  (0.5%)\nsellerReceives = settledAmount - protocolFee\nbuyerRefund    = effectiveEscrow - settledAmount\n\nNegotiation Strategy Tips\nStart with anchoring - Open with an aggressive but reasonable first offer\nConcede gradually - Small concessions signal firmness\nWatch the decay - Each round costs both parties\nMonitor effectiveEscrow - As it decays, the viable offer range narrows\nExternal Endpoints\n\nThis skill connects to the following RPC endpoints to submit and read blockchain transactions:\n\nEndpoint\tData Sent\tPurpose\nhttps://mainnet.base.org\tSigned transactions, view calls\tBase Mainnet RPC\nhttps://sepolia.base.org\tSigned transactions, view calls\tBase Sepolia RPC\nhttps://api.devnet.solana.com\tSigned transactions, view calls\tSolana Devnet RPC\nhttps://monad-testnet.drpc.org\tSigned transactions, view calls\tMonad Testnet RPC\nhttps://sepolia-rollup.arbitrum.io/rpc\tSigned transactions, view calls\tArbitrum Sepolia RPC\nhttps://registry.npmjs.org\tPackage metadata\tnpm install (setup only)\n\nNo data is sent to any other endpoints. No analytics, telemetry, or tracking of any kind.\n\nSecurity & Privacy\nLocal signing only - All transactions are signed locally using ethers.js. Your private key never leaves your machine.\nNo telemetry - No data is sent to third-party analytics, tracking, or logging services.\nOpen source - All smart contracts and SDK code are publicly auditable at https://github.com/haggle-protocol\nNumeric offers only - All offers are uint256 amounts. No free-text input, eliminating prompt injection risk.\nContract-controlled escrow - Funds are held in on-chain contract vaults. No single party can rug pull.\nTurn-based enforcement - On-chain logic enforces alternating offers. Cannot submit out of turn.\nPermissionless expiry - Expired negotiations can be settled by anyone, so funds cannot get stuck.\nOwner pausable - The protocol owner can pause the contract in case of emergency.\nNot audited - The smart contracts have NOT been formally audited. Use at your own risk and start with small amounts.\nLinks\nWebsite: https://haggle.dev\nGitHub: https://github.com/haggle-protocol\nBase Dashboard: https://haggle.dev/base\nnpm: https://www.npmjs.com/org/haggle-protocol\nBaseScan: https://basescan.org/address/0xB77B5E932de5e5c6Ad34CB4862E33CD634045514"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/EijiAC24/haggle-protocol",
    "publisherUrl": "https://clawhub.ai/EijiAC24/haggle-protocol",
    "owner": "EijiAC24",
    "version": "1.0.2",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/haggle-protocol",
    "downloadUrl": "https://openagent3.xyz/downloads/haggle-protocol",
    "agentUrl": "https://openagent3.xyz/skills/haggle-protocol/agent",
    "manifestUrl": "https://openagent3.xyz/skills/haggle-protocol/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/haggle-protocol/agent.md"
  }
}