{
  "markdown": "# ZeroDust\n\n**Exit a blockchain completely - transfer 100% of your native gas balance via EIP-7702**\n\nZeroDust is an intent-based exit system that enables users to sweep their entire native gas token balance to exactly zero via EIP-7702 sponsored execution.\n\n## For AI agents\n\nAgents accumulate dust as a byproduct of existing. Anything doing multi-chain\nwork — arbitrage, bridging, testing, deployment — ends up with stranded gas on\nchains it will never touch again. A human notices and shrugs; an unattended\nagent leaks capital indefinitely.\n\n### Look first, no install, no key\n\nThe hosted MCP server needs nothing installed. Point any MCP client at:\n\n```\nhttps://api.zerodust.xyz/mcp\n```\n\nThat is enough to find out whether an address has anything stranded and what\nrecovering it would cost. It is read-only, because it holds no keys.\n\n### Then sweep, with the key wherever you keep it\n\n```json\n{\n  \"mcpServers\": {\n    \"zerodust\": {\n      \"command\": \"npx\",\n      \"args\": [\"@zerodust/mcp-server\"],\n      \"env\": {\n        \"ZERODUST_ALLOW_EXECUTE\": \"true\",\n        \"ZERODUST_SIGNER_MODULE\": \"./my-signer.mjs\"\n      }\n    }\n  }\n}\n```\n\nRead-only by default. Sweeping needs the explicit opt-in above plus a signing\nkey, and there are four ways to supply one so a raw key never has to sit in a\nconfig file:\n\n| Variable | Key lives in |\n|----------|--------------|\n| `ZERODUST_SIGNER_MODULE` | your custody provider — any module returning a viem `LocalAccount`, which is what Turnkey, Privy and KMS adapters produce |\n| `ZERODUST_KEYSTORE_FILE` | an encrypted V3 keystore, with the password in a separate file |\n| `ZERODUST_PRIVATE_KEY_FILE` | a file on disk, not in the config |\n| `ZERODUST_PRIVATE_KEY` | the config (simplest, least private) |\n\nFunds can only go to the agent's own address unless\n`ZERODUST_ALLOWED_DESTINATIONS` says otherwise — so a prompt-injected agent still\ncannot send funds somewhere you never approved.\n\n### Try it without risking anything\n\nEvery sweep tool and every SDK sweep accepts `dryRun`. It fetches a real quote,\nproduces all three real signatures, and stops before submitting. Nothing is\nbroadcast and no balance moves:\n\n> \"Do a dry run of sweeping my Arbitrum balance to Base\"\n\nThere is deliberately no testnet mode: the API serves no testnet chains, so a\ntestnet flag would only return empty chain lists and failing quotes. `dryRun`\ngives the same confidence against production.\n\n### Agents can provision their own credentials\n\nThe read-only tools work with no credential at all. For higher limits an agent\ncan issue itself a key with no human in the loop, via the `zerodust_register_api_key`\ntool or directly:\n\n```bash\ncurl -X POST https://api.zerodust.xyz/agent/register \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"my-agent\", \"agentId\": \"my-agent-1\"}'\n# -> { \"apiKey\": \"zd_...\", \"rateLimits\": { \"perMinute\": 300, \"daily\": 1000 } }\n```\n\n| Package | Use |\n|---------|-----|\n| [`@zerodust/mcp-server`](https://www.npmjs.com/package/@zerodust/mcp-server) | MCP (Claude Code, Claude Desktop, any MCP client) |\n| [`@zerodust/sdk`](https://www.npmjs.com/package/@zerodust/sdk) | TypeScript, direct — `createAgentFromPrivateKey` |\n| [`@zerodust/langchain`](https://www.npmjs.com/package/@zerodust/langchain) | LangChain tools |\n| [`@zerodust/ai-sdk`](https://www.npmjs.com/package/@zerodust/ai-sdk) | Vercel AI SDK tools |\n\n**Verified on mainnet** (2026-07-21): Optimism → Base, source balance to exactly\n0, delegation auto-revoked, 99.88% delivered, 23.2s end to end —\n[`0x19456ea8…`](https://optimistic.etherscan.io/tx/0x19456ea86ed91097847ddad6d6b8cfd6a5240dedac3b100d1a06eb64c86def6c).\n\n> **Note on wallets:** the browser UI needs the non-standard\n> `wallet_signAuthorization` RPC, which no shipping wallet exposes yet\n> ([MetaMask #7836](https://github.com/MetaMask/core/pull/7836),\n> [Rabby #3411](https://github.com/RabbyHub/Rabby/pull/3411)). Agents are\n> unaffected — they hold their own keys and sign locally.\n\n## The Problem\n\nWhen users want to fully exit a blockchain, they face an impossible situation:\n\n```\nUser has: 0.0008 ETH on Arbitrum\nUser wants: 0 ETH on Arbitrum (transfer everything to Base)\n\nThe Problem:\n├── To send ETH, you need ETH for gas\n├── If you send all your ETH, you can't pay gas\n├── If you keep gas, you can't send all your ETH\n└── Result: Small amount always stranded\n```\n\n**ZeroDust is the only solution that enables complete chain exits for native gas tokens.**\n\n## How It Works\n\n1. User connects wallet to ZeroDust\n2. User selects source chain and destination (same-chain or cross-chain)\n3. User signs ONE authorization (no gas needed)\n4. ZeroDust sponsor executes the sweep\n5. User receives funds on destination\n6. **Origin chain balance: EXACTLY ZERO**\n\n## Supported Sweep Cases\n\n| Case | Description | Example |\n|------|-------------|---------|\n| Cross-chain, same address | Exit to yourself on another chain | Arbitrum → Base (same wallet) |\n| Cross-chain, different address | Exit to another wallet on another chain | Arbitrum → Base (different wallet) |\n| Same-chain, different address | Consolidate to another wallet | Arbitrum → Arbitrum (different wallet) |\n\n**Post-Condition (enforced on-chain):** Source balance = exactly 0 wei\n\n## Supported Chains\n\n**Contract Address (same on all chains):** `0x3732398281d0606aCB7EC1D490dFB0591BE4c4f2`\n\nThe contract is deployed on 26 mainnets. **25 of those are live in the API** —\nApechain (33139) is deployed but disabled, because it turned out not to support\nEIP-7702.\n\n| Chain | ID | Token | Chain | ID | Token |\n|-------|---:|-------|-------|---:|-------|\n| Ethereum | 1 | ETH | Mantle | 5000 | MNT |\n| Optimism | 10 | ETH | Superseed | 5330 | ETH |\n| BNB Chain | 56 | BNB | Base | 8453 | ETH |\n| Gnosis | 100 | xDAI | Plasma | 9745 | XPL |\n| Unichain | 130 | ETH | Mode | 34443 | ETH |\n| Polygon | 137 | POL | Arbitrum | 42161 | ETH |\n| Sonic | 146 | S | Celo | 42220 | CELO |\n| X Layer | 196 | OKB | Ink | 57073 | ETH |\n| Fraxtal | 252 | FRAX | BOB | 60808 | ETH |\n| World Chain | 480 | ETH | Berachain | 80094 | BERA |\n| Sei | 1329 | SEI | Scroll | 534352 | ETH |\n| Story | 1514 | IP | Zora | 7777777 | ETH |\n| Soneium | 1868 | ETH | | | |\n\nThis table is generated from the live API, which is the only authoritative\nanswer to what an integration can actually use:\n\n```bash\nnode scripts/generate-chain-docs.mjs          # regenerate\nnode scripts/generate-chain-docs.mjs --check  # fail if a doc has drifted\ncurl https://api.zerodust.xyz/chains          # the source of truth\n```\n\nPlease do not hand-edit it. Earlier versions of this table claimed 26 live\nchains and named 1514 \"Astar zkEVM\", 5330 \"Kaia\" and 57073 \"Redstone\" — three\nchains that are not the ones deployed there. An agent that acts on a wrong chain\nname gets an error and reasonably concludes the service is broken.\n\nThe contract is also on 46 testnets, but **the API serves no testnet chains**, so\nthere is no testnet environment to integrate against. Use the `dryRun` option in\nthe SDK or the MCP server to exercise the full flow without moving funds.\n\nSee [contracts/README.md](./contracts/README.md) for explorer links.\n\n## Project Structure\n\n```\nzerodust/\n├── contracts/          # Smart contracts (Foundry)\n│   ├── src/\n│   │   ├── ZeroDustSweepMainnet.sol   # Production contract\n│   │   └── ZeroDustSweepTEST.sol      # Testnet contract\n│   ├── script/\n│   │   └── DeployMainnet.s.sol        # Mainnet deployment (CREATE2)\n│   └── broadcast/                      # Deployment logs\n└── docs/\n```\n\n## Architecture\n\n### Contract Architecture\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                        User's EOA                            │\n│                   (EIP-7702 delegated)                       │\n│                                                              │\n│  ┌─────────────────────────────────────────────────────┐    │\n│  │          ZeroDustSweepMainnet (bytecode)             │    │\n│  │                                                      │    │\n│  │              executeSweep(intent, sig)               │    │\n│  │                        │                             │    │\n│  │           ┌────────────┴────────────┐                │    │\n│  │           ▼                         ▼                │    │\n│  │    MODE_TRANSFER (0)         MODE_CALL (1)           │    │\n│  │    Same-chain sweep          Cross-chain sweep       │    │\n│  │           │                         │                │    │\n│  │           ▼                         ▼                │    │\n│  │    Transfer to              Call bridge target       │    │\n│  │    destination              (callTarget + callData)  │    │\n│  │                                     │                │    │\n│  └─────────────────────────────────────┼────────────────┘    │\n│                                        │                     │\n└────────────────────────────────────────┼─────────────────────┘\n                                         │\n                                         ▼\n                          ┌─────────────────────────┐\n                          │     External Bridge     │\n                          │       (Gas.zip)         │\n                          │                         │\n                          │   Delivers funds on     │\n                          │   destination chain     │\n                          └─────────────────────────┘\n```\n\n### Security Model\n\n- **No admin functions** - Immutable after deployment\n- **No upgradability** - What you see is what you get\n- **Unified SweepIntent** - Single signed structure for all sweep types\n- **Zero balance enforcement** - Contract reverts if any balance remains\n- **ERC-7201 storage** - Prevents slot collisions with other EIP-7702 apps\n- **Immutable sponsors** - Stored in bytecode, not storage\n\n## Fee Structure\n\n**Service Fee:** 1% of swept value, with $0.05 minimum and $0.50 maximum.\n\n```\nTotal Fee = Gas Reimbursement + Service Fee + Bridge Fee (if cross-chain)\n\nExamples:\n- $5 balance → $0.05 fee (1% = $0.05, at min) → User receives ~$4.95\n- $10 balance → $0.10 fee (1%) → User receives ~$9.90\n- $60 balance → $0.50 fee (max) → User receives ~$59.50\n```\n\n## Documentation\n\n- [contracts/README.md](./contracts/README.md) - Contract details and deployment\n- [contracts/SPECIFICATION.md](./contracts/SPECIFICATION.md) - Technical specification\n- [contracts/DEPLOYMENT.md](./contracts/DEPLOYMENT.md) - Deployment guide\n\n## Security\n\nZeroDust is designed with security as the top priority:\n\n- **No fund custody** - All operations are atomic, single-transaction\n- **User-controlled limits** - maxTotalFeeWei and minReceive signed by user\n- **Mandatory simulation** - Every transaction simulated before execution\n- **routeHash binding** - Signature bound to specific bridge route (cross-chain)\n- **Internal security review** - 7 rounds, 16 issues identified and fixed\n- **External audit** - Pending (required before full launch)\n\n## Status\n\n**Smart Contract:** Deployed on 26 mainnets + 46 testnets. **25 mainnets are\nenabled in the API**; the API serves no testnets.\n\n### Contract Versions\n\n| Contract | Status | Features |\n|---------|--------|----------|\n| ZeroDustSweepMainnet | **Production** | Unified SweepIntent, granular fees, sponsor model |\n| ZeroDustSweepTEST | Testnet | Same as mainnet, for testing |\n\n### Verified Mainnet Sweeps\n\n| Chain | Swept | TX |\n|-------|-------|-----|\n| Base | $3.46 → 0 | [View](https://basescan.org/tx/0x2f59a4598c7fcdce404c2330d361fda1cbab84b841e85bec82ca12164101b73d) |\n| Arbitrum | $3.57 → 0 | [View](https://arbiscan.io/tx/0xffa0a26008157b0225a7c15c2263b80b6e386520dce69b58827320ced0dc5c62) |\n| BSC | $2.25 → 0 | [View](https://bscscan.com/tx/0xc94f52c8689268118e3d42dd678916982b5479adb0e69227ddd1c3142ea52972) |\n| Polygon | $7.55 → 0 | [View](https://polygonscan.com/tx/0xc21c4c29dbe1624c06a2a9a7692ac68409f3407f0c1960f01100ef39ceeb369f) |\n\nSee [contracts/README.md](./contracts/README.md) for full deployment list.\n\n### Testnets NOT Supporting EIP-7702\n\nThe following testnets were tested and do not support EIP-7702:\n\nAbstract, Lens, zkSync, Taiko, opBNB, Avalanche, Swell, Cyber, Boba, Metis, Fuse, Aurora, Flare, Vana, Corn, Rootstock, Apechain, IoTeX, Viction, XDC, Telos, Kava, EDU Chain, Gravity, Manta Pacific, Lightlink, Moonbase, Nibiru, Somnia, Rari, Blast, Xai, B3, Mezo, Chiliz, HashKey, Memecore\n\n*Note: Mainnet support may differ from testnet.*\n\n## Cross-Chain Bridging\n\nZeroDust supports cross-chain sweeps via the MODE_CALL pattern:\n\n- **callTarget**: Bridge contract address\n- **callData**: Bridge-specific transaction data\n- **routeHash**: `keccak256(callData)` - binds signature to specific route\n\n**Primary Bridge:** [Gas.zip](https://gas.zip) - 239+ chains, ~5 second delivery\n\n## License\n\nMIT License - see [LICENSE](./LICENSE)\n\n---\n\n**Live on 25 mainnet chains.** Contract: `0x3732398281d0606aCB7EC1D490dFB0591BE4c4f2`\n(same address on every chain, via CREATE2).\n",
  "bytes": 12927,
  "sha": "840f6a9d7f484f38788c7d4ad3b583ab7cc85bcef0c46cfe9f0d6771c64c602c",
  "repo_slug": "andresdefi/zerodust",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_andresdefi_zerodust_a009a1c8/readme"
}