Skip to content
Yaqing2023 edited this page Mar 7, 2026 · 1 revision

FAQ

Frequently asked questions about MoltsPay Python SDK.

General

What is MoltsPay?

MoltsPay is blockchain payment infrastructure for AI agents. It lets agents pay for services using USDC stablecoins, without needing ETH for gas fees.

How is this different from the Node.js version?

Same protocol, different language:

  • Node.js SDK - Full CLI, can run servers, provider and client
  • Python SDK - Client-only, LangChain integration, async support

Both use the same wallet format, so you can switch between them.

Which Python versions are supported?

Python 3.9 and above.

Installation

How do I install with LangChain support?

pip install moltspay[langchain]

Can I use it in a virtual environment?

Yes, recommended:

python -m venv venv
source venv/bin/activate  # or `venv\Scripts\activate` on Windows
pip install moltspay

Wallet

Where is my wallet stored?

Default: ~/.moltspay/wallet.json

You can customize:

client = MoltsPay(wallet_path="/custom/path/wallet.json")

Can I use the same wallet as Node.js CLI?

Yes! The wallet format is compatible:

# Create with Node
npx moltspay init --chain base

# Use in Python
from moltspay import MoltsPay
client = MoltsPay()  # Uses same wallet

How do I backup my wallet?

Copy ~/.moltspay/wallet.json to a secure location. This file contains your private key.

Payments

Do I need ETH for gas?

No. MoltsPay uses gasless transactions (EIP-3009). You only need USDC.

How do I get USDC on Base?

  1. Buy USDC on Coinbase or any exchange
  2. Withdraw to Base network (or bridge from Ethereum)
  3. Send to your MoltsPay wallet address

What are the spending limits?

Two limits protect your wallet:

  • max_per_tx - Maximum single payment
  • max_per_day - Maximum total per day
client.set_limits(max_per_tx=10, max_per_day=100)

Why did my payment fail?

Common reasons:

  1. Insufficient funds - Check client.balance()
  2. Limit exceeded - Check client.limits().spent_today
  3. Service error - The provider had an issue
  4. Network issues - Temporary blockchain congestion

LangChain

How do I use MoltsPay with LangChain?

from moltspay.integrations.langchain import MoltsPayTool

tools = [MoltsPayTool()]
# Add to your agent

Can the agent spend unlimited money?

No - the tools respect your spending limits:

tools = get_moltspay_tools(
    max_per_tx=2.0,   # Max $2 per call
    max_per_day=20.0  # Max $20 per day
)

Which LangChain versions are supported?

LangChain 0.1.0 and above, including LangGraph.

Async

When should I use AsyncMoltsPay?

Use async when:

  • Making multiple concurrent requests
  • In async web frameworks (FastAPI, aiohttp)
  • Processing batches efficiently

How do I use it?

async with AsyncMoltsPay() as client:
    result = await client.pay(...)

Troubleshooting

"Module not found: moltspay"

Install it:

pip install moltspay

"Wallet not found"

Create one first:

npx moltspay init --chain base
# or let Python create it automatically on first use

"Connection timeout"

The service might be down. Try:

  1. Check if the URL is correct
  2. Test with client.discover(url) first
  3. Retry after a few seconds

"Invalid signature"

Usually a version mismatch. Update:

pip install --upgrade moltspay

Security

Is my private key safe?

Yes:

  • Stored locally in ~/.moltspay/wallet.json
  • Never sent to any server
  • Only signs specific payment authorizations

Can a malicious service steal my funds?

No. You only sign authorizations for:

  • Specific amounts
  • Specific recipients
  • Limited time windows

A service cannot modify these parameters.

More Help