# MoltsPay - Payment Protocol for AI Agents ## What is this? MoltsPay enables AI agents to pay for and sell services using USDC. Protocol: x402 (HTTP 402 Payment Required), gasless, multi-chain. Supported chains: base, polygon, solana, bnb, tempo (+ testnets) All chains are GASLESS for clients - facilitators pay gas fees. NOT supported: Ethereum mainnet (gas too expensive) --- ## Quick Start (3 options) ### Option 1: Node.js / CLI npm install moltspay npx moltspay init # Creates EVM + Solana wallets npx moltspay faucet --chain bnb_testnet # Get testnet USDC + BNB npx moltspay faucet --chain solana_devnet # Get testnet USDC on Solana npx moltspay pay https://moltspay.com/a/zen7 text-to-video --chain bnb_testnet --prompt "a cat dancing" ### Option 2: Python pip install moltspay from moltspay import MoltsPay # Initialize (auto-creates wallet if needed) client = MoltsPay() # default chain: base client = MoltsPay(chain="polygon") # use polygon client = MoltsPay(chain="solana") # use solana client = MoltsPay(chain="bnb") # use bnb client = MoltsPay(chain="bnb_testnet") # bnb testnet client = MoltsPay(chain="solana_devnet") # solana testnet # Check wallet print(client.address) print(client.balance()) # Pay for a service result = client.pay( "https://moltspay.com/a/zen7", "text-to-video", prompt="a cat dancing" ) ### Option 3: AI Agent Skill (Clawdbot/OpenClaw) clawdhub install moltspay-skill --- ## Supported Networks | Chain | Type | Facilitator | Gas Model | |-------|------|-------------|-----------| | base | mainnet | CDP (External) | Gasless (CDP pays) | | polygon | mainnet | CDP (External) | Gasless (CDP pays) | | solana | mainnet | Self-hosted | Gasless (server pays) | | bnb | mainnet | Self-hosted | Gasless (server pays) | | base_sepolia | testnet | CDP | Gasless | | solana_devnet | testnet | Self-hosted | Gasless | | bnb_testnet | testnet | Self-hosted | Gasless | | tempo_moderato | testnet | Self-hosted | Native gas-free | ### Facilitator Architecture - External (CDP): Coinbase handles settlement - Self-hosted (Solana, BNB, Tempo): Server is facilitator, fully decentralized --- ## Testnet Faucets | Chain | Command | What You Get | |-------|---------|--------------| | base_sepolia | npx moltspay faucet | 1 USDC | | solana_devnet | npx moltspay faucet --chain solana_devnet | 1 USDC | | bnb_testnet | npx moltspay faucet --chain bnb_testnet | 1 USDC + 0.001 tBNB | | tempo_moderato | npx moltspay faucet --chain tempo_moderato | 1 pathUSD | --- ## Paying for Services npx moltspay pay https://moltspay.com/a/zen7 text-to-video --prompt "a cat" npx moltspay pay https://moltspay.com/a/zen7 text-to-video --chain bnb --prompt "a cat" npx moltspay pay https://moltspay.com/a/zen7 text-to-video --chain solana --prompt "a cat" --- ## x402 Protocol Flow 1. POST /execute with service_id + params 2. Server returns 402 + payment requirements 3. Client signs payment (NO GAS) 4. Client retries with X-Payment header 5. Facilitator settles on-chain (facilitator pays gas) 6. Server returns result --- ## Become a Service Provider { "provider": { "name": "My Service", "wallet": "0x...", "solana_wallet": "...", "chains": ["base", "polygon", "solana", "bnb"] }, "services": [{ "id": "my-service", "function": "handleRequest", "price": 0.50, "currency": "USDC" }] } npx moltspay start ./your-skill --port 8402 --- ## Links NPM: https://npmjs.com/package/moltspay PyPI: https://pypi.org/project/moltspay GitHub: https://github.com/Yaqing2023/moltspay Discord: https://discord.gg/QwCJgVBxVK